This project is the backend part of the Task Tracking App, built with Spring Boot, PostgreSQL, and Docker. The application allows users to manage task lists and individual tasks, including creating, updating, deleting, and viewing tasks. The frontend code is located in the task-fe repository (developed by others), while this repository handles the backend logic in task-be.
- Task Lists π: Create, update, delete, and retrieve task lists.
- Tasks β : Manage tasks with details like title, description, priority, and status.
- Error Handling
β οΈ : Global exception handling to return meaningful error responses. - Database ποΈ: Uses PostgreSQL for data storage.
- DTOs & Mappers π: Data Transfer Objects (DTOs) for API responses and request handling. Custom mappers for conversion between entities and DTOs.
- Spring Boot: Java-based framework for building the backend.
- PostgreSQL: Relational database for storing task lists and tasks.
- Docker: For containerization of the application.
- Maven: Dependency management and build tool.
- Lombok: Java library to reduce boilerplate code (e.g., getters, setters).
-
Controllers: Handle HTTP requests and responses.
TaskController: Manages tasks in a task list.TaskListController: Manages task lists.GlobalExceptionHandler: Handles global exceptions for error responses.
-
Services: Contains business logic.
TaskService: Handles task operations.TaskListService: Handles task list operations.
-
Repositories: Interact with the database using Spring Data JPA.
TaskRepository: CRUD operations for tasks.TaskListRepository: CRUD operations for task lists.
-
DTOs: Data Transfer Objects for tasks and task lists.
TaskDto: Represents task data.TaskListDto: Represents task list data.ErrorResponse: Represents error details in case of failure.
-
Mappers: Convert between entities and DTOs.
TaskMapper: Maps task entities to DTOs and vice versa.TaskListMapper: Maps task list entities to DTOs and vice versa.
- Clone the repository:
git clone https://github.com/yourusername/Task-Tracking-App.git- Navigate to the project directory:
cd Task-Tracking-App/task-be-
Set up your PostgreSQL database (either locally or using Docker).
-
Update application.properties (in src/main/resources/application.properties) with your database configuration.
-
Build the application:
mvn clean install- Run the application:
mvn spring-boot:runAlternatively, you can use Docker to run the application with the database.
- Build the Docker image:
docker build -t task-tracking-app-backend .- Run the Docker container:
docker run -p 8080:8080 task-tracking-app-backend.- GET
/task-lists: Get all task lists. - POST
/task-lists: Create a new task list. - GET
/task-lists/{task_list_id}: Get a task list by ID. - PUT
/task-lists/{task_list_id}: Update a task list by ID. - DELETE
/task-lists/{task_list_id}: Delete a task list by ID.
- GET
/task-lists/{task_list_id}/tasks: Get all tasks in a task list. - POST
/task-lists/{task_list_id}/tasks: Create a new task in a task list. - GET
/task-lists/{task_list_id}/tasks/{task_id}: Get a task by ID. - PUT
/task-lists/{task_list_id}/tasks/{task_id}: Update a task by ID. - DELETE
/task-lists/{task_list_id}/tasks/{task_id}: Delete a task by ID.
Global exception handling is implemented with