How sourabhpatel-dev/ecommerce-backend works
SourHub is a Java/Spring microservices e-commerce backend. The principal flow starts with a client request through the JWT-validating gateway, then reaches domain services for users, catalog, orders, payments, and reviews. Order/payment coordination is asynchronous through Kafka and a durable order outbox; reviews verify delivered purchases through Order Service and publish rating events. The graph preserves documented catalog, identity, commerce, and platform capabilities. Cross-service links rely on the README; only sampled source-level calls are cited directly, so unsampled internal wiring is not inferred.
Main entry points: api_gateway API gateway · OrderService.java Orders and coupons · ProductService.java Product catalog · PaymentService.java Payment lifecycle
Components 23
Edge and identity
- API gateway
api-gateway/src/main/java/com/sourabh/api_gateway - Authentication
auth-service/src/main/java/com/sourabh/auth_service
Commerce services
- Profiles and accounts
user-service/src/main/java/com/sourabh/user_service - Cart and loyalty
user-service/src/main/java/com/sourabh/user_service/controller/CartController.java - Orders and coupons
order-service/src/main/java/com/sourabh/order_service/service/OrderService.java - Returns and tracking
order-service/src/main/java/com/sourabh/order_service/service/ReturnService.java - Invoices
order-service/src/main/java/com/sourabh/order_service/service/InvoiceService.java - Payment lifecycle
payment-service/src/main/java/com/sourabh/payment_service/service/PaymentService.java - Payment gateway
payment-service/src/main/java/com/sourabh/payment_service/gateway/PaymentGateway.java - Support tickets
user-service/src/main/java/com/sourabh/user_service/service/SupportTicketService.java
Catalog and community
- Product catalog
product-service/src/main/java/com/sourabh/product_service/service/ProductService.java - Product search
product-service/src/main/java/com/sourabh/product_service/search/service/ProductSearchService.java - Inventory and deals
product-service/src/main/java/com/sourabh/product_service/service/InventoryService.java - Reviews and votes
review-service/src/main/java/com/sourabh/review_service/service/impl/ReviewServiceImpl.java
Platform coordination
- Eureka discovery
eureka-server/src/main/java/com/sourabh/eureka_server - Central config
config-server/src/main/java/com/sourabh/config_server - Observability
Persistence and messaging
- Kafka events
- Order outbox
order-service/src/main/java/com/sourabh/order_service/kafka/OrderCreatedOutboxPublisher.java - PostgreSQL
- Redis
- Elasticsearch
Other components
- API client
Connections 37
- API client → API gateway: sends requests
README.md - API gateway → Authentication: routes auth
- API gateway → Profiles and accounts: routes requests
README.md - API gateway → Product catalog: routes requests
README.md - API gateway → Orders and coupons: routes requests
README.md - API gateway → Payment lifecycle: routes requests
README.md - API gateway → Reviews and votes: routes requests
README.md - Authentication → Profiles and accounts: fetches identities
auth-service/src/main/java/com/sourabh/auth_service/service/impl/AuthServiceImpl.java - Profiles and accounts → PostgreSQL: stores accounts
README.md - Cart and loyalty → Profiles and accounts: manages user cart
- Product catalog → PostgreSQL: stores catalog
README.md - Product catalog → Product search: indexes products
- Product search → Elasticsearch: searches index
README.md - Inventory and deals → Product catalog: updates stock
- Orders and coupons → Product catalog: validates products
README.md - Orders and coupons → Order outbox: records events
README.md - Order outbox → Kafka events: publishes events
README.md - Kafka events → Payment lifecycle: delivers order.created
README.md - Payment lifecycle → Payment gateway: executes payment
- Payment lifecycle → Kafka events: publishes completion
README.md - Kafka events → Orders and coupons: delivers payment.completed
README.md - Orders and coupons → PostgreSQL: stores orders
README.md - Payment lifecycle → PostgreSQL: stores payments
README.md - Returns and tracking → Orders and coupons: handles returns
- Invoices → Orders and coupons: generates invoices
- Reviews and votes → Orders and coupons: checks purchase
review-service/src/main/java/com/sourabh/review_service/service/impl/ReviewServiceImpl.java - Reviews and votes → Kafka events: publishes rating event
review-service/src/main/java/com/sourabh/review_service/service/impl/ReviewServiceImpl.java - Kafka events → Product catalog: delivers review events
- Reviews and votes → PostgreSQL: stores reviews
- Support tickets → PostgreSQL: stores tickets
- API gateway → Redis: counts rate limits
README.md - API gateway → Eureka discovery: discovers services
- Authentication → Eureka discovery: discovers services
- Orders and coupons → Eureka discovery: discovers services
- Payment lifecycle → Eureka discovery: discovers services
- Product catalog → Central config: receives configuration
- Observability → API gateway: observes service