Backend REST API for vehicles, models and brands management.
The service is built on Spring Boot + PostgreSQL, containing the following layers and parts:
- Controllers: Handles REST I/O, performs static validation on input and formats output responses.
- Mappers: Transform and map entities from input, and to output objects.
- Services: Handles business logic and dynamic validations.
- Repositories: Handles DB persistency and outgoing network communications.
- Migrations: Evolves the database over time, applying the required db changes together with code changes.
Please ensure you have:
- Java >=21
- Docker and docker-compose
And proceed to
- Clone the repo on your local
- On the root folder run
docker-compose up
./gradlew clean build bootRun
Your application SWAGGER docs will be available on http://localhost:8080/swagger-ui/
Since the resources do not contain business logic apart from static validations and database constraints, I decided to cover it all with integration tests. It allows me to fully cover all the scenarios in a safe and productive way. The test setup includes docker-compose and test containers, which are gracefully integrated with Spring Boot.