BACK TO PROJECTS
BACKEND / JAVA
SmartTask API.
A task API with six operations, clear validation errors and database persistence.
22automated tests
90.91% line · 100% branch coverage
90.91% line · 100% branch coverage
A REAL EXAMPLE
What happens
Send POST /api/tasks with a title and priority. The API returns 201 with a new task ID and TODO status. Leave the title blank and it returns a 400 with a validation message.
Why I made it
I wanted an API where the happy path and the error path are both easy to follow. A task service gave me enough behavior to work through validation, persistence and failures.
How it works
Client / Swagger→Controller→Service→JPA repository→MySQL / TiDB Cloud
- Six endpoints for creating, reading, updating, filtering and deleting tasks.
- Request DTOs that reject invalid input and a shared handler for consistent errors.
- Database configuration for local MySQL and a MySQL-compatible cloud service.
Choices I made
- I kept HTTP handling in the controller, task rules in the service and queries in the repository so each part is easier to test.
- I used DTOs so a database entity would not also become the public API contract.
What I checked
- 22 passing JUnit, Mockito and MockMvc tests.
- JaCoCo: 90.91% line coverage and 100% branch coverage in the documented measurement.
- Maven verification and Docker validation in CI.
Where it stands
- This is a focused task API; it has no user accounts or frontend.
- The live demo is not linked while its availability is unconfirmed; the repository has setup and request examples.