This is a simple task manager application built using Node.js, Express.js, MongoDB, and Mongoose.
This project provides endpoints for managing tasks and user authentication. Key features include:
- User authentication with JWT (JSON Web Tokens)
- CRUD operations for tasks
- RESTful API design
- MongoDB database integration
- Middleware for authentication and authorization
- Error handling and validation
Before running this project, make sure you have the following installed on your machine:
- Node.js: Download and Install Node.js
- MongoDB: Download and Install MongoDB
git clone https://github.com/Yasinj05/task-manager-api.git
cd task-manager-api
npm install
npm test
- (Currently, only unit tests have been implemented on the project)
mongod
JWT_PRIVATE_KEY=your_jwt_private_key_here
PORT=your-port
npm start
Once the server is running, you can access the application:
- Profile:
GEThttp://localhost:3000/api/users/me - All Users:
GEThttp://localhost:3000/api/users - Register:
POSThttp://localhost:3000/api/users - Login:
POSThttp://localhost:3000/api/auth
- All Tasks:
GEThttp://localhost:3000/api/tasks - Create Task:
POSThttp://localhost:3000/api/tasks - Update Task:
PUThttp://localhost:3000/api/tasks/:id - Delete Task:
DELETEhttp://localhost:3000/api/tasks/:id
- Login:
POSThttp://localhost:3000/api/auth
Ensure to replace :id in the route URLs with the actual task ID when performing update or delete operations.
Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.