A professional, secure, and modern authentication system built with the MERN stack. Features include OTP verification via Gmail, JWT-based authentication, bcrypt password hashing, and robust security best practices. The frontend is crafted with React.js and Tailwind CSS for a seamless user experience.
- OTP Verification: Secure one-time password sent to user’s Gmail for authentication.
- JWT Authentication: Stateless and secure session management.
- Bcrypt Password Hashing: Strong password encryption for user data protection.
- Modern UI: Responsive and attractive interface using React.js & Tailwind CSS.
- Hardened Security: Follows best practices to prevent common vulnerabilities.
git clone https://github.com/roshan-metrix/MERN_Authentication.git
cd MERN_Authentication
cd backend
npm install
PORT = 3000
MONGODB_URI = your mongodb url i.e 'mongodb://localhost:27017' for locally
JWT_SECRET = your jwt secret i.e 'hello12'
NODE_ENV = 'development'
EMAIL_ID = your email
PASSWORD = your email pass
Note: Use Gmail App Passwords for secure email sending.
Start the backend server:
npm run server
cd ../client
npm install
Start the frontend development server:
npm start
- Environment variables for sensitive data
- Rate limiting and input validation
- Secure HTTP headers
- Passwords never stored in plain text
This project is licensed under the MIT License.
Ready to use, secure, and scalable authentication for your next MERN project,enjoy it!