Skip to content

A full-stack authentication system with features including user registration, login, email verification via OTP, password reset, and cookie-based session management. This project is built using React for the frontend, Node.js and Express.js for the backend, and MongoDB for the database.

Notifications You must be signed in to change notification settings

GlenFonceca/MernAuthenticationSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Authentication System

A full-stack authentication system with features including user registration, login, email verification via OTP, password reset, and cookie-based session management.

This project is built using React for the frontend, Node.js and Express.js for the backend, and MongoDB for the database.

🌐 Features

  • βœ… User Registration
    Users can create accounts with email and password.

  • πŸ”“ User Login
    Secure login system with credential validation.

  • πŸ“§ Email Verification with OTP
    After signup, an OTP is sent to the user's email for email verification.

  • πŸ” Password Reset via OTP
    Users can request password reset, verified using an OTP sent to their email.

  • πŸͺ Cookie-based Authentication
    Session handling is implemented using HTTP cookies.


πŸ› οΈ Tech Stack

Frontend

  • React.js with Vite
  • Axios (for HTTP requests)
  • TailWindCSS (for styling)

Backend

Database


πŸ“¦ Installation & Running the Project

1. Clone the Repository

git clone https://github.com/GlenFonceca/AuthenticationSystem.git
cd AuthenticationSystem

2. Setup Server

cd server
npm install

Add following environmental variables in .env file in the server directory:

MONGODB_URI=your_mongodb_connection_uri
JWT_SECRET=your_jwt_secret_key
NODE_ENV=development

SMTP_USER=your_smtp_username
SMTP_PASS=your_smtp_password
SENDER_EMAIL=youremail@example.com

Run the backend server:

npm run server

3.Setup Client

cd client
npm install
npm run dev

πŸš€ Future Enhancements

  • πŸ‘€ Add user roles (e.g., admin, user)

  • πŸ“² Enable 2FA (Two-Factor Authentication)

  • πŸ§ͺ Add unit and integration tests

🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to fork this repository and submit a pull request.

About

A full-stack authentication system with features including user registration, login, email verification via OTP, password reset, and cookie-based session management. This project is built using React for the frontend, Node.js and Express.js for the backend, and MongoDB for the database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published