A full-stack authentication system built with the MERN stack (MongoDB, Express.js, React, Node.js). This project demonstrates secure user registration, login, and protected routes using JWT-based authentication.
🌐 Frontend: mern-authentication-fsd.vercel.app
🔗 Backend API: mern-authentication-fsd.onrender.com
📂 GitHub Repository: github.com/kTechKeshav/MERN-Authentication-FSD
- 🔒 JWT-based User Authentication
- ✅ Email Verification with OTP
- 🔁 Password Reset via Email
- 🍪 Secure HTTP-only Cookie Handling
- 📩 Email Sending with Nodemailer
- 📦 Modular Code Structure (MVC)
- 🧾 Protected Routes
- 🔥 Toast Notifications with
react-toastify - 🎨 Fully responsive and clean UI
-
Frontend:
React.jsTailwind CSSViteAxiosReact Router DOM -
Backend:
Node.jsExpress.jsMongoDB + MongooseNodemailerJSON Web Tokens (JWT)bcryptCORScookie-parser
- Clone the repository:
git clone https://github.com/kTechKeshav/MERN-Authentication-FSD.git- Install Backend Dependencies:
cd server
npm install- Install Frontend Dependencies:
cd ../client
npm install- Setup Environment Variables (.env)
- Backend (/server/.env)
PORT=4000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
SENDER_EMAIL=your_email@gmail.com
SENDER_PASSWORD=your_app_password
NODE_ENV=production- Frontend (/client/.env)
VITE_BACKEND_URL=https://mern-authentication-fsd.onrender.com- Start Backend
cd server
npm run server- Start Frontend
cd client
npm run dev- Build Command: vite build
- Output Directory: dist
- Add environment variables
- Start command: node server.js


