How rahulsahay19/clean-architecture-dotnet-10 works
This repository implements an event-driven e-commerce backend. The main customer journey is browsing catalog products, building a basket, checking out, and having Ordering coordinate payment outcomes; Identity provides authentication. README-described saga and outbox behavior is represented where source excerpts do not expose the full implementation. Dashed edges indicate documented but unsampled or otherwise unverified relationships.
Main entry points: Program.cs API Gateway · Orders Order command and query handlers · BasketController.cs Basket API · Handlers Basket workflows
Components 26
Product Catalog
- Catalog API
Services/Catalog/Catalog.API/Controllers/CatalogController.cs - Catalog queries and commands
Services/Catalog/Catalog.Application/Handlers - Catalog repository
Services/Catalog/Catalog.Infrastructure/Repositories/ProductRepository.cs
Basket and Discounts
- Basket API
Services/Basket/Basket.API/Controllers/BasketController.cs - Basket workflows
Services/Basket/Basket.Application/Handlers - Basket repository
Services/Basket/Basket.Infrastructure/Repositories/BasketRepository.cs - Discount gRPC client
Services/Basket/Basket.Application/GrpcService/DiscountGrpcService.cs - Discount gRPC service
Services/Discount/Discount.API/Services/DiscountService.cs - Discount repository
Services/Discount/Discount.Infrastructure/Repositories/DiscountRepository.cs
Orders and Payments
- Checkout event
Infrastructure/EventBus.Messages/Events/BasketCheckoutEvent.cs - Checkout consumer
Services/Ordering/Ordering.Application/EventBusConsumer/BasketOrderingConsumer.cs - Order API
Services/Ordering/Ordering.API/Controllers/OrderController.cs - Order command and query handlers
Services/Ordering/Ordering.Application/Orders - Outbox dispatcher
Services/Ordering/Ordering.Infrastructure/Dispatcher/OutboxMessageDispatcher.cs - Payment consumer
Services/Payment/Payment/EventBusConsumer/OrderCreatedConsumer.cs - Payment outcome consumers
Services/Ordering/Ordering.Application/EventBusConsumer
Access and Platform
- API Gateway
ApiGateway/ApiGateway/Program.cs - Identity and JWT
Services/Identity/Identity/Controllers/AuthController.cs - Shared logging
Infrastructure/Common.Logging/Logging.cs - Service defaults
Aspire/Ecommerce.ServiceDefaults/Extensions.cs
Other components
- Customer
- Catalog MongoDB
- Redis cache
- Discount database
- RabbitMQ
- Order database
Connections 26
- Customer → API Gateway: requests
- API Gateway → Catalog API: routes
- API Gateway → Basket API: routes
- API Gateway → Order API: routes
- Customer → Identity and JWT: authenticates
- Catalog API → Catalog queries and commands: dispatches
Services/Catalog/Catalog.API/Controllers/CatalogController.cs - Catalog queries and commands → Catalog repository: queries
- Catalog repository → Catalog MongoDB: reads and writes
Services/Catalog/Catalog.Infrastructure/Repositories/ProductRepository.cs - Basket API → Basket workflows: dispatches
Services/Basket/Basket.API/Controllers/BasketController.cs - Basket workflows → Basket repository: loads and deletes
Services/Basket/Basket.Application/Handlers/BasketCheckoutHandler.cs - Basket repository → Redis cache: stores baskets
- Basket workflows → Checkout event: publishes
Services/Basket/Basket.Application/Handlers/BasketCheckoutHandler.cs - Basket API → Discount gRPC client: registers client
- Discount gRPC client → Discount gRPC service: calls gRPC
- Discount gRPC service → Discount repository: queries discounts
Services/Discount/Discount.API/Services/DiscountService.cs - Discount repository → Discount database: reads and writes
Services/Discount/Discount.Infrastructure/Repositories/DiscountRepository.cs - Checkout event → RabbitMQ: transports
- RabbitMQ → Checkout consumer: delivers event
- Checkout consumer → Order command and query handlers: creates order
- Order API → Order command and query handlers: invokes
Services/Ordering/Ordering.API/Controllers/OrderController.cs - Order command and query handlers → Order database: persists orders
- Outbox dispatcher → RabbitMQ: publishes reliably
- Payment consumer → RabbitMQ: consumes events
- RabbitMQ → Payment outcome consumers: delivers outcomes
- Payment outcome consumers → Order command and query handlers: updates order
- Shared logging → Service defaults: supports services
Infrastructure/Common.Logging/Logging.cs