Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

David-JM/item-api-AI-powered

Repository files navigation

item-api

This project is a reactive API for managing items, built with Spring Boot and following Clean Architecture principles.

API Design

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.

Main Endpoints

  • 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.

Actuator Endpoints

The following actuator endpoints are exposed:

  • GET /actuator/health: Shows the application's health status.
  • GET /actuator/info: Provides general information about the application.

Openapi Autogenerate Docs

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.


Key Architectural Decisions

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) | |
| +-----------------------------------------------------------------------------------------------+ |
+----------------------------------------------------------------------------------------------------+

About

Item Api powered by Gemini cli

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /