# azure-samples/dotnet-frontend-to-backend-with-dapr-on-azure-container-apps architecture

> Architecture diagram of the GitHub repository azure-samples/dotnet-frontend-to-backend-with-dapr-on-azure-container-apps, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azure-samples/dotnet-frontend-to-backend-with-dapr-on-azure-container-apps
- Repository: https://github.com/azure-samples/dotnet-frontend-to-backend-with-dapr-on-azure-container-apps

## Overview

##### Project type and purpose
- This is a cloud-native full-stack application built with ASP.NET Core 6.0
- It consists of a Blazor Server front-end (“Store”) and two minimal back-end microservices (Products API and Inventory API)
- It is deployed to Azure Container Apps, with infrastructure defined in Bicep and CI/CD managed by GitHub Actions

##### File structure
- Top-level “Store” folder contains the Blazor Server UI (Program.cs, App.razor, Pages, Shared, wwwroot)
- “Store.ProductApi” and “Store.InventoryApi” are two separate minimal API projects, each with a Program.cs, Dockerfile, appsettings, and .csproj
- “Azure” folder contains Bicep templates (container_app.bicep, environment.bicep, main.bicep) used to provision Azure Container Apps Environment, container apps, ACR, Log Analytics, Application Insights
- GitHub Actions workflow under .github/workflows/deploy.yml defines the CI/CD pipeline (provision, build, deploy phases)
- Monitoring folder holds instrumentation code for Application Insights

##### README for additional insights
- Confirms the front-end uses Blazor Server to display product names (from Products API) and inventory counts (from Inventory API)
- Back-end APIs are internal-only (no public ingress) and are called by the server-side Blazor code

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User
    U["User's Browser"]:::user

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        direction TB
        GH["GitHub Actions"]:::cicd
        ACR["Azure Container Registry (ACR)"]:::infra
        Bicep["Azure Bicep (IaC)"]:::infra
    end

    %% Monitoring
    Monitoring["Application Insights & Log Analytics"]:::monitoring

    %% Container Apps Environment Boundary
    subgraph "Azure Container Apps Environment" 
        direction TB
        Store["Store (Blazor Server)"]:::frontend
        Products["Products API (Minimal API)"]:::api
        Inventory["Inventory API (Minimal API)"]:::api
    end

    %% Data Flows
    U -->|"HTTPS (public ingress)"| Store
    Store -->|"Internal HTTP"| Products
    Store -->|"Internal HTTP"| Inventory

    GH -->|"Build & Push Images"| ACR
    GH -->|"Deploy via Bicep"| Bicep
    Bicep -->|"Provision & Deploy Containers"| Store
    Bicep -->|"Provision & Deploy Containers"| Products
    Bicep -->|"Provision & Deploy Containers"| Inventory

    Store -->|"Telemetry"| Monitoring
    Products -->|"Telemetry"| Monitoring
    Inventory -->|"Telemetry"| Monitoring

    %% Click Events
    click Store "https://github.com/azure-samples/dotnet-frontend-to-backend-with-dapr-on-azure-container-apps/tree/main/Store/"
    click Products "https://github.com/azure-samples/dotnet-frontend-to-backend-with-dapr-on-azure-container-apps/tree/main/Store.ProductApi/"
    click Inventory "https://github.com/azure-samples/dotnet-frontend-to-backend-with-dapr-on-azure-container-apps/tree/main/Store.InventoryApi/"
    click GH "https://github.com/azure-samples/dotnet-frontend-to-backend-with-dapr-on-azure-container-apps/blob/main/.github/workflows/deploy.yml"
    click Bicep "https://github.com/azure-samples/dotnet-frontend-to-backend-with-dapr-on-azure-container-apps/tree/main/Azure/"
    click Monitoring "https://github.com/azure-samples/dotnet-frontend-to-backend-with-dapr-on-azure-container-apps/tree/main/Monitoring/"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef api fill:#90EE90,stroke:#000,stroke-width:1px
    classDef infra fill:#FFA500,stroke:#000,stroke-width:1px
    classDef cicd fill:#FFB6C1,stroke:#000,stroke-width:1px
    classDef monitoring fill:#FFFFE0,stroke:#000,stroke-width:1px
    classDef user fill:#D3D3D3,stroke:#000,stroke-width:1px
```
