How rafeysyed/ecom-springb works
This repository is an event-driven e-commerce system with a React storefront and Spring microservices. A customer browses products, authenticates, builds a cart, and places an order; the order service validates product and user data, reserves inventory, and starts payment through Kafka. Payment outcomes return asynchronously to update order status, with notifications dispatched from order-status events. The graph also preserves administration, recommendations, OAuth, and service discovery. README documentation establishes the broader architecture; sampled source confirms selected service calls and processing details, so uncertain internal wiring is omitted.
Main entry points: JwtAuthenticationFilter.java API Gateway · OrderService.java Order Management · UserService.java User And Cart · App.tsx React Storefront
Components 22
Storefront
- React Storefront
frontend/src/App.tsx - API Client
frontend/src/api/client.ts - Catalog And Cart
frontend/src/features/products/hooks/useProducts.ts - Checkout And Orders
frontend/src/features/orders/hooks/usePlaceOrder.ts - Login And Profile
frontend/src/features/auth/hooks/useLogin.ts - Admin Tools
frontend/src/features/admin/api/admin.ts
Edge And Identity
- API Gateway
gatewayservice/src/main/java/com/project/gatewayservice/filter/JwtAuthenticationFilter.java - Authentication
authservice/src/main/java/com/project/authservice/service/AuthService.java
Commerce Services
- User And Cart
userservice/src/main/java/com/project/userservice/service/UserService.java - Product Catalog
productservice/src/main/java/com/project/productservice/service/ProductService.java - Stock Reservations
inventoryservice/src/main/java/com/project/inventoryservice/service/InventoryService.java - Order Management
orderservice/src/main/java/com/project/orderservice/service/OrderService.java - Payment Processing
paymentservice/src/main/java/com/project/paymentservice/service/PaymentService.java - Notifications
userservice/src/main/java/com/project/userservice/service/NotificationService.java
Events And State
- Kafka
- Payment Outbox
paymentservice/src/main/java/com/project/paymentservice/service/OutboxPublisher.java - PostgreSQL Data
- Redis Cache
Discovery And Recommendations
- Service Discovery
servicediscovery/src/main/java/com/project/servicediscovery/ServicediscoveryApplication.java - Recommendations
recommendationservice/src/main/java/com/project/recommendationservice/service/RecommendationService.java
Other components
- Shopper
- OAuth Providers
Connections 38
- Shopper → React Storefront: uses
- React Storefront → API Client: requests
- API Client → API Gateway: routes API
- React Storefront → Catalog And Cart: browses
- React Storefront → Checkout And Orders: checks out
- React Storefront → Login And Profile: signs in
- React Storefront → Admin Tools: administers
- API Gateway → Authentication: routes auth
- API Gateway → User And Cart: routes user
- API Gateway → Product Catalog: routes catalog
- API Gateway → Order Management: routes orders
- API Gateway → Payment Processing: routes payments
- API Gateway → Stock Reservations: routes stock
- API Gateway → Recommendations: routes recommendations
- Authentication → User And Cart: looks up user
- User And Cart → Authentication: creates credentials
- Authentication → PostgreSQL Data: stores credentials
- Order Management → Product Catalog: fetches product
- Order Management → User And Cart: validates user
- Order Management → Stock Reservations: reserves stock
- Order Management → PostgreSQL Data: stores orders
- Order Management → Kafka: publishes order event
- Kafka → Payment Processing: delivers order event
- Payment Processing → PostgreSQL Data: stores payment
- Payment Processing → Payment Outbox: records event
- Payment Outbox → Kafka: publishes outcome
- Kafka → Order Management: delivers payment outcome
- Order Management → Kafka: publishes status event
- Kafka → User And Cart: delivers status event
- User And Cart → Notifications: creates notification
- Notifications → PostgreSQL Data: stores notification
- Notifications → User And Cart: reads user details
- Product Catalog → Redis Cache: caches catalog
- Recommendations → Product Catalog: fetches products
- Recommendations → Redis Cache: caches recommendations
- Login And Profile → OAuth Providers: authenticates with
- Authentication → OAuth Providers: exchanges OAuth code
- API Gateway → Service Discovery: resolves services