This project is a backend API for a task manager application developed using Bun as the runtime environment and Elysia as the server framework.
-
Create Task (POST):
- Allow creating new tasks with a title and description.
-
View Tasks (GET):
- Support GET requests to retrieve all tasks in a list or a single task's details.
-
Edit Task (PUT):
- Enable editing existing tasks' title and description.
-
Delete Task (DELETE):
- Allow tasks to be deleted via DELETE requests.
-
Routing:
- Implement API routing to handle different endpoints for task operations.
-
State Management:
- Manage application state effectively, integrating with MongoDB.
-
TypeScript Integration:
- Utilize TypeScript throughout the API development.
-
Error Handling and Validation:
- Implement input validation for task creation and editing.
- Provide comprehensive error responses.
-
Code Quality and Best Practices:
- Write clean, efficient, and well-documented code.
- Follow RESTful principles and best practices for API development.
- Organize code with proper separation of concerns.
-
Unit Testing:
- Implement unit tests using Bun's built-in test environment.
-
Rate Limiting:
- Implement rate limiting for enhanced security.
-
MongoDB Integration:
- Connect the API with MongoDB for persistent storage.
-
Git Hooks:
- Relied on Lefthook for pre-commit and pre-push hooks for safe commits
Explore the Postman Documentation to understand and interact with the API endpoints.
- Create a
.env
file with the following variables:PORT=3000 MONGODB_URI=mongodb://localhost:27017/yourdbname
- Update The MongoDB name in docker-compose.yml file
- Run
docker-compose up
- Authentication Module:
- Add an authentication module relying on JWT for protected routes.
- Handle Relationship between tasks and users.