How kevmenea/ecommerce-microservices works
This is a Java/Spring e-commerce microservices backend. Its principal workflow accepts an order, calculates and persists order state, reserves inventory, and records an order-created event through an outbox; inventory also supports warehouse, stock, reservation, and movement operations. Product catalog and user registration/profile services are separate capabilities. The README documents gateway, service discovery/configuration, security, Kafka, and distributed-transaction patterns, but their detailed wiring is not shown in the excerpts, so those links are marked unverified or omitted.
Main entry points: ApigatewayApplication.java API gateway · InventoryApplicationService.java Inventory application · OrderApplicationService.java Order orchestration · ConfigserverApplication.java Configuration server
Components 24
Entry and platform
- API gateway
apigateway/src/main/java/com/meneabank/apigateway/ApigatewayApplication.java - Gateway security
apigateway/src/main/java/com/meneabank/apigateway/config/SecurityConfig.java - Service discovery
eureka-server/src/main/java/com/meneabank/eureka_server/EurekaServerApplication.java - Configuration server
configserver/src/main/java/com/ecommerce/configserver/ConfigserverApplication.java
Order lifecycle
- Order API
order-service/src/main/java/com/ecommerce/order_service/api/OrderController.java - Order orchestration
order-service/src/main/java/com/ecommerce/order_service/application/OrderApplicationService.java - Inventory client
order-service/src/main/java/com/ecommerce/order_service/client/inventory/InventoryReservationClient.java - Outbox service
order-service/src/main/java/com/ecommerce/order_service/outbox/OutboxService.java - Outbox records
order-service/src/main/java/com/ecommerce/order_service/outbox/OutboxEventRepository.java - Outbox publisher
order-service/src/main/java/com/ecommerce/order_service/outbox/OutboxPublisher.java - Kafka events
Inventory operations
- Inventory API
inventory-service/src/main/java/com/ecommerce/inventory/inventory_service/api/InventoryController.java - Warehouse API
inventory-service/src/main/java/com/ecommerce/inventory/inventory_service/api/WarehouseController.java - Reservation API
inventory-service/src/main/java/com/ecommerce/inventory/inventory_service/api/ReservationController.java - Inventory application
inventory-service/src/main/java/com/ecommerce/inventory/inventory_service/application/InventoryApplicationService.java - Stock domain
inventory-service/src/main/java/com/ecommerce/inventory/inventory_service/domain/Inventory.java - Inventory repositories
inventory-service/src/main/java/com/ecommerce/inventory/inventory_service/repository/InventoryRepository.java
Catalog and identity
- Product API
product-service/src/main/java/com/menea/ecommerce/product_service/api/ProductController.java - Product service
product-service/src/main/java/com/menea/ecommerce/product_service/application/ProductApplicationService.java - Product repository
product-service/src/main/java/com/menea/ecommerce/product_service/domain/ProductRepository.java - User API
user-service/src/main/java/com/menea/ecommerce/user_service/api/UserController.java - User service
user-service/src/main/java/com/menea/ecommerce/user_service/application/UserApplicationService.java - User repository
user-service/src/main/java/com/menea/ecommerce/user_service/domain/UserRepository.java
Other components
- API client
Connections 25
- API client → API gateway: sends requests
- API gateway → Gateway security: applies security
- API gateway → Order API: routes requests
- API gateway → Inventory API: routes requests
- API gateway → Product API: routes requests
- API gateway → User API: routes requests
- Order API → Order orchestration: delegates to
order-service/src/main/java/com/ecommerce/order_service/api/OrderController.java - Order orchestration → Inventory client: calls reservations
order-service/src/main/java/com/ecommerce/order_service/application/OrderApplicationService.java - Inventory client → Reservation API: requests stock
- Order orchestration → Outbox service: saves event
order-service/src/main/java/com/ecommerce/order_service/application/OrderApplicationService.java - Outbox service → Outbox records: persists event
order-service/src/main/java/com/ecommerce/order_service/outbox/OutboxService.java - Outbox publisher → Outbox records: reads events
- Outbox publisher → Kafka events: publishes events
- Inventory API → Inventory application: delegates to
inventory-service/src/main/java/com/ecommerce/inventory/inventory_service/api/InventoryController.java - Warehouse API → Inventory application: delegates to
inventory-service/src/main/java/com/ecommerce/inventory/inventory_service/api/WarehouseController.java - Reservation API → Inventory application: delegates to
inventory-service/src/main/java/com/ecommerce/inventory/inventory_service/api/ReservationController.java - Inventory application → Inventory repositories: uses repositories
inventory-service/src/main/java/com/ecommerce/inventory/inventory_service/application/InventoryApplicationService.java - Inventory application → Stock domain: updates stock
inventory-service/src/main/java/com/ecommerce/inventory/inventory_service/application/InventoryApplicationService.java - Product API → Product service: delegates to
product-service/src/main/java/com/menea/ecommerce/product_service/api/ProductController.java - Product service → Product repository: reads and writes
product-service/src/main/java/com/menea/ecommerce/product_service/application/ProductApplicationService.java - User API → User service: delegates to
user-service/src/main/java/com/menea/ecommerce/user_service/api/UserController.java - User service → User repository: reads and writes
user-service/src/main/java/com/menea/ecommerce/user_service/application/UserApplicationService.java - Configuration server → API gateway: configures service
- Configuration server → Order orchestration: configures service
- Service discovery → API gateway: registers services