Note
This project was developed as a hands-on learning experience focused on building clean, scalable backend services using Spring Boot, Docker, PostgreSQL, and modern development practices.
- Create, update, delete clients
- List all clients
- Get a client with all their sales
- DTO-based request/response structure
- Fully validated inputs
-
Create sales for any client
-
Filter sales by:
- Date range
- Price range
- Client
-
DTO-based request/response structure
-
Service layer separation
- Spring Security integration
- JWT-based authentication 🚧 WIP 🚧
- Endpoint protection and role-based access
- Full Swagger / OpenAPI auto-generated docs
- Clear project structure
- DTOs, entities, services fully separated
- Mockito service tests
- JUnit 5 unit tests
- MockMvc controller tests
This project is fully Dockerized and ready for deployment.
- Uses
eclipse-temurin:17-jdkas the base image - Includes a production-ready Dockerfile
- Successfully tested on cloud platforms such as Render
src/main/java/com.example.miniatures
├── controller
├── dto
│ ├── miniatureClient
│ └── miniatureSale
├── exception
├── model
│ ├── enums
├── repository
├── security
├── service
└── MiniaturesApplication.java
| Method | Endpoint | Description |
|---|---|---|
| POST | /clients |
Create new client |
| GET | /clients |
List all clients |
| GET | /clients/{id} |
Get client info |
| GET | /clients/{id}/sales |
Get client sales |
| PUT | /clients/{id} |
Update client |
| DELETE | /clients/{id} |
Delete client |
| Method | Endpoint | Description |
|---|---|---|
| POST | /sales |
Create new sale |
| GET | /sales |
List or filter sales |
| GET | /sales/latest |
List latest 10 sales |
| GET | /sales/{id} |
Get sale by ID |
| PUT | /clients/{id} |
Update sale |
| DELETE | /clients/{id} |
Delete sale |
GET /sales?clientId=1
GET /sales?clientId=1&minPrice=20&maxPrice=200&startDate=2024-01-01&endDate=2024-12-31
mvn testmvn spring-boot:runOnce running, open Swagger:
👉 http://localhost:8080/swagger-ui/index.html
spring.datasource.url=jdbc:h2:mem:miniatures
spring.jpa.hibernate.ddl-auto=update
spring.h2.console.enabled=trueH2 console:
http://localhost:8080/h2-console
spring.datasource.url=${DB_URL}
spring.datasource.username=${DB_USERNAME}
spring.datasource.password=${DB_PASSWORD}
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.format_sql=true{
"name": "John Example",
"email": "john@example.com",
"phone": 5551234
}{
"name": "Space Marine",
"price": 20,
"saleDate": "2025-01-11",
"scale": "MEDIUM_100MM",
"type": "WARHAMMER",
"clientId":1
}| Layer | Technology |
|---|---|
| Backend | Spring Boot 3 |
| Language | Java 17 |
| Docs | Springdoc OpenAPI |
| Database | PostgreSQL + H2 for tests |
| Build | Maven |
| Tests | JUnit 5 + Mockito |
| Deploy | Docker |
MIT License — free to use, modify, and distribute.
Pablyco :)