A microservices-based product management system with Spring Boot and Spring Cloud.
This project consists of several microservices working together to provide product management functionality:
- Config Server: Centralized configuration management
- Discovery Server: Service registry using Eureka
- API Gateway: Single entry point for all client requests
- Product Service: Manages product data with PostgreSQL
- Stock Service: Handles stock information and communicates with Product Service
- Java 21
- Maven
- Docker (for PostgreSQL and Zipkin)
- PostgreSQL
Spin up the required infrastructure with Docker:
docker-compose up -dThe microservices must be started in the following order due to dependencies:
-
🛠️ Config Server
cd config-server ./mvnw spring-boot:run✅ Verify: http://localhost:8888/discovery/default
-
📡 Discovery Server
cd discovery ./mvnw spring-boot:run✅ Verify: http://localhost:8761 (Eureka dashboard)
-
⚡ Start Remaining Services Use the same command below for each of the remaining services: Product, Stock, and Gateway.
cd <service-name> ./mvnw spring-boot:run
🔁 Repeat for:
- product
- stock
- gateway
✅ Gateway Health Check: http://localhost:8222/actuator/health
All services get their configuration from the Config Server.
Service-specific configurations are in:
cd config-server/src/main/resources/config/PostgreSQL container runs on port 5432.
Default credentials:
- Database:
productdb - Username:
devuser - Password:
devpass
Distributed tracing with Zipkin.
Access Zipkin UI at: http://localhost:9411
Each service exposes interactive API docs via Swagger. You can explore them here:
- 🧾 Product Service: http://localhost:8090/swagger-ui/index.html
- 📦 Stock Service: http://localhost:8070/swagger-ui/index.html
MIT License - See LICENSE for details.
