How alaa-hani101/orderflow works
OrderFlow is an educational .NET e-commerce backend. Its main user flow is order creation and order retrieval through REST endpoints, with CQRS handlers separating writes from reads; order-by-ID reads use Redis caching. A separate dashboard query reads a materialized model refreshed by a background worker, which also processes pending orders. SQL Server is the transactional source of truth. The graph reflects README-documented capabilities where implementation details were not sampled; edges cite the README or shown/indexed source, and unsampled wiring is not inferred.
Main entry points: IApplicationDbContext.cs Database Contract · OrderController.cs Order Endpoints · CreateOrderHandler.cs Create Order · Order.cs Order Aggregate
Components 22
REST API
- Order Endpoints
OrderFlow.API/Controllers/OrderController.cs - Dashboard Endpoint
OrderFlow.API/Controllers/DashboardController.cs
CQRS Features
- Create Order
OrderFlow.Application/Features/Orders/CreateOrder/CreateOrderHandler.cs - Order Validation
OrderFlow.Application/Features/Orders/CreateOrder/CreateOrderValidator.cs - Get Order
OrderFlow.Application/Features/Orders/GetOrderById/GetOrderByIdHandler.cs - List Orders
OrderFlow.Application/Features/Orders/GetOrders/GetOrdesHandler.cs - Dashboard Query
OrderFlow.Application/Features/Dashboard/GetDashboardHandler.cs - Database Contract
OrderFlow.Application/common/IApplicationDbContext.cs - Cache Contract
OrderFlow.Application/common/ICacheService.cs - Dashboard Read Model
OrderFlow.Application/Features/Dashboard/ReadModels/OrderDashboardReadModel.cs
Order Domain
- Customer
OrderFlow.Domain/Entities/Customer.cs - Order Aggregate
OrderFlow.Domain/Entities/Order.cs - Order Item
OrderFlow.Domain/Entities/OrderItem.cs - Order Status
OrderFlow.Domain/Entities/Enums/OrderStatus.cs
Infrastructure
- EF DbContext
OrderFlow.Infrastructure/Persistence/ApplicationDbContext.cs - Redis Cache
OrderFlow.Infrastructure/Persistence/Caching/RedisCacheService.cs - Background Worker
OrderFlow.Infrastructure/BackgroundJobs/DashboardRefreshBackgroundService.cs - Pending Processor
OrderFlow.Infrastructure/Services/PendingOrdersProcessor.cs - Dashboard Refresher
OrderFlow.Infrastructure/Services/DashboardRefreshService.cs
Other components
- API Caller
- SQL Server
- Redis Store
Connections 26
- API Caller → Order Endpoints: calls
README.md - API Caller → Dashboard Endpoint: requests
README.md - Order Endpoints → Create Order: dispatches
OrderFlow.API/Controllers/OrderController.cs - Order Endpoints → Get Order: dispatches
OrderFlow.API/Controllers/OrderController.cs - Order Endpoints → List Orders: dispatches
OrderFlow.API/Controllers/OrderController.cs - Dashboard Endpoint → Dashboard Query: dispatches
OrderFlow.API/Controllers/DashboardController.cs - Create Order → Database Contract: writes through
OrderFlow.Application/Features/Orders/CreateOrder/CreateOrderHandler.cs - Create Order → Order Aggregate: creates
OrderFlow.Application/Features/Orders/CreateOrder/CreateOrderHandler.cs - Order Validation → Create Order: validates
OrderFlow.Application/Features/Orders/CreateOrder/CreateOrderValidator.cs - Get Order → Database Contract: reads through
OrderFlow.Application/Features/Orders/GetOrderById/GetOrderByIdHandler.cs - Get Order → Cache Contract: checks and caches
OrderFlow.Application/Features/Orders/GetOrderById/GetOrderByIdHandler.cs - List Orders → Database Contract: reads through
OrderFlow.Application/Features/Orders/GetOrders/GetOrdesHandler.cs - Dashboard Query → Database Contract: queries through
OrderFlow.Application/Features/Dashboard/GetDashboardHandler.cs - EF DbContext → Database Contract: implements
OrderFlow.Infrastructure/Persistence/ApplicationDbContext.cs - EF DbContext → SQL Server: persists data
README.md - Redis Cache → Cache Contract: implements
OrderFlow.Infrastructure/Persistence/DependencyInjection.cs - Redis Cache → Redis Store: reads and writes
README.md - Background Worker → Dashboard Refresher: invokes
OrderFlow.Infrastructure/BackgroundJobs/DashboardRefreshBackgroundService.cs - Background Worker → Pending Processor: invokes
OrderFlow.Infrastructure/BackgroundJobs/DashboardRefreshBackgroundService.cs - Dashboard Refresher → EF DbContext: refreshes via
OrderFlow.Infrastructure/Services/DashboardRefreshService.cs - Dashboard Refresher → Dashboard Read Model: rebuilds
OrderFlow.Infrastructure/Services/DashboardRefreshService.cs - Pending Processor → EF DbContext: processes via
OrderFlow.Infrastructure/Services/PendingOrdersProcessor.cs - Pending Processor → Cache Contract: invalidates
OrderFlow.Infrastructure/Services/PendingOrdersProcessor.cs - Customer → Order Aggregate: has orders
OrderFlow.Domain/Entities/Customer.cs - Order Aggregate → Order Item: contains
OrderFlow.Domain/Entities/Order.cs - Order Aggregate → Order Status: uses status
OrderFlow.Domain/Entities/Order.cs