- express minimalist web framework for node.
- bcryptjs for password-hashing.
- body-parser as body parsing middleware.
- helmet Helmet helps you secure your Express apps by setting various HTTP headers. It's not a silver bullet, but it can help!
- jsonwebtoken An implementation of JSON Web Tokens.
- mongoose MongoDB object modeling designed to work in an asynchronous environment.
- Make sure that you have Node.js and npm installed.
- Clone this repo using
git clone https://github.com/taheroo/node-authentication
- Move to the appropriate directory:
cd node-authentication
. - Create a
.env
file inside config folder following the example inside.env.example
- Run
npm install
in order to install dependencies. - Run
npm start
to start app. - You can check authentication endpoints using Postman by importing this collection https://www.getpostman.com/collections/2fd07df74b3ef749e207
This template follows a very simple project structure:
src
: This folder is the main container of all the code inside your application.api
: This folder contains main api configurations.config
: Folder to set project configurations.middleware
: Folder that contains all middlewares.models
: Folder that contains all the mongoose models.scripts
: Folder that contains all scripts.app.js
: Entry point of the application.