1.0.0 โ€ข Published 7 months ago

node-scalaton-app-ls v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Express Skeleton Project: Quick Start Template for Node.js Applications ๐Ÿš€

Overview ๐Ÿ“‹

The Express Skeleton is a powerful and customizable starting point for creating scalable and robust Express.js applications. With pre-configured tools and libraries, you can skip boilerplate setup and dive directly into development.

Features ๐ŸŒŸ

  • Pre-configured Structure ๐Ÿ“: Includes routes, models, views, and more.
  • Security-First Approach ๐Ÿ”’: Utilizes helmet for secure HTTP headers and express-jwt for authentication.
  • Database Integration ๐Ÿ’พ: MongoDB-ready with mongoose.
  • API Documentation ๐Ÿ“–: Auto-generate docs using apidoc.
  • Code Quality ๐Ÿงน: Enforced with eslint and airbnb style guide.
  • Testing Ready โœ…: Set up for testing with ava and coverage with nyc.
  • Job Scheduling โฐ: Includes agenda for background job handling.
  • Email Templates โœ‰๏ธ: Simplifies email notifications with email-templates.

Installation โš™๏ธ

Create a directory:

    mkdir <directory_name>

Open the terminal from the directory or in VS Code or any code editor.

Using npx

npx node-scalaton-app-ls

This will:- Download the project files. Install all dependencies. Set up the initial folder structure.

Getting Started ๐Ÿšฆ Running the Server Set up environment variables: create .env file:-

touch .env

Copy the sample environment file:

cp env.SAMPLE .env 

Update values in the .env file as per your configuration. Add secret(e.g: logic-square) in env file

###NOTE:- Sometimes the express-jwt version automatically Upadted to current version but need to change to "^6.1.1". This is the command:-

    npm i express-jwt@6.1.1

Currently we are using mongodb as localhost(Change it accordingly your Database):-

    MONGODB_CONNECTION_STRING="mongodb://localhost:27017/skeleton-3"

Start the development server:

npm start

Open your browser and navigate to:

http://localhost:3000

Folder Structure ๐Ÿ—‚๏ธ

express-skeleton-3/
โ”‚
โ”œโ”€โ”€ agenda/           # Agenda jobs
โ”œโ”€โ”€ bin/              # Server entry point
โ”œโ”€โ”€ email/            # Email definition
โ”œโ”€โ”€ lib/              # Lib file
โ”œโ”€โ”€ models/           # Database schemas
โ”œโ”€โ”€ routes/           # API endpoints
โ”œโ”€โ”€ public/           # Static assets
โ”œโ”€โ”€ views/            # EJS templates for front-end rendering
โ”œโ”€โ”€ tests/            # Unit and integration tests
โ”œโ”€โ”€ app.js            # Main application logic
โ”œโ”€โ”€ package.json      # Project dependencies and scripts
โ””โ”€โ”€ README.md         # Documentation

Available Scripts ๐Ÿ“œ Script Purpose

npm start	Runs the server.
npm run serve	Starts server with nodemon for live reload.
npm run lint	Checks code quality with eslint.
npm run lint:fix	Fixes lint issues automatically.
npm run test	Runs all tests with coverage using ava and nyc.
npm run gendoc	Generates API documentation using apidoc in /public/docs.

Features in Detail ๐Ÿ” 1. Security ๐Ÿ”’ Implements helmet for protecting your app from common vulnerabilities. Uses bcrypt for password hashing. 2. Database ๐Ÿ’พ MongoDB integration with mongoose for schema definition and ORM. 3. Background Jobs โฐ Scheduled tasks managed with agenda. 4. API Documentation ๐Ÿ“„ Automatically generate API documentation with: bash Copy code npm run gendoc View the generated docs in the /public/docs folder. 5. Email Support โœ‰๏ธ Send templated emails with ease using email-templates. Contributing ๐Ÿค We welcome contributions! Please follow these steps:

Fork the repository:

git fork https://github.com/LogicSquare-1996/Node-JS-Scalaton.git

Create a new feature branch:

git checkout -b feature/new-feature

Commit changes:

git commit -m "Add new feature"

Push changes and create a Pull Request.

License ๐Ÿ“œ This project is licensed under the MIT License. Feel free to use it for your own projects.

Contact ๐Ÿ“ง

  • Author: Kiran Debnath
  • Email: kiran@logic-square.com
  • GitHub: LogicSquare-1996
  • Contributor: Mrinal Bera

Start building your next Node.js project with Express Skeleton today! ๐ŸŽ‰