How shubratodn/microservice_keycloak works
This repository implements a commerce backend as separate customer, product/category, and order services, with gateway, configuration-server, and discovery applications also present. The visible workflow is an HTTP request reaching a domain controller, which delegates to a service; order creation additionally checks customer and product eligibility before saving the order. The sampled code supports these calls and the customer persistence path, but gateway routing and most product persistence details are not shown, so those relationships are omitted.
Main entry points: OrderServiceImpl.java Order orchestration · CustomerServiceImpl.java Customer operations · CustomerController.java Customer API · ProductController.java Product API
Components 19
Commerce services
- Customer API
java-services/customer/src/main/java/com/customer/controller/CustomerController.java - Customer operations
java-services/customer/src/main/java/com/customer/service/impl/CustomerServiceImpl.java - Customer repository
java-services/customer/src/main/java/com/customer/repository/CustomerRepository.java - Customer model
java-services/customer/src/main/java/com/customer/entity/Customer.java - Product API
java-services/product/src/main/java/com/product/controller/ProductController.java - Product operations
java-services/product/src/main/java/com/product/service/impl/ProductServiceImpl.java - Category API
java-services/product/src/main/java/com/product/controller/CategoryController.java - Category operations
java-services/product/src/main/java/com/product/service/impl/CategoryServiceImpl.java - Customer service
java-services/customer/src/main/java/com/customer/controller/CustomerController.java - Product service
java-services/product/src/main/java/com/product/controller/ProductController.java
Service platform
- API gateway
java-services/api-gateway/src/main/java/com/apigateway/ApiGatewayApplication.java - Config server
java-services/config-server/src/main/java/com/microservice/ConfigServerApplication.java - Service discovery
java-services/discovery/src/main/java/com/discovery/DiscoveryApplication.java
Order orchestration
- Order API
java-services/order/src/main/java/com/order/controller/OrderController.java - Order orchestration
java-services/order/src/main/java/com/order/service/impl/OrderServiceImpl.java - Order repository
java-services/order/src/main/java/com/order/repository/OrderRepository.java - Customer client
java-services/order/src/main/java/com/order/client/CustomerClient.java - Product client
java-services/order/src/main/java/com/order/client/ProductClient.java
Other components
- API client
Connections 15
- API client → Customer API: requests
java-services/customer/src/main/java/com/customer/controller/CustomerController.java - API client → Product API: requests
java-services/product/src/main/java/com/product/controller/ProductController.java - API client → Category API: requests
java-services/product/src/main/java/com/product/controller/CategoryController.java - API client → Order API: requests
java-services/order/src/main/java/com/order/controller/OrderController.java - Customer API → Customer operations: delegates to
java-services/customer/src/main/java/com/customer/controller/CustomerController.java - Customer operations → Customer repository: reads and writes
java-services/customer/src/main/java/com/customer/service/impl/CustomerServiceImpl.java - Customer operations → Customer model: maps to
java-services/customer/src/main/java/com/customer/service/impl/CustomerServiceImpl.java - Product API → Product operations: delegates to
java-services/product/src/main/java/com/product/controller/ProductController.java - Category API → Category operations: delegates to
java-services/product/src/main/java/com/product/controller/CategoryController.java - Order API → Order orchestration: delegates to
java-services/order/src/main/java/com/order/controller/OrderController.java - Order orchestration → Order repository: saves and queries
java-services/order/src/main/java/com/order/service/impl/OrderServiceImpl.java - Order orchestration → Customer client: checks customer
java-services/order/src/main/java/com/order/service/impl/OrderServiceImpl.java - Order orchestration → Product client: checks products
java-services/order/src/main/java/com/order/service/impl/OrderServiceImpl.java - Customer client → Customer service: calls remotely
- Product client → Product service: calls remotely