| Service Name | Description | Port |
|---|---|---|
| config-server | Provides configuration for all microservices via config-repo. |
8888 |
| eureka-server | Handles service discovery and registration. | 8761 |
| api-gateway | Acts as the single entry point for all microservices. | 8080 |
| authentication-service | Manages user registration and authentication. | 8090 |
| product-service | Manages product information (create, update, list). | 8081 |
| order-service | Handles order creation and management. | 8083 |
| inventory-service | Tracks stock quantities. | 8082 |
| config-repo | Repository containing configuration files for all services. Store local or github | |
| supplier-service | Manages supplier information (create, update, list). | 8085 |
- Java 21+
- Spring Boot / Spring Cloud
- PostgreSQL (database)
- Eureka Server (service discovery)
- Spring Cloud Config Server
- Spring Cloud Gateway
- Docker & Docker Compose
- Spring Security / JWT
Services should be started in the following order:
- π§© config-server
- π°οΈ eureka-server
- π api-gateway
- π authentication-service
- π product-service
- π¦ order-service
- π inventory-service
- π¦ supplier-service
Each service contains its own application.yml with configuration and discovery settings.
To start all services using Docker, run the following command in the project root:
docker-compose up --build
To stop all services, run the following command:
docker-compose downdocker exec -it <container_name> psql -U postgres -d <database_name>
docker-compose up -d
cd config-server && mvn spring-boot:run cd discovery-service && mvn spring-boot:run cd api-gateway && mvn spring-boot:run
cd product-service && mvn spring-boot:run cd inventory-service && mvn spring-boot:run cd order-service && mvn spring-boot:run cd customer-service && mvn spring-boot:run cd supplier-service && mvn spring-boot:run cd authentication-service && mvn spring-boot:run
POST /api/auth/register
POST /api/auth/login
POST /api/products Authorization: Bearer {token}
POST /api/inventory
POST /api/customers
POST /api/orders
-
Prometheus: http://localhost:9090
-
Grafana: http://localhost:3000 (admin/admin)
-
Actuator Endpoints (ΓΆrnek):
-
Login: admin/admin
-
Add Data Source β Prometheus
-
Save & Test
-
Import Dashboard:
-
Dashboard ID: 11378 (JVM Micrometer)
-
Dashboard ID: 4701 (Spring Boot Statistics)
- process_cpu_usage{application="product-service"}
- jvm_memory_used_bytes{application="product-service"}
- http_server_requests_seconds_count{uri="/api/products"}
- product_created_total
- product_cache_hit_total
- product_cache_miss_total
- order_created_total
- order_processing_time_seconds_sum
- 1. Login (get Token)
POST http://localhost:8080/api/auth/login
{
"username": "admin",
"password": "admin123"
}
- 2. Create Order (trace all services)
POST http://localhost:8080/api/orders
Authorization: Bearer {token}
{
"customerId": 1,
"warehouseId": 1,
"items": [
{
"productId": 1,
"quantity": 2
}
]
}-
- Zipkin UI'
-
Service Dependency Graph - Which services are calling which services
-
Trace Timeline:
- API Gateway β Order Service
- Order Service β Product Service (Feign)
- Order Service β Inventory Service (Feign)
- Inventory Service β Product Service (Feign)
- Order Service β RabbitMQ (Event)
- Customer Service β RabbitMQ (Event)
-
Span Details:
- createOrder span
- processOrderItems span
- reserveInventory span
- acquireLock span
- database query span
- cache hit/miss events
Zipkin UI:
- Service Name: order-service
- Span Name: createOrder
- Min Duration: 100ms (find slow requests)
- Tags: customer.id=1
2025-11-03 15:30:45 INFO [order-service,a1b2c3d4e5f6g7h8,i9j0k1l2m3n4o5p6] Creating order for customer: 1
2025-11-03 15:30:45 DEBUG [order-service,a1b2c3d4e5f6g7h8,q7r8s9t0u1v2w3x4] Calling product-service for product: 1
2025-11-03 15:30:45 INFO [product-service,a1b2c3d4e5f6g7h8,y5z6a7b8c9d0e1f2] Product found in cache: 1
2025-11-03 15:30:45 DEBUG [order-service,a1b2c3d4e5f6g7h8,g3h4i5j6k7l8m9n0] Calling inventory-service
2025-11-03 15:30:45 INFO [inventory-service,a1b2c3d4e5f6g7h8,o1p2q3r4s5t6u7v8] Lock acquired for product: 1
2025-11-03 15:30:45 INFO [inventory-service,a1b2c3d4e5f6g7h8,o1p2q3r4s5t6u7v8] Stock reserved: product=1, quantity=2
2025-11-03 15:30:45 INFO [order-service,a1b2c3d4e5f6g7h8,i9j0k1l2m3n4o5p6] Order created successfully: ORD-20251103153045