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.
-
β 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.
- React.js with Vite
- Axios (for HTTP requests)
- TailWindCSS (for styling)
- Node.js
- Express.js
- Nodemailer (for sending OTP emails)
- bcrypt.js (for password hashing)
- cookie-parser
git clone https://github.com/GlenFonceca/AuthenticationSystem.git
cd AuthenticationSystemcd server
npm installAdd 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.comRun the backend server:
npm run servercd client
npm install
npm run dev-
π€ Add user roles (e.g., admin, user)
-
π² Enable 2FA (Two-Factor Authentication)
-
π§ͺ Add unit and integration tests
Contributions, issues, and feature requests are welcome! Feel free to fork this repository and submit a pull request.