This is a full-stack MERN application with authentication (Email OTP + Google Login) and a dashboard for managing notes.
- Frontend: React, Axios, Material UI
- Backend: Node.js, Express, MongoDB, Passport.js
- Authentication: Email OTP, Google OAuth, JWT
- Database: MongoDB Atlas
- Deployment: Vercel (Frontend), Render or Railway (Backend)
project-root/
├── client/ → React frontend
├── server/ → Express backend
└── README.md → Project documentation
git clone https://github.com/your-username/mern-auth-notes.git
cd mern-auth-notes
cd server
npm install
PORT=5000
MONGO_URI=<your_mongodb_uri>
JWT_SECRET=<your_jwt_secret>
EMAIL_USER=<your_gmail_email>
EMAIL_PASS=<your_gmail_app_password>
GOOGLE_CLIENT_ID=<your_google_client_id>
GOOGLE_CLIENT_SECRET=<your_google_client_secret>
FRONTEND_URL=http://localhost:3000
⚠️ Note: Use a Gmail App Password (not your regular password) forEMAIL_PASS
.
npm start
cd ../client
npm install
npm start
Visit: http://localhost:3000
You can test backend APIs using Postman or directly through your frontend.
Example:
POST http://localhost:5000/api/auth/signup/request-otp
Request Body:
{
"name": "John",
"dob": "1999-01-01",
"email": "john@example.com"
}
- OTP-based Signup & Login
- Google OAuth integration
- Token-based Authentication (JWT)
- Notes CRUD (Create, Read, Delete)
- Protected Routes & Session Persistence
- Clean UI with Material UI