Skip to content

πŸ” MERN Auth System with JWT, Google OAuth2, Email Verification, Secure Cookies, Password Reset, RBAC.

Notifications You must be signed in to change notification settings

manukumar7/mern-auth-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” MERN Authentication System

A secure, production-level authentication system built with the MERN stack. Includes full JWT-based authentication with refresh tokens, email verification, Google OAuth2 login, role-based access (Admin/User).


MERN React Node.js Express MongoDB Auth Status License

πŸš€ Features

  • πŸ” JWT Access + Refresh Tokens
  • πŸ“§ Email Verification on Registration
  • πŸ” Refresh Token Rotation
  • πŸ”‘ Password Reset via Email (Link or OTP)
  • πŸ”’ Secure Cookies (httpOnly, SameSite, Secure)
  • πŸ›‚ Role-Based Access Control (RBAC)
  • 🌐 Google Login via OAuth2
  • πŸ” Optional 2FA (via email or authenticator app)
  • πŸ›‘ Security: Helmet, CORS, Rate Limiting, XSS Protection

🧱 Tech Stack

Layer Tech
Frontend React, Tailwind CSS, Axios, Formik, joi
Backend Node.js, Express.js, MongoDB, Mongoose
Auth JWT, bcrypt, Google OAuth, passportjs, nodemailer , SendGrid
Security Helmet, cors, express-rate-limit, xss-clean, mongo-sanitize

πŸ“§ Email Integration (SendGrid)

We use SendGrid for transactional emails (signup confirmation, password reset, notifications).


πŸ“Έ UI Preview

screencapture-localhost-5173-2025-08-27-22_55_30

Login page

screencapture-localhost-5173-login-2025-08-27-22_55_48

Signup page

screencapture-localhost-5173-signup-2025-08-27-22_55_57

Reset password page

screencapture-localhost-5173-forgot-password-2025-08-27-22_56_17

βš™οΈ Installation

# Clone the repository
git clone https://github.com/manukumar7/mern-auth-system.git

# Move into the project directory
cd mern-auth-system

# Install dependencies
npm install

▢️ Running the Project

server

cd server
npm run dev

client

cd client
npm run dev

πŸ“© Contributing

πŸ™Œ Contributions are welcome! Feel free to fork the repo and submit a pull request.

Built with ❀️ by Manu Kumar Pal

About

πŸ” MERN Auth System with JWT, Google OAuth2, Email Verification, Secure Cookies, Password Reset, RBAC.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published