A simple REST API for managing task lists and tasks, built with Spring Boot as a learning project.
- Task Lists Management: Create, read, update, and delete task lists
- Tasks Management: Manage individual tasks within task lists
- RESTful API: Clean REST endpoints with proper HTTP methods
- Data Validation: Input validation with custom error handling
- PostgreSQL Database: Persistent data storage
- DTO Pattern: Clean separation between API and database models
- Java 24
- Spring Boot 3.5.5
- Spring Data JPA
- PostgreSQL
- Maven
- Docker Compose
GET /api/task-lists- Get all task listsPOST /api/task-lists- Create a new task listGET /api/task-lists/{id}- Get a specific task listPUT /api/task-lists/{id}- Update a task listDELETE /api/task-lists/{id}- Delete a task list
GET /api/task-lists/{listId}/tasks- Get all tasks in a listPOST /api/task-lists/{listId}/tasks- Create a new taskGET /api/task-lists/{listId}/tasks/{taskId}- Get a specific taskPUT /api/task-lists/{listId}/tasks/{taskId}- Update a taskDELETE /api/task-lists/{listId}/tasks/{taskId}- Delete a task
- Java 24
- Docker & Docker Compose
- Maven
-
Start PostgreSQL database:
docker-compose up -d
-
Run the Spring Boot application:
./mvnw spring-boot:run
-
API will be available at:
http://localhost:8080
Create a task list:
curl -X POST http://localhost:8080/api/task-lists \
-H "Content-Type: application/json" \
-d '{"title": "My Tasks", "description": "Daily tasks"}'Create a task:
curl -X POST http://localhost:8080/api/task-lists/{listId}/tasks \
-H "Content-Type: application/json" \
-d '{"title": "Complete project", "description": "Finish the Spring Boot project", "priority": "HIGH", "status": "PENDING"}'src/main/java/com/enesgunumdogdu/tasks/
├── controllers/ # REST endpoints
├── services/ # Business logic
├── repositories/ # Data access layer
├── domain/
│ ├── entities/ # JPA entities
│ └── dto/ # Data transfer objects
└── mappers/ # Entity-DTO converters
This project demonstrates:
- Layered Architecture (Controller → Service → Repository)
- DTO Pattern for clean API design
- Global Exception Handling with
@ControllerAdvice - JPA Relationships (One-to-Many between TaskList and Task)
- Stream API for functional programming
- RESTful API Design principles
- task_lists: id, title, description, created, updated
- tasks: id, title, description, due_date, priority, status, task_list_id, created, updated