[JITERA] Add Todo API for managing tasks
Overview
This pull request introduces a new "todo" API to the project, allowing users to manage tasks with basic CRUD operations. The implementation follows the existing project structure and conventions, including the creation of a Todo model, service, controller, and routes.
Changes
-
Model:
- Created
backend/src/models/Todo.jsto define the Todo schema and handle database interactions using SQLite.
- Created
-
Service:
- Implemented
backend/src/services/todoService.jsto encapsulate the business logic for managing todos, including methods for creating, reading, updating, and deleting todos.
- Implemented
-
Controller:
- Developed
backend/src/controllers/todoController.jsto handle incoming requests and responses, mapping them to the appropriate service methods.
- Developed
-
Routes:
- Added
backend/src/routes/todoRoutes.jsto define the API endpoints for the todo resource, including routes for all CRUD operations.
- Added
-
Database Configuration:
- Updated
backend/src/config/db.jsto ensure the Todo model is properly integrated with the SQLite database.
- Updated
-
Server Integration:
- Modified
backend/src/server.jsto include the new todo routes in the main application router, ensuring that the API is accessible.
- Modified
This implementation adheres to the existing code style and patterns, ensuring consistency across the codebase.