Skip to content

Shehbaz456/Auth_Deep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Advanced Authentication System

An advanced authentication system built with features like email verification, OTP handling, password reset, protected routes, and a clean frontend UI.

πŸš€ Features

  • πŸ” User Signup with Email Verification
  • πŸ“§ Welcome Email on Signup
  • βœ… Email OTP Verification
  • πŸ”‘ Secure Login System
  • πŸ”’ Protected Routes
  • πŸ“€ Forgot and Reset Password
  • πŸšͺ Logout Functionality
  • 🏠 User Dashboard Access
  • πŸ“„ Reusable Email Templates
  • 🌐 Frontend Integration with Auth APIs

πŸ“ Project Structure

advanced-auth/
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ middlewares/
β”‚   └── server.js
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── App.js
β”‚   └── index.html
β”‚
└── README.md

βš™οΈ Backend Endpoints

Method Endpoint Description
POST /api/auth/signup Register a new user and send OTP
POST /api/auth/verify-email Verify user's email using OTP
POST /api/auth/login Login with email and password
POST /api/auth/logout Logout the current user
POST /api/auth/forgot-password Send password reset link/email
POST /api/auth/reset-password Reset password using token or OTP
GET /api/auth/check-auth Check if the user is authenticated

🎨 Frontend Pages

  • πŸ“‹ Signup Page
  • πŸ”“ Login Page
  • βœ… Email Verification Page
  • πŸ”„ Forgot Password Page
  • πŸ” Reset Password Page
  • 🏠 Dashboard Page

πŸ› οΈ Tech Stack

Backend:

  • Node.js
  • Express.js
  • MongoDB (Mongoose)
  • Nodemailer
  • JWT

Frontend:

  • React.js
  • Tailwind CSS
  • Axios
  • React Router

πŸ“¬ Email Templates

  • πŸŽ‰ Welcome Email
  • βœ… OTP Verification Email
  • πŸ”„ Password Reset Email

All templates are clean, responsive, and customizable.

πŸ” Route Protection

  • Auth tokens are stored securely.
  • Middleware to protect backend routes.
  • Conditional frontend rendering based on auth state.

πŸ“¦ Installation

# Clone the repository
git clone https://github.com/your-username/advanced-auth.git
cd advanced-auth

# Backend setup
cd backend
npm install
npm run dev

# Frontend setup
cd ../frontend
npm install
npm start

πŸ“„ Environment Variables

Create a .env file in the backend/ directory with:

PORT=5000
MONGO_URI=your_mongo_connection_string
JWT_SECRET=your_jwt_secret
EMAIL_USER=your_email@example.com
EMAIL_PASS=your_email_password
CLIENT_URL=http://localhost:3000

✨ Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

πŸ“§ Contact

For any queries or suggestions:

About

πŸ” Full-stack authentication system with OTP, email verification, password reset, protected routes, and React UI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors