Template to get started with Backend auth module for REST API
- 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
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
[email protected]
MAIL_PASS=7TfEXqF2GQcmDRGN82
MAIL_FROM="Cecile Leffler <[email protected]>"
- 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