A Spring Boot REST API for managing users and tasks.
This project was built as a practical backend project for Java and Spring Boot interview preparation.
- User CRUD
- Task CRUD
- User and Task relationship
- Request DTOs
- Response DTOs
- Mapper classes
- Validation
- Global Exception Handling
- Duplicate email handling
- Not Found handling
- Pagination and Sorting
- Filter tasks by status
- Transaction management with @Transactional
- H2 in-memory database
- Java 21
- Spring Boot
- Spring Web
- Spring Data JPA
- Hibernate
- H2 Database
- Bean Validation
- Lombok
- Maven
- Git
- GitHub
controller -> REST API endpoints
service -> Business logic
repository -> Database access
entity -> JPA entities
dto -> Request and response objects
mapper -> Converts Entity to DTO
exception -> Global error handling
POST /api/users
Create a new user.
GET /api/users
Get all users.
GET /api/users/{id}
Get user by id.
PUT /api/users/{id}
Update user.
DELETE /api/users/{id}
Delete user.
POST /api/tasks/users/{userId}
Create a new task for a user.
GET /api/tasks
Get all tasks.
GET /api/tasks/{id}
Get task by id.
PUT /api/tasks/{id}
Update task.
DELETE /api/tasks/{id}
Delete task.
GET /api/tasks/users/{userId}
Get all tasks for a specific user.
GET /api/tasks/status/{status}
Filter tasks by status.
GET /api/tasks/paged
Get tasks with pagination and sorting.
{
"name": "Minoo",
"email": "minoo@test.com"
}{
"title": "Learn Spring Boot",
"description": "Practice backend project",
"status": "TODO",
"dueDate": "2026-06-10"
}TODO
IN_PROGRESS
DONE
The project uses H2 in-memory database.
H2 Console URL:
http://localhost:8080/h2-console
JDBC URL:
jdbc:h2:mem:task_manager_db
Username:
sa
Password:
empty
mvn spring-boot:runThe app runs on:
GET /api/tasks/paged?page=0&size=5&sortBy=dueDate&direction=asc
- Layered architecture in Spring Boot
- REST API design
- JPA relationships
- DTO and Mapper pattern
- Validation and exception handling
- Transaction management
- Git and GitHub workflow
- Add JWT authentication and authorization
- Add user login and registration
- Replace H2 database with PostgreSQL or MySQL
- Add unit tests for service layer
- Add integration tests for API endpoints
- Add Docker support
- Add Swagger/OpenAPI documentation