Skip to content

AdvancedAuth is a comprehensive authentication tutorial that provides a full-stack setup for user authentication and authorization. It includes both backend and frontend modules, covering essential functionality such as email verification, password reset, and secure session management.

Notifications You must be signed in to change notification settings

vanshu778/AdvancedAuth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 

Repository files navigation

Advanced Auth 🔒

Demo App

About This Project

AdvancedAuth is a comprehensive authentication project that provides a full-stack setup for user authentication and authorization. It includes both backend and frontend modules, covering essential functionality such as email verification, password reset, and secure session management. This project is ideal for developers looking to implement robust authentication in their applications.

Features

This tutorial covers the complete setup of an advanced authentication system, with detailed steps and endpoints:

  • 🔧 Backend Setup – Initialize backend server, database, and key configurations
  • 🗄️ Database Setup – Connect MongoDB and manage user data securely
  • 🔐 Signup Endpoint – Create new user accounts and send verification emails
  • 📧 Sending Verification Email – Guide users to verify their accounts via email
  • 🔍 Email Verification Endpoint – Confirm and activate user accounts
  • 📄 Welcome Email Template – Send a welcome email upon successful verification
  • 🚪 Logout Endpoint – Manage user sessions effectively
  • 🔑 Login Endpoint – Authenticate users securely
  • 🔄 Forgot Password Endpoint – Allow users to reset forgotten passwords
  • 🔁 Reset Password Endpoint – Secure password resetting process
  • ✔️ Check Auth Endpoint – Verify user authentication status
  • 🌐 Frontend Setup – Develop the UI for all authentication pages
  • 📋 Signup Page UI – Interface for user registration
  • 🔓 Login Page UI – Interface for user login
  • Email Verification Page UI – Confirm user emails
  • 📤 Implementing Signup – Integrate signup and verification with the backend
  • 📧 Implementing Email Verification – Verify emails after signup
  • 🔒 Protecting Routes – Secure routes based on user authentication
  • 🔑 Implementing Login – Add login functionality to the frontend
  • 🏠 Dashboard Page – Display user-specific data after login
  • 🔄 Implementing Forgot Password – Allow password reset requests
  • 🚀 Detailed Deployment – Steps to deploy both backend and frontend

Setup .env File

In both Backend and Frontend, create an .env file with the following environment variables:

# Backend .env file
PORT=5000
MONGODB_URL=your_mongo_url
JWT_SECRET=your_jwt_secret
NODE_ENV=development

MAILTRAP_TOKEN=your_mailtrap_token
MAILTRAP_ENDPOINT=https://send.api.mailtrap.io/

CLIENT_URL=http://localhost:5173

Running the Project Locally

1. Backend Setup

To set up and start the backend server:

cd Backend
npm install
npm run dev

This will start the backend server on http://localhost:5000.

2. Frontend Setup

To set up and start the frontend application:

cd Frontend
npm install
npm run dev

This will start the frontend on http://localhost:5173.

Building and Starting the App in Production

To build and start the app in production mode:

npm run build
npm start

License

This project is licensed under the MIT License.

© Darshan Vasani. All Rights Reserved.

About

AdvancedAuth is a comprehensive authentication tutorial that provides a full-stack setup for user authentication and authorization. It includes both backend and frontend modules, covering essential functionality such as email verification, password reset, and secure session management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.1%
  • Other 0.9%