This project is a User Authentication System built using Express.js, Handlebars (hbs), Mongoose, bcrypt, and JSON Web Tokens (JWT). It provides features for user signup, login, profile management, password reset, account deletion, and more.
├───bin
│ └───www
├───controllers
│ ├───user.controller.js
│ └───index.js
├───helper
│ ├───db.helper.js
│ ├───token.helper.js
│ └───index.js
├───middlewares
│ ├───auth.middleware.js
│ ├───loggedIn.middleware.js
│ └───signup.middleware.js
├───model
│ ├───user.model.js
│ └───index.js
├───public
│ ├───javascripts
│ └───stylesheets
├───routes
│ └───index.js
├───services
│ └───index.js
│ └───user.service.js
└───views
├───form
├───layouts
├───pages
└───partials
├───index.hbs
└───error.hbs
- Signup: Allows users to create a new account with email and password. Validates input fields including password complexity.
- Login: Users can securely login using their credentials. Passwords are hashed and compared for authentication.
- JWT Authentication: Implements JSON Web Token (JWT) based authentication for session management.
- Profile Management: Users can view and update their profile information such as name, email, batch, etc.
- Password Reset: Provides functionality for users to reset their password securely.
- Account Deletion: Allows users to delete their account permanently.
- Middleware: Utilizes middleware for authentication and authorization purposes.
- Popup Modal: Implements AJAX requests to perform actions like updating profile and deleting account without refreshing the page.
- Express.js: Node.js web application framework used for building the backend.
- Handlebars (hbs): Template engine for generating HTML markup.
- Mongoose: Object Data Modeling (ODM) library for MongoDB and Node.js.
- bcrypt: Password hashing library for securely storing passwords.
- JSON Web Tokens (JWT): Standard for securely transmitting information between parties.
- Ajax: Asynchronous JavaScript and XML for performing asynchronous requests.
-
Clone the repository:
git clone <repository-url>
-
Install dependencies:
cd <project-directory> npm install
-
Set up environment variables:
- Create a
.envfile in the project root. - Add environment variables like
PORT,MONGO_URI, etc.
- Create a
-
Start the server:
npm start
- Access the application at
http://localhost:3000 - Sign up for a new account or log in if you already have one.
- Update your profile, reset your password, or delete your account from the profile page.
- This project was created by codingadventure0 [Abhishek Kumar].
- Special thanks to the contributors and open-source community for their valuable contributions.







