Repository & Service layers over MVC
Data access is abstracted behind `IProductRepository`, `IOrderRepository` & `ICartRepository`, while business logic lives in `IOrderService`, `ICartService`, `INotificationService` & `IReportService`. Controllers stay thin; services own the rules.
Outbound email queued off the request path
Order confirmations & status-update emails go into a bounded `EmailQueue` channel and are drained by a background `EmailWorker`, so sends never block or silently fail a user's request.
Server-side validation everywhere
Discount codes were originally validated client-side only. Validation moved server-side via `IOrderService.ApplyDiscountAsync`, so the server is the single source of truth.
Response cache versioning
The product catalogue is response-cached, but the cache is busted (versioned) whenever product or stock data changes, so shoppers never see stale availability.
Real-time chat with SignalR
`ChatHub` and `InventoryHub` power live chat and stock updates. A typing-indicator race condition was fixed by swapping a `Dictionary` for a `ConcurrentDictionary`.