How nimblepros/eshoponweb works
Project Type and Purpose
• This is Microsoft’s eShopOnWeb ASP.NET Core reference app—a full‐stack, “monolithic” (single‐repo but multi‐project) web application demonstrating Clean Architecture principles.
• It comprises:
• A REST API (PublicApi)
• A server‐rendered MVC/Razor Pages site (Web)
• A Blazor WebAssembly admin UI (BlazorAdmin)
• A shared domain project (ApplicationCore), infrastructure project (Infrastructure) for EF Core, Identity, logging, email, etc.
• IaC definitions under infra (Bicep for Azure SQL, App Service, Key Vault)
• Docker Compose and DevContainer configs for local/dev environments
File Structure Analysis & Architectural Layers
• Layer 1: Domain (src/ApplicationCore)
• Entities, value objects, interfaces, domain services, specifications, domain events
• Layer 2: Infrastructure (src/Infrastructure)
• EF Core DbContexts (catalog + identity), Repositories, Migrations, Identity setup, email sender, logging adapter
• Layer 3: Presentation
a. Web UI (src/Web) – ASP.NET Core MVC + Razor Pages + Identity; renders HTML to users, calls domain services directly via DI
b. Public API (src/PublicApi) – minimal API endpoints exposing catalog, order, auth, user/role management for clients
c. Blazor Admin (src/BlazorAdmin) – WebAssembly SPA, uses shared DTOs (src/BlazorShared) and calls PublicApi over HTTP
• Cross‐cutting:
• Shared client models (src/BlazorShared)
• Service defaults & hosting helpers (src/eShopWeb.AppHost, AspireServiceDefaults)
• Infrastructure as Code in infra: provisioning Azure SQL Databases, Key Vault, App Service plans
Key Architecture Patterns & Principles
• Clean (Onion) Architecture: inner domain layer, outer infrastructure & presentation
• Dependency Injection across layers
• Repository & Specification patterns for data access
• CQRS-style minimal APIs in PublicApi and MediatR-styled handlers in Web features
• Separation of concerns: Web UI vs. Public API vs. Admin UI
• Infrastructure as Code (Bicep) for cloud provisioning
Main Components & Interactions
• Web Browser
• Renders Web UI (MVC/Razor) served by Web app
• Hosts BlazorAdmin SPA under /admin, served by Web app or separate static site pointing to PublicApi
• Web App (ASP.NET Core)
• Hosts MVC/Razor Pages, Identity UI, server‐side controllers/features
• Directly calls ApplicationCore services & Infrastructure repositories
• Connects to two SQL DBs: CatalogContext and AppIdentityDbContext
• PublicApi App (ASP.NET Core minimal API)
• Exposes JSON endpoints for catalog, orders, users, roles, auth
• Calls same ApplicationCore & Infrastructure layers via DI
• BlazorAdmin (WebAssembly)
• Hosted in browser, calls PublicApi over HTTPS for data & auth
• Uses shared DTOs (BlazorShared)
• Domain & Infrastructure
• ApplicationCore defines domain model, interfaces
• Infrastructure implements data persistence, identity, email, logging
• Azure Resources (via infra/*.bicep)
• Azure SQL Servers & Databases
• App Service plans & Web Apps for Web & PublicApi
• Key Vault for connection string secrets
• Local Dev
• Docker Compose spins up Web, PublicApi, SQL containers
• DevContainers for code and docs
Checklist
• Labels on every component (e.g., “src/Web: ASP.NET Core MVC”)
• “Shared Domain + Infra” central to both Web & API
• External services: Azure Key Vault, Azure SQL, App Service