The Spring Boot Products API is a fully functional REST API for managing a catalog of products. Built on Spring Boot 4.0.6 and Java 17, it exposes a set of HTTP endpoints underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ricpalomino/spring-boot/llms.txt
Use this file to discover all available pages before exploring further.
/api/v1/products that let you create, read, update, delete, and filter products. Every response is wrapped in a consistent ApiResponse<T> envelope that includes a status code, a human-readable message, and the response payload — making error handling and client integration predictable across all endpoints.
Key features
The API is designed to be a clear reference implementation for production-grade Spring Boot patterns. Here is what it provides out of the box:- RESTful CRUD for products —
GET,POST,PUT, andDELETEoperations on/api/v1/products, plus a/filterendpoint that accepts optionalname,minPrice, andmaxPricequery parameters. - Strategy Pattern service layer — two interchangeable
ProductServiceimplementations (ProductServiceBDImplandProductServiceApiExternaImpl) that you can swap by changing a single@Primaryannotation. - In-memory storage —
ProductRepositoryuses aHashMapwith auto-incrementingLongIDs, so the API runs with zero external database dependencies. - Request validation —
ProductRequestDTOis annotated with@NotBlank,@Size, and@Minconstraints;GlobalExceptionHandlercatchesMethodArgumentNotValidExceptionand returns structured field-level error details. - Global error handling —
@ControllerAdvicehandlesProductNotFoundException, validation errors, and unexpected exceptions uniformly, always returning anApiResponseenvelope. - OpenAPI / Swagger UI — powered by
springdoc-openapi2.8.0; the interactive UI is available athttp://localhost:8080/swagger-ui.htmlonce the application is running.
Explore the documentation
Quickstart
Clone the repo, build with Maven, and make your first API call in minutes.
Architecture
Understand the layered design, Strategy Pattern, and in-memory repository.
List products
Browse the full interactive API reference for the products endpoints.
Error handling
Learn how GlobalExceptionHandler maps exceptions to consistent API responses.
Tech stack
| Component | Details |
|---|---|
| Framework | Spring Boot 4.0.6 (spring-boot-starter-webmvc) |
| Language | Java 17 |
| Build tool | Maven (Maven Wrapper included) |
| Code generation | Lombok (@Getter, @Setter on entities and DTOs) |
| Validation | spring-boot-starter-validation (Jakarta Bean Validation) |
| API docs | springdoc-openapi-starter-webmvc-ui 2.8.0 |
| Dev tooling | Spring Boot DevTools (live reload on file changes) |