Skip to content

AdarshSugandhe/mern-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ MERN Auth Application

A full-stack MERN (MongoDB, Express, React, Node.js) authentication application with email verification, JWT-based login, and cookie-based session management. Supports cross-origin requests and works seamlessly with Vercel deployments.


✨ Features

  • 📝 User Registration with email & password
  • 🔑 Login with JWT authentication
  • 📧 Email verification using OTP
  • 🔄 Password reset functionality
  • 🍪 Cookie-based session handling
  • 🌐 Cross-Origin Resource Sharing (CORS) enabled

🛠️ Tech Stack

  • Frontend: React ⚛️, React Router, Axios, Tailwind CSS 🎨, React Toastify 🔔
  • Backend: Node.js 🟢, Express ⚡, MongoDB 🗄️, Mongoose, JWT 🔐, bcryptjs 🔒, Nodemailer ✉️
  • Deployment: Vercel ☁️ (Frontend + Backend)
  • Environment: dotenv for config 🌿

📁 Folder Structure


mern-auth/

├── client/ # React frontend
├── server/ # Express backend

🚀 Getting Started

  1. Clone the repo

    git clone https://github.com/AdarshSugandhe/mern-auth-app.git

  1. Install dependencies

    cd frontend
    npm install
    cd ../backend
    npm install

  1. Set up environment variables Create a .env file in both frontend and backend directories with the required variables:

VITE_BACKEND_URL (frontend)

MONGO_URI, JWT_SECRET, SENDER_EMAIL (backend)


  1. Run locally

    # Backend
    cd backend
    npm run dev
    # Frontend
    cd ../frontend
    npm run dev

  1. Deploy on Vercel

    Deploy frontend and backend as separate projects Ensure CORS is configured in backend for frontend URL


About

MERN Auth App – Full-stack authentication with email verification, JWT login, cookie-based sessions, and responsive UI built with React, Node.js, Express, and MongoDB. Deployable on Vercel.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages