# fiodarsazanavets/dotnet-aspire-examples architecture

> Architecture diagram of the GitHub repository fiodarsazanavets/dotnet-aspire-examples, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fiodarsazanavets/dotnet-aspire-examples
- Repository: https://github.com/fiodarsazanavets/dotnet-aspire-examples

## Overview

##### Project type and purpose
- This repository is a collection of .NET Aspire sample applications (full-stack examples) demonstrating common ASP.NET Core/Blazor, API service, shared library and deployment patterns.
- It serves as companion code for the book “.NET Aspire Made Easy,” illustrating how to structure and deploy modern .NET micro-frontends and microservices.

##### File structure
- Top-level folders group individual sample solutions (e.g., AppSamples/FoodDelivery, AspireStarterProject, AspireScaleoutAndDeployment, AspireWithSso, etc.).
- Each sample follows a consistent pattern with four main projects:
– ApiService: REST or real-time back-end (e.g., FoodDelivery.ApiService).
– Web: Blazor front-end (e.g., FoodDelivery.Web).
– ServiceDefaults: shared DTOs, extensions and constants.
– AppHost: orchestrates containerization/Kubernetes manifests for deployment.
- Additional samples add specific infrastructure concerns (e.g., Cosmos bootstrapper, Blob Storage, Redis cache, RabbitMQ, Keycloak SSO, OpenIdConnectProvider).
- Solution files (.sln) bind each set of four (plus any extra) projects into a single deployable unit.

##### Key insights from the README
- The README confirms these are example projects used in a Manning book.

## Diagram (Mermaid)

```mermaid
flowchart TB
  %% FoodDelivery Sample
  subgraph "FoodDelivery Sample"
    direction TB
    FDWeb["FoodDelivery.Web (Blazor UI)"]:::frontend
    FDServiceDefaults["FoodDelivery.ServiceDefaults"]:::shared
    FDApi["FoodDelivery.ApiService (ASP.NET Core)"]:::backend
    DB1[(Database/Cache/Queue)]:::infra
    FDAppHost["FoodDelivery.AppHost (Deployment Orchestrator)"]:::orchestrator

    FDWeb -->|"HTTP/SignalR / REST"| FDApi
    FDWeb -->|uses| FDServiceDefaults
    FDApi -->|uses| FDServiceDefaults
    FDApi -->|connects to| DB1
    FDAppHost -->|deploys containers| FDWeb
    FDAppHost -->|deploys containers| FDApi
  end

  %% OnlineStore Sample
  subgraph "OnlineStore Sample"
    direction TB
    OSWeb["OnlineStore.Web (Blazor UI)"]:::frontend
    OSServiceDefaults["OnlineStore.ServiceDefaults"]:::shared
    OSApi["OnlineStore.ApiService (ASP.NET Core)"]:::backend
    DB2[(Database/Cache/Queue)]:::infra
    OSAppHost["OnlineStore.AppHost (Deployment Orchestrator)"]:::orchestrator

    OSWeb -->|"HTTP/SignalR / REST"| OSApi
    OSWeb -->|uses| OSServiceDefaults
    OSApi -->|uses| OSServiceDefaults
    OSApi -->|connects to| DB2
    OSAppHost -->|deploys containers| OSWeb
    OSAppHost -->|deploys containers| OSApi
  end

  %% Restaurant Sample
  subgraph "Restaurant Sample"
    direction TB
    RWeb["Restaurant.Web (Blazor UI)"]:::frontend
    RServiceDefaults["Restaurant.ServiceDefaults"]:::shared
    RAapi["Restaurant.ApiService (ASP.NET Core)"]:::backend
    DB3[(Database/Cache/Queue)]:::infra
    RAppHost["Restaurant.AppHost (Deployment Orchestrator)"]:::orchestrator

    RWeb -->|"HTTP/SignalR / REST"| RAapi
    RWeb -->|uses| RServiceDefaults
    RAapi -->|uses| RServiceDefaults
    RAapi -->|connects to| DB3
    RAppHost -->|deploys containers| RWeb
    RAppHost -->|deploys containers| RAapi
  end

  %% Click Events
  click FDWeb "https://github.com/fiodarsazanavets/dotnet-aspire-examples/blob/main/AppSamples/FoodDelivery/FoodDelivery.Web"
  click FDApi "https://github.com/fiodarsazanavets/dotnet-aspire-examples/blob/main/AppSamples/FoodDelivery/FoodDelivery.ApiService"
  click FDServiceDefaults "https://github.com/fiodarsazanavets/dotnet-aspire-examples/blob/main/AppSamples/FoodDelivery/FoodDelivery.ServiceDefaults"
  click FDAppHost "https://github.com/fiodarsazanavets/dotnet-aspire-examples/blob/main/AppSamples/FoodDelivery/FoodDelivery.AppHost"

  click OSWeb "https://github.com/fiodarsazanavets/dotnet-aspire-examples/blob/main/AppSamples/OnlineStore/OnlineStore.Web"
  click OSApi "https://github.com/fiodarsazanavets/dotnet-aspire-examples/blob/main/AppSamples/OnlineStore/OnlineStore.ApiService"
  click OSServiceDefaults "https://github.com/fiodarsazanavets/dotnet-aspire-examples/blob/main/AppSamples/OnlineStore/OnlineStore.ServiceDefaults"
  click OSAppHost "https://github.com/fiodarsazanavets/dotnet-aspire-examples/blob/main/AppSamples/OnlineStore/OnlineStore.AppHost"

  click RWeb "https://github.com/fiodarsazanavets/dotnet-aspire-examples/blob/main/AppSamples/Restaurant/Restaurant.Web"
  click RAapi "https://github.com/fiodarsazanavets/dotnet-aspire-examples/blob/main/AppSamples/Restaurant/Restaurant.ApiService"
  click RServiceDefaults "https://github.com/fiodarsazanavets/dotnet-aspire-examples/blob/main/AppSamples/Restaurant/Restaurant.ServiceDefaults"
  click RAppHost "https://github.com/fiodarsazanavets/dotnet-aspire-examples/blob/main/AppSamples/Restaurant/Restaurant.AppHost"

  %% Styles
  classDef frontend fill:#dae8fc,stroke:#6c8ebf,color:#0b5394
  classDef backend fill:#d5e8d4,stroke:#82b366,color:#38761d
  classDef shared fill:#ffe6cc,stroke:#e69138,color:#b45f06
  classDef infra fill:#f2f2f2,stroke:#999999,color:#333333
  classDef orchestrator fill:#ebdaf5,stroke:#9673a6,color:#5b0f70
```
