Skip to content

karan7638/mern-auth-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

MERN Auth + Notes App 📒🔐

This is a full-stack MERN application with authentication (Email OTP + Google Login) and a dashboard for managing notes.


📦 Tech Stack

  • 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)

📁 Folder Structure

project-root/
├── client/        → React frontend
├── server/        → Express backend
└── README.md      → Project documentation

🚀 Getting Started

1. Clone the Repository

git clone https://github.com/your-username/mern-auth-notes.git
cd mern-auth-notes

⚙️ Backend Setup

Navigate to the backend directory:

cd server

Install dependencies:

npm install

Create .env file:

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) for EMAIL_PASS.

Start the backend server:

npm start

💻 Frontend Setup

Navigate to the client directory:

cd ../client

Install dependencies:

npm install

Start the React app:

npm start

Visit: http://localhost:3000


🧪 API Testing (Optional)

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"
}

✨ Features

  • 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

About

A full-stack MERN app with Email OTP + Google login, JWT authentication, and a notes dashboard.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published