How kunwardivyrajs/eshop works
Purpose and entry points
eShop “AdventureWorks” is a .NET 10 reference e-commerce system using service-oriented architecture and .NET Aspire. The primary local entry point is the Aspire AppHost, selected by aspire.config.json; it composes the distributed application and its dependencies. Application executables generally bootstrap in each service’s Program.cs.
• src/eShop.AppHost/Program.cs
• aspire.config.json
• eShop.Web.slnf
Distributed orchestration and shared platform
The AppHost coordinates service startup, service discovery/configuration, containerized dependencies, and deployment modeling. Shared service defaults centralize cross-cutting HTTP, authentication, configuration, and OpenAPI behavior. Local execution requires an OCI runtime; the documented deployment target is Azure Container Apps, with disposable PostgreSQL, Redis, and RabbitMQ containers.
• src/eShop.AppHost/Extensions.cs
• src/eShop.ServiceDefaults/Extensions.cs
• src/eShop.ServiceDefaults/AuthenticationExtensions.cs
Customer-facing clients
The main browser client is a Blazor web application for catalog browsing, cart, checkout, login, and order history. It holds browser-side basket state, calls backend services, and consumes order-status events for UI refresh. Two MAUI clients provide native/hybrid alternatives: an MVVM client and a Blazor Hybrid catalog client.
• src/WebApp/Program.cs
• src/WebApp/Services/BasketState.cs
• src/ClientApp/MauiProgram.cs
• src/HybridApp/MauiProgram.cs
Catalog and basket boundaries
Catalog is an HTTP API with EF Core persistence, migrations, seeded products, images, paging, and integration-event publishing. Basket is a separate gRPC API backed by Redis; clients use its protobuf contract rather than accessing basket storage directly. Catalog’s integration handlers participate in stock and price-change workflows.
• src/Catalog.API/Program.cs
• src/Catalog.API/Infrastructure/CatalogContext.cs
• src/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs
• src/Basket.API/Grpc/BasketService.cs
• src/Basket.API/Repositories/RedisBasketRepository.cs
Ordering workflow and durable domain model
Ordering exposes API endpoints and applies a CQRS/mediator-style application layer: validated commands run through logging and transaction behaviors, mutate Buyer/Order aggregates, and expose query models separately. Ordering persistence is EF Core with repositories and an idempotency request manager. The checkout flow creates/submits an order from basket data, then order status advances through validation, payment, stock confirmation/rejection, shipment, or cancellation.
• src/Ordering.API/Apis/OrdersApi.cs
• src/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs
• src/Ordering.API/Application/Behaviors/TransactionBehavior.cs
• src/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs
• src/Ordering.Infrastructure/OrderingContext.cs
Asynchronous integration pipeline
Services communicate state changes through shared event-bus abstractions with a RabbitMQ implementation. Catalog and Ordering use integration-event services plus EF-backed event logging/outbox infrastructure to couple database updates with eventual publication. Payment and grace-period processors are standalone background executables that consume/publish order events; their results drive Ordering state transitions. WebApp subscribes to status events for customer notifications.
• src/EventBus/Abstractions/IEventBus.cs
• src/EventBusRabbitMQ/RabbitMQEventBus.cs
• src/IntegrationEventLogEF/Services/IntegrationEventLogService.cs
• src/PaymentProcessor/Program.cs
• src/OrderProcessor/Services/GracePeriodManagerService.cs
Identity, webhooks, and optional AI
Identity is a dedicated ASP.NET Core/IdentityServer-style authentication authority with EF-backed users and account/consent flows; clients and services authenticate across this boundary. Webhooks persist subscriptions and relay selected catalog/order events to registered external endpoints; a separate client manages subscriptions and received messages. An optional AppHost-enabled Microsoft Foundry integration supplies chat and embedding connections for the web chatbot, using Foundry deployments when UseFoundry=true.
• src/Identity.API/Program.cs
• src/Identity.API/Data/ApplicationDbContext.cs
• src/Webhooks.API/Apis/WebHooksApi.cs
• src/Webhooks.API/Services/WebhooksSender.cs
• src/WebApp/Components/Chatbot/MessageProcessor.cs
Main entry points: RabbitMQEventBus.cs RabbitMQ Event Bus · Catalog.API/Program.cs Catalog API · eShop.AppHost/Program.cs Aspire AppHost · WebApp/Program.cs Blazor WebApp
Components 21
Orchestration
- Aspire AppHost · Composes local services, containers, discovery, and deployment resources.
src/eShop.AppHost/Program.cs - Service Defaults · Standardizes HTTP, auth, configuration, and OpenAPI.
src/eShop.ServiceDefaults/Extensions.cs
Clients
- Blazor WebApp · Customer storefront with basket state and order-status refresh.
src/WebApp/Program.cs - MAUI Client
src/ClientApp/MauiProgram.cs - Blazor Hybrid
src/HybridApp/MauiProgram.cs
Commerce services
- Catalog API · Serves products and publishes catalog changes.
src/Catalog.API/Program.cs - Catalog database · Products, images, migrations, and seed data.
src/Catalog.API/Infrastructure/CatalogContext.cs - Basket API · Owns customer basket access through its protobuf contract.
src/Basket.API/Grpc/BasketService.cs - Redis
src/Basket.API/Repositories/RedisBasketRepository.cs - Ordering API · Receives checkout and order-query requests.
src/Ordering.API/Apis/OrdersApi.cs - Order command layer · Validates and transacts create-order commands.
src/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs - Order aggregates · Buyer and Order lifecycle state.
src/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs - Ordering database · Persists orders, repositories, and idempotency data.
src/Ordering.Infrastructure/OrderingContext.cs
Event pipeline
- RabbitMQ Event Bus · Shared asynchronous integration transport.
src/EventBusRabbitMQ/RabbitMQEventBus.cs - Integration event log · EF-backed durable publication record for service changes.
src/IntegrationEventLogEF/Services/IntegrationEventLogService.cs - Payment Processor · Consumes order events and publishes payment outcomes.
src/PaymentProcessor/Program.cs - Grace-period Processor · Advances delayed order processing and cancellation paths.
src/OrderProcessor/Services/GracePeriodManagerService.cs
Platform services
- Identity API · IdentityServer-style users, login, consent, and tokens.
src/Identity.API/Program.cs - Webhooks API · Stores subscriptions and relays selected commerce events.
src/Webhooks.API/Apis/WebHooksApi.cs - Registered endpoints
- Foundry Chat · Provides chat and embedding connections when enabled.
src/WebApp/Components/Chatbot/MessageProcessor.cs
Connections 31
- Aspire AppHost → Service Defaults: applies defaults
- Aspire AppHost → Catalog API: starts
- Aspire AppHost → Basket API: starts
- Aspire AppHost → Ordering API: starts
- Aspire AppHost → RabbitMQ Event Bus: provisions
- Aspire AppHost → Redis: provisions
- Blazor WebApp → Catalog API: browses catalog
- Blazor WebApp → Basket API: basket gRPC
- Blazor WebApp → Ordering API: checkout and orders
- MAUI Client → Catalog API: catalog access
- Blazor Hybrid → Catalog API: catalog access
- Blazor WebApp → Identity API: sign-in
- Blazor WebApp → Foundry Chat: chat requests
- Catalog API → Catalog database: persists
- Basket API → Redis: reads and writes
- Ordering API → Order command layer: dispatches commands
- Order command layer → Order aggregates: mutates
- Order command layer → Ordering database: transactional persistence
- Catalog API → Integration event log: records events
- Order command layer → Integration event log: records events
- Integration event log → RabbitMQ Event Bus: eventual publish
- RabbitMQ Event Bus → Payment Processor: order events
- Payment Processor → RabbitMQ Event Bus: payment result
- RabbitMQ Event Bus → Grace-period Processor: order events
- Grace-period Processor → RabbitMQ Event Bus: status result
- RabbitMQ Event Bus → Ordering API: status transitions
- RabbitMQ Event Bus → Blazor WebApp: order status
- RabbitMQ Event Bus → Webhooks API: selected events
- Webhooks API → Registered endpoints: delivers webhooks
- Identity API → Catalog API: service/client auth
- Identity API → Ordering API: service/client auth