How ramzy-saad/java-spring-ecomapplicationmicroservicesdemo works
This is an e-commerce microservices application: users and products are managed by separate services, while the order service supports cart operations and order creation. The main flow is client request through the gateway to cart and order handling; cart operations consult product and user services, and order creation persists an order and emits an event for notification consumption. The graph also includes identity provisioning, discovery, and configuration services. Relationships for unsampled gateway routing and infrastructure wiring are shown only as unverified where useful.
Main entry points: GatewayConfig.java API gateway · CartService.java Cart operations · OrderService.java Order creation · ProductController.java Product API
Components 26
Access and platform
- API gateway
gateway/src/main/java/com/ecom/gateway/GatewayConfig.java - JWT filter
gateway/src/main/java/com/ecom/gateway/JwtAuthFilter.java - Fallback responses
gateway/src/main/java/com/ecom/gateway/Fallbackcontroller.java - Service discovery
eureka/src/main/java/com/eureka/eureka/EurekaApplication.java - Config server
configserver/configserver/src/main/java/com/ecom/configserver/ConfigserverApplication.java - Auth flow
authFlow/src/main/java/com/ecom/authFlow/HomeController.java
Catalog service
- Product API
product/src/main/java/com.ecomMicroservices.product/controllers/ProductController.java - Product operations
product/src/main/java/com.ecomMicroservices.product/services/ProductService.java - Product records
product/src/main/java/com.ecomMicroservices.product/repositories/ProductRepository.java
User and identity
- User API
user/src/main/java/com/ecomMicroservices/user/controllers/UserController.java - User operations
user/src/main/java/com/ecomMicroservices/user/services/UserService.java - User records
user/src/main/java/com/ecomMicroservices/user/repositories/UserRepository.java - Keycloak administration
user/src/main/java/com/ecomMicroservices/user/services/KeyCloakAdminService.java
Cart and orders
- Cart API
order/src/main/java/com/ecomMicroservices/order/controllers/CartController.java - Order API
order/src/main/java/com/ecomMicroservices/order/controllers/OrderController.java - Cart operations
order/src/main/java/com/ecomMicroservices/order/services/CartService.java - Product client
order/src/main/java/com/ecomMicroservices/order/clients/ProductServiceClient.java - User client
order/src/main/java/com/ecomMicroservices/order/clients/UserServiceClient.java - Cart records
order/src/main/java/com/ecomMicroservices/order/repositories/CartItemRepository.java - Order creation
order/src/main/java/com/ecomMicroservices/order/services/OrderService.java - Order records
order/src/main/java/com/ecomMicroservices/order/repositories/OrderRepository.java
Order notifications
- Order event consumer
notification/src/main/java/com/ecom/notification/payload/OrderEventConsumer.java - Notification service
notification/src/main/java/com/ecom/notification/NotificationApplication.java
Other components
- Client
- Keycloak
- Message broker
Connections 29
- Client → API gateway: sends requests
- API gateway → JWT filter: filters requests
- API gateway → Fallback responses: serves fallback
- API gateway → Cart API: routes requests
- API gateway → Order API: routes requests
- API gateway → Product API: routes requests
- API gateway → User API: routes requests
- Product API → Product operations: delegates to
product/src/main/java/com.ecomMicroservices.product/controllers/ProductController.java - Product operations → Product records: reads and writes
product/src/main/java/com.ecomMicroservices.product/services/ProductService.java - User API → User operations: delegates to
user/src/main/java/com/ecomMicroservices/user/controllers/UserController.java - User operations → User records: reads and writes
user/src/main/java/com/ecomMicroservices/user/services/UserService.java - User operations → Keycloak administration: provisions identity
user/src/main/java/com/ecomMicroservices/user/services/UserService.java - Keycloak administration → Keycloak: administers users
user/src/main/java/com/ecomMicroservices/user/services/KeyCloakAdminService.java - Cart API → Cart operations: delegates to
order/src/main/java/com/ecomMicroservices/order/controllers/CartController.java - Order API → Order creation: delegates to
order/src/main/java/com/ecomMicroservices/order/controllers/OrderController.java - Cart operations → Product client: fetches product
order/src/main/java/com/ecomMicroservices/order/services/CartService.java - Product client → Product API: requests product
- Cart operations → User client: fetches user
order/src/main/java/com/ecomMicroservices/order/services/CartService.java - User client → User API: requests user
- Cart operations → Cart records: reads and writes
order/src/main/java/com/ecomMicroservices/order/services/CartService.java - Order creation → Cart operations: loads and clears
order/src/main/java/com/ecomMicroservices/order/services/OrderService.java - Order creation → Order records: saves order
order/src/main/java/com/ecomMicroservices/order/services/OrderService.java - Order creation → Message broker: emits event
order/src/main/java/com/ecomMicroservices/order/services/OrderService.java - Message broker → Order event consumer: delivers event
- Order event consumer → Notification service: runs within
- Service discovery → API gateway: supports discovery
- Config server → API gateway: provides configuration
- Config server → Product API: provides configuration
- Auth flow → Keycloak: uses authentication