A RESTful Product Inventory API developed with Spring Boot 3.4.4, Java 21, and Maven.
- CRUD Operations for Products and Categories
- Embedded H2 Database for development
- Database Migrations with Flyway
- Unit tests with JUnit
- Pagination & Sorting for all list endpoints
- Filtering by name and price range for product list endpoint
- Auto-generated API Docs with Swagger
- Framework: Spring Boot 3.4.4
- Language: Java 21
- Database: H2 (Embedded)
- ORM: Spring Data JPA
- Migrations: Flyway
- API Docs: Springdoc OpenAPI
- Build: Maven
- Testing: JUnit
- Java 21+ (Installation Guide)
- Maven 3.9+ (Installation Guide)
For running the application, execute the following Maven command:
mvn spring-boot:runThe API will be available at http://localhost:8090
Access the H2 database:
http://localhost:8090/h2-consoleConnection details:
- JDBC URL: jdbc:h2:file:./target/product_inventory_db
- Username: sa
- Password: Leave empty
Flyway runs automatically at startup. Migration scripts are located in:
src/main/resources/db/migration/Execute all unit tests:
mvn testExplore and test the API endpoints via Swagger UI:
http://localhost:8090/swagger-ui/index.html