This project implements an Authentication System using Node.js with Express as the backend and MongoDB as the database.
- Node.js: Download and Install Node.js
- MongoDB: Install MongoDB
- Git: Download and Install Git
- Clone the repository:
git clone https://github.com/{your-github-username}/chop-money-task.git
- Change into the project directory:
cd chop-money-task
- Install dependencies:
npm install
- Set up environment variables:
Create a .env
file in the project root and add the following:
MONGODB_URI=mongodb://localhost:27017/chop-money
PORT=8080
EMAIL_USER=your-email@gmail.com
EMAIL_PASSWORD=your-email-password
Make sure to replace your-email@gmail.com
and your-email-password
with your actual Gmail credentials.
npm run dev
The server will start at http://localhost:8080
.
- POST /register: Register a new user.
- POST /login: Log in and get an authentication token.
- POST /initiate-reset: Initiate the password reset process.
- POST /complete-reset: Complete the password reset process.
- GET /users: Get a list of all users (protected route).
- GET /users/:userId: Get details of a specific user (protected route).
- POST /logout: Log out .
Remember to replace {your-github-username}
in the GitHub repository URL and update the content based on your specific project structure and features.