How ganchevdimitarg/e-commorce works
This repository is a Spring Cloud e-commerce platform. The principal path is a client request through the API gateway into domain services: users can register, browse catalog data, place and track orders, and manage payment/profile information. Authentication publishes user lifecycle events; notifications consume order-notification events and send email. The README documents gateway routing and asynchronous messaging, but most cross-service wiring was not sampled, so those relationships are shown only where documentation or excerpts support them. Several service internals are represented at their exact source paths without asserting unseen calls.
Main entry points: gateway API gateway · OrderController.java Order API · catalog Product catalog · KafkaListenerService.java Notification consumer
Components 22
Entry and identity
- API gateway
gateway/src/main/java/com/ganchevdimitarg/gateway - Authentication
authentication/src/main/java/com/ganchevdimitarg/auth - Account lifecycle
authentication/src/main/java/com/ganchevdimitarg/auth/service/AccountService.java
Commerce services
- Product catalog
catalog/src/main/java/com/ganchevdimitarg/catalog - Product operations
catalog/src/main/java/com/ganchevdimitarg/catalog/service/product/ProductService.java - Category operations
catalog/src/main/java/com/ganchevdimitarg/catalog/service/category/CategoryService.java - Product comments
catalog/src/main/java/com/ganchevdimitarg/catalog/service/comment/CommentService.java - Order management
order/src/main/java/com/ganchevdimitarg/order/service/OrderService.java - Order API
order/src/main/java/com/ganchevdimitarg/order/controller/OrderController.java - Order lifecycle
order/src/main/java/com/ganchevdimitarg/order/domain/OrderStatus.java - Order idempotency
order/src/main/java/com/ganchevdimitarg/order/service/IdempotencyService.java - Payment processing
payment/src/main/java/com/ganchevdimitarg/payment/service/ChargeService.java - Profile API
profile/src/main/java/com/ganchevdimitarg/profile/controller/ProfileController.java - Profile service
profile/src/main/java/com/ganchevdimitarg/profile/service/ProfileService.java
Events and notifications
- User event outbox
authentication/src/main/java/com/ganchevdimitarg/auth/service/OutboxWriter.java - Notification consumer
notification/src/main/java/com/ganchevdimitarg/notification/listener/KafkaListenerService.java - Email delivery
notification/src/main/java/com/ganchevdimitarg/notification/service/EmailService.java - Notification dedupe
notification/src/main/java/com/ganchevdimitarg/notification/service/IdempotencyService.java
Platform infrastructure
- Service discovery
eureka-server/src/main/java/com/ganchevdimitarg/EurekaServerApplication.java - Message broker
- Redis
Other components
- Client user
Connections 23
- Client user → API gateway: sends requests
- API gateway → Authentication: routes requests
- API gateway → Product catalog: routes requests
- API gateway → Order API: routes requests
- API gateway → Payment processing: routes requests
- API gateway → Profile API: routes requests
- Account lifecycle → User event outbox: writes events
authentication/src/main/java/com/ganchevdimitarg/auth/service/AccountService.java - Order API → Order management: calls
order/src/main/java/com/ganchevdimitarg/order/controller/OrderController.java - Order API → Order idempotency: guards mutations
order/src/main/java/com/ganchevdimitarg/order/controller/OrderController.java - Order API → Order management: requests lifecycle changes
order/src/main/java/com/ganchevdimitarg/order/controller/OrderController.java - Order management → Order lifecycle: uses transitions
order/src/main/java/com/ganchevdimitarg/order/service/OrderService.java - Profile API → Profile service: calls
profile/src/main/java/com/ganchevdimitarg/profile/controller/ProfileController.java - Profile service → Payment processing: fetches card reference
profile/src/main/java/com/ganchevdimitarg/profile/service/ProfileService.java - Notification consumer → Email delivery: sends email
notification/src/main/java/com/ganchevdimitarg/notification/listener/KafkaListenerService.java - Notification consumer → Notification dedupe: deduplicates events
notification/src/main/java/com/ganchevdimitarg/notification/listener/KafkaListenerService.java - User event outbox → Message broker: publishes events
- Message broker → Notification consumer: delivers events
- Order idempotency → Redis: stores replay results
order/src/main/java/com/ganchevdimitarg/order/service/IdempotencyService.java - Notification dedupe → Redis: claims event keys
notification/src/main/java/com/ganchevdimitarg/notification/service/IdempotencyService.java - Product operations → Product catalog: serves catalog operations
catalog/src/main/java/com/ganchevdimitarg/catalog/service/product/ProductService.java - Category operations → Product catalog: serves category operations
catalog/src/main/java/com/ganchevdimitarg/catalog/service/category/CategoryService.java - Product comments → Product catalog: serves comment operations
catalog/src/main/java/com/ganchevdimitarg/catalog/service/comment/CommentService.java - Client user → Service discovery: discovers services