This project is a reactive API for managing items, built with Spring Boot and following Clean Architecture principles.
The API is designed using a reactive approach with Spring WebFlux and functional routing. Instead of traditional @RestController annotations, it uses RouterFunction beans to define the routes and their corresponding handler functions. This approach provides more control over the request and response handling.
GET /api/v1/items/{id}: Retrieves an item by its ID.GET /api/v1/items/{id}/related: Retrieves items related to a given item ID.
The following actuator endpoints are exposed:
GET /actuator/health: Shows the application's health status.GET /actuator/info: Provides general information about the application.
Swagger UI is available for exploring the API. Once the application is running, you can access it at:
http://localhost:8080/swagger-ui.html
Note: The project includes a .gitignore file and is ready to initialize a version control repository, like git.
The project follows a Clean Architecture, separating concerns into distinct layers:
- Domain: Contains the core business logic and entities.
- Application: Orchestrates the use cases of the application.
- Infrastructure: Handles external concerns like frameworks, databases, and UI.
This is a simplified diagram of the architecture:
+----------------------------------------------------------------------------------------------------+
| Infrastructure |
| +----------------------------------+ +----------------------------------------------------+ |
| | entry-points | | driven-adapters | |
| | (Web - RouterFunctions) | | (Persistence, External Services, etc.) | |
| +----------------------------------+ +----------------------------------------------------+ |
+----------------------------------------------------------------------------------------------------+
^
|
v
+----------------------------------------------------------------------------------------------------+
| Application |
| +----------------------------------+ +----------------------------------------------------+ |
| | use-case | | ports | |
| | (Application Services) | | (Interfaces for Driven Adapters) | |
| +----------------------------------+ +----------------------------------------------------+ |
+----------------------------------------------------------------------------------------------------+
^
|
v
+----------------------------------------------------------------------------------------------------+
| Domain |
| +-----------------------------------------------------------------------------------------------+ |
| | model | |
| | (Entities, Value Objects) | |
| +-----------------------------------------------------------------------------------------------+ |
+----------------------------------------------------------------------------------------------------+