A simple Spring Boot backend application for managing a store system. It provides REST APIs for products, categories, customers, orders, and integrates with external services.
- CRUD operations for:
- Products
- Categories
- Customers
- Orders & Order Items
- External API integration for dummy products using WebClient (Reactive).
- Redis caching for frequently accessed data.
- AOP-based time measurement for service method execution.
- Database migrations using Flyway.
- Java 17
- Spring Boot 3.x
- Maven For Dependency Management
- Spring Data JPA
- MySQL
- Flyway (DB migrations)
- HikariCP (connection pooling)
- Spring Cache Abstraction
- Redis Cache
- Spring Web (REST)
- Spring WebFlux (Reactive APIs)
- WebClient (external API calls)
- MapStruct (DTO ↔ Entity mapping)
- Jakarta Validation (Bean Validation)
- Spring AOP (method execution time logging)
-
Controller layer
Exposes REST endpoints and handles request validation. -
Service layer
Contains business logic, caching annotations, and transactional operations. -
Repository layer
Uses Spring Data JPA with optimized queries. -
Mapper layer
Converts between entities and DTOs using MapStruct. -
Config layer
Centralized configuration for Redis, WebClient, JPA auditing, and connection pooling.
This project uses Springdoc OpenAPI to generate API documentation automatically.
-
Swagger UI
http://localhost:8080/swagger -
OpenAPI JSON
http://localhost:8080/api-docs
- Java 17+
- Docker & Docker Compose
Copy the example environment file and update any configurations (e.g. database credentials or ports) if needed:
cp .env.example .envSpin up the database and cache containers:
docker compose up -d./mvnw spring-boot:runOnce running, access the Swagger UI at http://localhost:8080/swagger.
./mvnw clean verifyTo stop the background containers:
docker compose downCode formatting is enforced using formatter-maven-plugin. Run these commands before committing:
-
Auto-format codebase:
./mvnw formatter:format
-
Validate formatting:
./mvnw formatter:validate
Every push and pull request to main triggers our GitHub Actions pipeline, which runs 4 independent jobs:
formatting: Checks Java code formatting withformatter-maven-plugin.build: Compiles production and test sources.test: Executes all unit and integration tests against containerized MySQL and Redis services.run: Smoke tests application startup and checks health via the Swagger documentation endpoint.
Contributions are always welcome! Before opening an issue or pull request, please read our Contributing Guide for any details needed.
- Environment variables are loaded from
.env. - Centralized application configuration via
application.yml.