This project is a backend Login and Registration System. It encompasses key functionalities such as registration, login, input validation, JWT authentication, refresh tokens, password reset, and OTP support. This backend solution ensures secure and efficient user authentication for web applications built with the MERN stack.
- β Registration
- β Login
- β Input Validation
- β JWT Auth Token
- β Refresh Token
- β Password Reset
- β OTP Support
- β Api Access Limit
- β³ Β Google Auth (coming soon)
- NodeJS
- ExpressJS
- MongoDB
- Json Web Token
- Nodemailer
git clone https://github.com/hirushaph/MernAuth-Backend.git
cd MernAuth-backend
npm install
After creating .env file, your folder structer look like this
π MernAuth-Backend
π node-modules
π src
π Controllers
π Models
π Router
π and others
π app.js
π.env <------This is the file you need to create
π.gitignore
π package.json
π README.md
Important
Copy the code below to the .env file and fill in all required variables. π
# define development or production ( default is development )
# If you are deploying for production, set this to production
STATUS=
# Default port is 3000.
# Define the port here if you want to change that.
PORT=
MONGODB_URL=
# Enter your frontend application url here (only if you have frontend)
FRONTEND_URL=
# You can generate a secret by running this command in the terminal:
# "node -e "console.log(require('crypto').randomBytes(32).toString('hex'))".
JWT_ACCESS_SECRET=
JWT_REFRESH_SECRET=
# Smtp Details for email features
HOST=
EPORT=
USER=
PASSWORD=
npm start
- Document Api Endpoints
- Add integration Tests
- User Roles
- OAuth
- Add better comments