๐ Hey there, welcome to my base project for Node.js and Express with MongoDB!
This project provides a robust user login system with proper folder structure, user routes, and JWT token implementation for secure authentication. With the help of the yup
package, form validation has also been implemented for input data.
๐ฆ Here are the packages used in this project:
bcrypt
for password hashingbody-parser
for parsing request bodiesdotenv
for loading environment variablesexpress
for creating the web serverjsonwebtoken
for generating and verifying JSON Web Tokens (JWTs)mongoose
for object modeling with MongoDBnodemon
for automatic server restarts during developmentotp-generator
for generating one-time passwords (OTPs)yup
for schema validation
๐ To get started, create an .env
file with your own data:
MONGO_DB
- your MongoDB URIACCESS_TOKEN_SECRET
- your access token secret stringREFRESH_TOKEN_SECRET
- your refresh token secret stringTOKEN_SERVER_PORT
- the port number for the token serverTOKEN_EXPIRY_TIME
- the token expiry time (e.g. "24h")
๐จโ๐ป This project was created by Awais Ahmad (@itsahmadawais) and can be used as a starting point for building secure and scalable Node.js and Express applications with MongoDB. o my base project for Node.js and Express with MongoDB!
This project provides a robust user login system with proper folder structure, user routes, and JWT token implementation for secure authentication. With the help of the yup
package, form validation has also been implemented for input data.
๐ฆ Here are the packages used in this project:
bcrypt
for password hashingbody-parser
for parsing request bodiesdotenv
for loading environment variablesexpress
for creating the web serverjsonwebtoken
for generating and verifying JSON Web Tokens (JWTs)mongoose
for object modeling with MongoDBnodemon
for automatic server restarts during developmentotp-generator
for generating one-time passwords (OTPs)yup
for schema validation
๐ To get started, create an .env
file with your own data:
MONGO_DB
- your MongoDB URIACCESS_TOKEN_SECRET
- your access token secret stringREFRESH_TOKEN_SECRET
- your refresh token secret stringTOKEN_SERVER_PORT
- the port number for the token serverTOKEN_EXPIRY_TIME
- the token expiry time (e.g. "24h")
๐จโ๐ป This project was created by Awais Ahmad (@itsahmadawais) and can be used as a starting point for building secure and scalable Node.js and Express applications with MongoDB.