Skip to content

mortezaom/express-mongoose-jwt-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express Mongoose JWT Boilerplate

A simple boilerplate project based on ES6+ for kickstarting your web application development with Express.js, Mongoose, and JWT

Features

  • User Authentication:

    • Register and login functionality with bcrypt for password hashing.
    • JWT-based authentication for secure user sessions.
    • Refresh-Token based authentication for long-lived sessions.
  • Middleware:

    • Utilizes Express.js middleware for handling various aspects of request processing.
    • CORS middleware for enabling cross-origin resource sharing.
    • Helmet middleware for securing your app by setting various HTTP headers.
  • Validation:

    • Express-validator for request validation, ensuring data integrity.
  • Logging:

    • Pino (pino-http & pino-pretty) for efficient and structured logging.
  • Security:

    • Utilizes Helmet middleware for securing the application against common web vulnerabilities.
  • Database Integration:

    • MongoDB integration using Mongoose, providing a robust database layer.

Use the template

  1. Clone the repository:

    git clone https://github.com/mortezaom/express-mongoose-jwt-boilerplate.git
  2. Install the dependencies:

    pnpm install
  3. Set the environment variables:

     cp .env.example .env
  4. Start the server:

    pnpm run dev
  5. Open the browser and navigate to http://localhost:5000.

Dependencies

License

Released under the MIT License.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

About

Boilerplate project with Express.js, Mongoose, and JWT for quick and secure rest API development.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published