A Spring Boot microservices showcase that demonstrates:
- Spring IoC / dependency injection across all layers
- service-specific PostgreSQL databases
- REST-based service-to-service communication
- native SQL reporting queries in the reporting-service
- Java Streams for aggregation and result shaping
- Docker Compose orchestration for local setup
product-service(:8081) - product catalog, search, inventory validation/decrementorder-service(:8082) - order placement and status tracking, calls product servicereporting-service(:8083) - syncs completed orders from the order service and exposes reporting endpointsapi-gateway(:8080) - routes/api/products/**,/api/orders/**,/api/reports/**
- Docker + Docker Compose
- Java 17 and Maven (optional, for local build without containers)
docker compose up --buildThe platform exposes these ports:
8080- API gateway8081- product-service8082- order-service8083- reporting-service5433- product PostgreSQL5434- order PostgreSQL5435- reporting PostgreSQL
The reporting-service routes are exposed through the API gateway at /api/reports.
POST /api/reports/sync- import completed orders into the reporting databaseGET /api/reports/monthly-sales- monthly sales grouped by customer and monthGET /api/reports/customer-spending- total spending per customerGET /api/reports/top-products-all-time- all-time top selling productsGET /api/reports/past-month-top-products- top products from the last 30 daysGET /api/reports/past-year-top-products- top products from the last 12 monthsGET /api/reports/top-products-by-month?month=YYYY-MM- top products for a specific month
- Create product via gateway:
curl -X POST http://localhost:8080/api/products -H 'Content-Type: application/json' -d '{"name":"Laptop","description":"Ultrabook","price":1200,"stock":15}'- Place order via gateway:
curl -X POST http://localhost:8080/api/orders -H 'Content-Type: application/json' -d '{
"customerId": 101,
"items": [
{"productId":1,"productName":"Laptop","quantity":2,"unitPrice":1200}
]
}'- Sync completed orders into reporting DB:
curl -X POST http://localhost:8080/api/reports/sync- Query reporting endpoints:
curl http://localhost:8080/api/reports/monthly-sales
curl http://localhost:8080/api/reports/customer-spending
curl http://localhost:8080/api/reports/top-products-all-time
curl http://localhost:8080/api/reports/past-month-top-products
curl http://localhost:8080/api/reports/top-products-by-month?month=2026-05reporting-servicesyncs completed orders fromorder-serviceinto its own reporting database- uses native SQL queries for aggregation and ranking
- exposes multiple reporting views for monthly sales, customer spending, and top selling products
.
├── api-gateway
├── product-service
├── order-service
├── reporting-service
├── docker-compose.yml
└── pom.xml