Skip to content

Secure MERN Stack Authentication App with Email OTP, JWT, Password Reset

Notifications You must be signed in to change notification settings

Krishit-Shah/authly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Authly – Secure Auth System (MERN)

A full-stack authentication system with Email OTP verification, password reset, JWT protection, and clean UI using Bootstrap.

πŸš€ Features

  • πŸ” User Signup + Login with JWT
  • πŸ“§ OTP Verification via Email during Signup
  • πŸ›‘οΈ Protected Dashboard (Private Route)
  • πŸ” Forgot Password with Email Reset Link
  • 🎨 Bootstrap 5 UI + Toast Notifications
  • πŸ”’ Secure Password Hashing using bcrypt
  • βœ‰οΈ Nodemailer-based Email Service
  • 🧠 Temporary in-memory store for OTP
  • πŸ—‚οΈ Fully structured: frontend/ + backend/

πŸ§ͺ How to Run the Project Locally

1. πŸ“¦ Clone the Repository

git clone https://github.com/Krishit-Shah/authly.git
cd authly

2.βš™οΈ Backend Setup

cd backend
npm install

πŸ“ Create a .env file inside backend/ with the following environment variables:

PORT=5000
MONGO_URI=mongodb://localhost:27017/authly
JWT_SECRET=supersecretkey
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_password
CLIENT_URL=http://localhost:3000

πŸ” Note: Use a Gmail App Password if you have 2FA enabled.

Start the backend server:

npm start

🌐 Server runs at: http://localhost:5000

3.πŸ’» Frontend Setup

cd ../frontend
npm install
npm start

🌐 Frontend runs at: http://localhost:3000

4.πŸ“¦ Installed Dependencies

πŸ”§ Backend

  • express
  • mongoose
  • dotenv
  • bcryptjs
  • jsonwebtoken
  • nodemailer
  • cors
npm install express mongoose dotenv bcryptjs jsonwebtoken nodemailer cors

πŸ’» Frontend

  • react
  • react-dom
  • react-router-dom
  • axios
  • react-toastify
  • bootstrap
npm install react react-dom react-router-dom axios react-toastify bootstrap

πŸ› οΈ Tech Stack

πŸ”§ Frontend βš™οΈ Backend πŸ” Security 🧰 Tools
React Node.js JWT Toastify
Bootstrap 5 Express Bcrypt.js Nodemailer
React Router MongoDB OTP Emails Dotenv

πŸ‘¨β€πŸ’» Author

Krishit Shah

  • A complete MERN stack authentication solution built with a focus on security, scalability, and clean architecture.

πŸ“„ License

  • This project is free to use for learning and educational purposes.

πŸ“ Contributing

  • Contributions are welcome. Please submit a pull request with your changes.

🚨 Issues

  • Please report any issues or bugs in the issues section.

πŸ“ˆ Future Development

  • πŸ” Google OAuth Login using react-oauth/google
  • πŸŒ— Light/Dark Mode toggle with persistent theme storage
  • 🧩 Admin-only dashboard with role-based access control
  • πŸ“± Fully mobile-optimized layout using Bootstrap grid
  • πŸ’¬ Custom error handling with user-friendly messages
  • πŸ” Resend OTP with cooldown + expiration UI
  • 🧾 In-app activity logs (user actions & login history)
  • 🌍 Deployment to Render (backend) + Vercel (frontend) with custom domain
  • 🧠 Migration from in-memory store to Redis for OTP in production

About

Secure MERN Stack Authentication App with Email OTP, JWT, Password Reset

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published