Task Manager API is a RESTful service built using Node.js, MongoDB, JWT (JSON Web Tokens), Multer for handling file uploads, and tested with Mocha and Supertest. It enables users to manage tasks and profiles, including features such as adding, updating, deleting, and reading tasks. Users can also create, update, and delete their profiles and add a profile image.
The API is deployed and can be accessed at https://task-manager-api-107m.onrender.com/.
- Task Management: Add, update, delete, and read tasks using RESTful endpoints.
- User Profile Management: Create, update, and delete user profiles.
- Profile Image Upload: Users can add a profile image to their profiles.
- Authentication: JWT-based authentication for secure API access.
- Testing: Utilize Mocha and Supertest for comprehensive API testing.
- Postman Collection: Convenient API testing with the provided Postman collection.
The API has the following endpoints:
-
Tasks
GET /tasks
: Get all tasks.GET /tasks/:id
: Get a specific task.POST /tasks
: Add a new task.PATCH /tasks/:id
: Update a task.DELETE /tasks/:id
: Delete a task.
-
Users/Profiles
POST /users
: Create a new user profile.PATCH /users/:id
: Update user profile.DELETE /users/:id
: Delete user profile.POST /users/me/avatar
: Upload a profile image.GET /users/:id/avatar
: Get user profile image.
Before using the API, ensure you have the following tools installed:
-
Clone the repository:
git clone https://github.com/sushil-2803/task-manager.git
-
Navigate to the project directory:
cd task-manager
-
Install dependencies:
npm install
-
Configure environment variables:
-
Create a
.env
file in the root directory. -
Add the following variables:
PORT=3000 MONGODB_URL=your-mongodb-connection-url JWT_SECRET=your-jwt-secret
-
-
Start the application:
npm start
-
Open Postman and import the provided collection (
Task_Manager_API.postman_collection.json
) for testing.
Run tests using Mocha and Supertest:
npm test
- Register a new user using the
/users
endpoint. - Obtain an authentication token.
- Use the token to access other API endpoints, such as tasks and user profiles.
Refer to the Postman collection for detailed examples and API requests.
The API is deployed and can be accessed at https://task-manager-api-107m.onrender.com/.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Feel free to explore the API and manage your tasks seamlessly! 🚀