FreshCart — .NET 10 + Aspire microservices reference e-commerce platform with an Angular 20 SPA
FreshCart — .NET 10 + Aspire microservices reference e-commerce platform with an Angular 20 SPA
Start here: open
index.htmlin any browser. That single page is the animated architecture guide, the demo-credentials sheet, the operations runbook and the interview tour, all in one self-contained document. The backend platform for FreshCart: twelve bounded contexts, each in a deliberately different architectural style, behind a YARP gateway, hosted on Azure Kubernetes Service through Azure DevOps or GitHub Actions multi-stage pipelines. The Angular 20 signal-based storefront lives in a companion repository — amasen02/freshcart-web.
The platform ships with three pre-seeded accounts so you can sign in and walk through the
customer and back-office flows in under a minute. The
IdentityDataSeeder
creates them automatically on first boot when ASPNETCORE_ENVIRONMENT=Development. It refuses
to run in any other environment.
# 0. Clone
git clone https://github.com/amasen02/freshcart-backend.git && cd freshcart-backend
# 1. Whole .NET stack via Aspire — boots its backing stores, every microservice and the gateway
dotnet run --project src/AspireAppHost/FreshCart.AppHost/FreshCart.AppHost.csproj --launch-profile http
# 2. Customer storefront (separate repo) — ng serve proxies /api and /hubs to the gateway on 7100
git clone https://github.com/amasen02/freshcart-web.git
cd freshcart-web && npm ci && npm start| Surface | URL | What it shows |
|---|---|---|
| Customer storefront | https://localhost:4200 | Catalog, basket, checkout, orders, support chat, real-time notifications |
| Aspire dashboard | http://localhost:15888 | Every service + live traces, metrics, logs |
| YARP API Gateway | https://localhost:7100 | Single public edge; cookie-to-JWT BFF exchange |
| Identity API (OpenAPI) | https://localhost:7101 | Sign-up, sign-in, refresh, MFA enrollment |
| Customer Support API (development Swagger UI) | https://localhost:7111/swagger | OpenAPI schema exploration; support operations still require a JWT |
| Reporting API (OpenAPI) | https://localhost:7110 | Dashboards, invoices, Excel exports |
| Seq (logs) | http://localhost:5341 | Structured logs across every service |
| Grafana (metrics) | http://localhost:3000 | RED + USE dashboards (admin / freshcart_local_dev) |
| Prometheus | http://localhost:9090 | Raw metric store |
| RabbitMQ management | http://localhost:15672 | Queues + exchanges (freshcart / freshcart_local_dev) |
Customer Support exposes its OpenAPI surface locally during Development:
https://localhost:7111/swagger serves the self-hosted Swagger UI assets.https://localhost:7111/openapi/v1.json serves the generated document consumed by that UI.GET /support/sessions/active returns ChatSessionDto values; GET /support/sessions returns a paginated ChatSessionDto envelope; and GET /support/sessions/{sessionId}/messages returns a paginated ChatMessageDto envelope.| Role | Password | What this account can do | |
|---|---|---|---|
| Customer | [email protected] |
Demo-P@ssw0rd-2026 |
Browse catalog, add to basket, check out, view orders, chat to support |
| SupportAgent | [email protected] |
Support-P@ssw0rd-2026 |
Answer support chats; query the Reporting API for order context |
| Administrator | [email protected] |
Admin-P@ssw0rd-2026 |
Reporting API: KPI dashboards, invoices, inventory health, exports |
Production safety. The seeder is guarded by
IHostEnvironment.IsDevelopment()and the sign-up validator rejects any*.testemail — these accounts cannot exist in Staging or Production.
The admin SPA is a planned phase (see
CHANGELOG.md). Until it ships, theSupportAgentandAdministratorsurfaces are reached through the Reporting API and the support hub directly.
[email protected].NotificationHub
SignalR push through the Redis backplane.SupportAgent session picks it up over the
WebSocket hub.[email protected] token →
Sales overview reflects the test order in the GMV and order-count tiles.POST /invoices for the order → a QuestPDF-rendered PDF opens via a 15-minute Azure Blob
SAS URL.GET /exports/sales-transactions.xlsx — ClosedXML Excel with frozen header and
auto-width columns.The candidate's CV lists eleven years of work across .NET, Angular, Azure, AWS, IdentityServer4, SignalR, RabbitMQ, microservices, DDD, CQRS, Event Sourcing, Saga, polyglot persistence, EF Core + Dapper hybrid, SonarQube, Prometheus + Grafana, AKS, EKS, Azure DevOps CI/CD.
A long list of skills is unfalsifiable. This repository is the falsifiable evidence for the backend — every claim anchored to running code, an ADR, and a walkthrough card. The Angular front-end evidence lives in the companion repo freshcart-web.
| # | Context | Architecture | Persistence | Status |
|---|---|---|---|---|
| 1 | Identity | Clean Architecture + ASP.NET Identity | Azure SQL | Built |
| 2 | Catalog | Vertical Slice + Carter + MediatR | PostgreSQL + Marten | Built |
| 3 | Pricing | gRPC service | SQLite (in-container) | Built |
| 4 | Basket | Vertical Slice + Outbox + Decorator | PostgreSQL + Redis HybridCache | Built |
| 5 | Ordering | Clean / Onion + DDD + Saga | SQL Server (EF Core writes, Dapper reads) | Built |
| 6 | Inventory | Layered (3-tier) + Dapper | SQL Server | Built |
| 7 | Payment | Clean + Event Sourcing | MongoDB events + SQL Server projection | Built |
| 8 | Delivery | Hexagonal (Ports & Adapters) | MongoDB (geo indexes) | Built |
| 9 | Notification | Pipes-and-filters + SignalR | MongoDB + Redis backplane | Built |
| 10 | CustomerSupport | Stateful WebSocket | MongoDB transcripts + Redis presence | Built |
| 11 | Reviews | Vertical Slice + Document DB | MongoDB | Built |
| 12 | Reporting | CQRS read model + QuestPDF | MySQL warehouse + Blob Storage | Built |
Edge and clients:
| Surface | Technology | Status |
|---|---|---|
| YARP API Gateway | .NET 10 + YARP; cookie-to-JWT BFF exchange | Built |
| AdminBackoffice | Modular monolith (IModule pattern) |
Planned |
| Customer SPA | Angular 20 standalone + signals + Bootstrap 5 | Built — separate repo: freshcart-web |
| Admin SPA | Angular 20 standalone + signals + Bootstrap 5 | Planned — will live in freshcart-web |
The browser clients live in the companion frontend repository amasen02/freshcart-web; this repository is the backend platform they reach through the gateway.
BuildingBlocks carries the cross-cutting libraries: BuildingBlocks (CQRS, behaviors,
exception handling, pagination, security), BuildingBlocks.Messaging (integration event
contracts, outbox, MassTransit wiring), BuildingBlocks.Observability, and ServiceDefaults.
The Reporting service is a first-class member of the platform:
INV-2026-000123, CR-2026-000018, PF-2026-000009).BackgroundService.OrderConfirmed, OrderRefunded integration events
consumed by MassTransit, UPSERT-ed into denormalised MySQL tables. Idempotent at every hop
via the projection inbox.See index.html → Reporting & Invoices tab for the full surface.
Customer, SupportAgent, Administrator,
BackOfficeUser); resource-based authorization handlers defeat BOLA.AddStandardResilienceHandler() on every typed HttpClient (retry +
circuit breaker + timeout + bulkhead).ValidationBehavior.CustomExceptionHandler mapping domain exceptions to RFC 7807
ProblemDetails with traceId.OutboxPublisher background
worker; consumers idempotent via inbox.UseFreshCartSecurityHeaders() middleware applies CSP strict,
X-Frame-Options=DENY, Referrer-Policy, Permissions-Policy, COOP/COEP/CORP.BaseAddress with relative request URIs,
so no caller-supplied URL reaches an outbound call, and the AKS egress NetworkPolicy blocks
169.254.169.254. OutboundUrlAllowListHandler is written and unit-tested but is not yet
attached to any typed HttpClient — see SECURITY.md.Full OWASP Top-10 2025 mapping in
docs/adr/ADR-0004-owasp-top-10-control-mapping.md.
The hard parts of a distributed system are the races. Each guarantee below is backed by a real-database concurrency test (Testcontainers spins up the actual engine and fires N parallel callers) rather than asserted in prose:
BookedCount < Capacity; the loser of a race is redelivered and re-scheduled against the
remaining slots. Proven by a 20-way concurrent MongoDB test. (DLV-001)INSERT … ON DUPLICATE KEY UPDATE … LAST_INSERT_ID), never a read-then-write. Proven by a
25-way concurrent MySQL test yielding exactly {1..25}. (REP-002)UPDATE; a concurrent
reuse is treated as a stolen-tokenNo open issues yet, or sync has not completed.