An Basic implementation of JWT and Session token
Go to file
Jyotirmoy Bandyopadhayaya 4874669385
Minor Fix and Adjs
2022-09-13 16:00:11 +05:30
.husky Minor Fix and Adjs 2022-09-13 16:00:11 +05:30
controllers Updated Readme 2022-07-05 16:18:55 +05:30
helpers Minor Fix and Adjs 2022-09-13 16:00:11 +05:30
middlewares Added Husky pre-commits checks 2022-07-05 12:34:35 +05:30
models Added Husky pre-commits checks 2022-07-05 12:34:35 +05:30
routes Added Husky pre-commits checks 2022-07-05 12:34:35 +05:30
services Minor Fix and Adjs 2022-09-13 16:00:11 +05:30
utils Minor Fix and Adjs 2022-09-13 16:00:11 +05:30
.env.example Updated Readme 2022-07-05 16:18:55 +05:30
.eslintrc.yml Added Husky pre-commits checks 2022-07-05 12:42:34 +05:30
.gitignore moving to v3 2022-07-04 00:35:08 +05:30
.prettierignore Added Husky pre-commits checks 2022-07-05 12:34:35 +05:30
.prettierrc Added Husky pre-commits checks 2022-07-05 12:34:35 +05:30
LICENSE Auth Complete 2022-02-03 20:56:53 +05:30
README.md Updated Readme 2022-07-05 16:18:55 +05:30
index.js Minor Fix and Adjs 2022-09-13 16:00:11 +05:30
jsconfig.json Added Husky pre-commits checks 2022-07-05 12:34:35 +05:30
package.json Minor Fix and Adjs 2022-09-13 16:00:11 +05:30
yarn.lock Minor Fix and Adjs 2022-09-13 16:00:11 +05:30

README.md

jwt-auth-nodejs

Template to get started with Backend auth module for REST API

imgshields imgshields

forthebadge forthebadge forthebadge forthebadge

Fetures :-

  • MongoDB as Database
  • JWT as Authentication
  • Nodemailer as Email Service
  • Express as Web Server
  • Error Handling with Express
  • RSA Key Value Pair for Encryption
  • Husky as Prettier ESLint and Git Hooks
  • Ready to Deploy

Setup

After pulling this project, create a file named .env in the root of the project and add below configuration. Change the values of below keys as per your requirement.

  • .env example
JWT_ACCESS_TIME=7h
JWT_REFRESH_TIME=30d
REDIS_HOST=192.168.100.101
REDIS_PORT=6379
DB_CONN_STRING=mongodb://127.0.0.1:27017/nodejsjwtauth
MAIL_HOST=smtp.ethereal.email
MAIL_PORT=587
MAIL_USER=cecile.leffler67@ethereal.email
MAIL_PASS=7TfEXqF2GQcmDRGN82
MAIL_FROM="Cecile Leffler <cecile.leffler67@ethereal.email>"
  • Deffi-Hellman key exchange setup
ssh-keygen -t rsa -P "" -b 4096 -m PEM -f jwtRS256.key
ssh-keygen -e -m PEM -f jwtRS256.key > jwtRS256.key.pub