# hackerspacemumbai/visage architecture

> Architecture diagram of the GitHub repository hackerspacemumbai/visage, 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/hackerspacemumbai/visage
- Repository: https://github.com/hackerspacemumbai/visage

## Overview

##### Project Type and Purpose
- Visage is a full-stack .NET solution for managing meetup registrations and check-ins, built with a microservices approach.
- It uses Aspire as the core framework, Blazor Hybrid for UIs (web, mobile, desktop), minimal HTTP APIs, EF Core for data access, and Azure Open AI for AI capabilities.
- It also includes a Node.js microservice for Cloudinary image signing.

##### Main Components
a. Frontends
- Blazor Hybrid Web (Web.Client, Web server-hosted)
- .NET MAUI mobile/desktop app (Android, iOS, MacCatalyst, Tizen, Windows)
- Shared component library (Visage.FrontEnd.Shared) used by all UIs
b. API Host
- Visage.AppHost – hosts minimal APIs, serves Blazor assets, hosts Node.js extension, applies Aspire DI, configuration, logging
c. Microservices
- Visage.Services.Eventing – event data, exposes minimal HTTP API, writes to EventDB
- Visage.Services.Registrations – registrant data, exposes minimal HTTP API, writes to RegistrantDB
- CloudinaryImageSigning (Node.js) – signs image upload parameters for front-end
d. Data Stores
- SQL-based EventDB (Eventing service)
- SQL-based RegistrantDB (Registration service)
e. External Services / Cloud
- Azure Open AI – NLP, AI services invoked by Aspire AI extensions
- Azure Container Apps (each microservice & AppHost containerized via Docker/Podman)
- Azure Monitor & Application Insights – monitoring and logging
- Cloudinary – media storage (via signed upload)
- (Optionally) Azure SQL or Cosmos DB for persistence

##### Relationships & Interactions
- UIs ▶ (HTTPS) ▶ AppHost minimal API endpoints (Aspire).
- AppHost ▶ (HTTP) ▶ internal microservices (Eventing, Registrations).
- UIs ▶ (HTTP) ▶ CloudinarySigning service (to get upload signatures).
- Microservices ▶ (EF Core) ▶ respective databases.
- AppHost / services ▶ (Azure SDK) ▶ Azure Open AI for NLP tasks.
- All containers ▶ (Azure Container Apps) ▶ deployed in Azure with environment variables and secrets.

##### Architectural Patterns & Principles
- Microservices: each bounded context (events, registrations, image signing) is its own service.
- Minimal APIs: lightweight HTTP endpoints, documented via Scalar OpenAPI and tested via .http files.
- Aspire Framework: centralized DI, configuration management, logging, resilience.
- Blazor Hybrid: share C# code across web and native clients.
- Containerization: Dockerized services for consistency across dev, CI, and production.
- Cloud-native: Azure services for AI, monitoring, and container hosting.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Top layer: User Interfaces
    subgraph "User Interfaces" 
        direction TB
        WebClient["Blazor Hybrid Web Client"]:::frontend
        WebServer["Blazor Web (server-hosted)"]:::frontend
        MAUI[".NET MAUI Mobile/Desktop App"]:::frontend
        SharedUI["Shared UI Library"]:::frontend
    end

    %% Middle layer: AppHost
    AppHost["Visage.AppHost"]:::service

    %% Lower layer: Microservices
    subgraph "Microservices"
        direction TB
        Eventing["Visage.Services.Eventing"]:::service
        Registrations["Visage.Services.Registrations"]:::service
        Cloudinary["Cloudinary Image Signing (Node.js)"]:::service
    end

    %% Bottom layer: Data Stores & External Services
    subgraph "Data Stores & External"
        direction TB
        EventDB["EventDB (SQL)"]:::db
        RegistrantDB["RegistrantDB (SQL)"]:::db
        AzureAI["Azure Open AI"]:::cloud
        AzureContainer["Azure Container Apps"]:::cloud
        Insights["Azure Monitor & App Insights"]:::cloud
        CloudinaryStorage["Cloudinary"]:::cloud
    end

    %% Connections
    WebClient -->|"HTTPS/REST"| AppHost
    WebServer -->|"HTTPS/REST"| AppHost
    MAUI -->|"HTTPS/REST"| AppHost
    WebClient -->|"HTTPS/REST"| Cloudinary
    WebServer -->|"HTTPS/REST"| Cloudinary
    MAUI -->|"HTTPS/REST"| Cloudinary

    AppHost -->|"HTTP/REST"| Eventing
    AppHost -->|"HTTP/REST"| Registrations
    AppHost -->|"Node Hosting Extension"| Cloudinary

    Eventing -->|"EF Core"| EventDB
    Registrations -->|"EF Core"| RegistrantDB

    AppHost -->|"Azure SDK"| AzureAI
    Eventing -->|"Azure SDK"| AzureAI
    Registrations -->|"Azure SDK"| AzureAI

    AppHost ---|"Containerized"| AzureContainer
    Eventing ---|"Containerized"| AzureContainer
    Registrations ---|"Containerized"| AzureContainer
    Cloudinary ---|"Containerized"| AzureContainer

    AppHost -->|"Monitoring"| Insights
    Eventing -->|"Monitoring"| Insights
    Registrations -->|"Monitoring"| Insights
    Cloudinary -->|"Monitoring"| Insights

    Cloudinary -->|"Media Storage"| CloudinaryStorage

    %% Dependencies
    WebClient --> SharedUI
    WebServer --> SharedUI
    MAUI --> SharedUI

    %% Legend
    subgraph Legend
        direction LR
        F["Rectangles: Frontend"]:::frontend
        S["Rounded: Services"]:::service
        D["Cylinders: Databases"]:::db
        C["Cloud: External Services"]:::cloud
    end

    %% Click Events
    click WebClient "https://github.com/hackerspacemumbai/visage/blob/main/Visage.FrontEnd/Visage.FrontEnd.Web.Client"
    click WebServer "https://github.com/hackerspacemumbai/visage/blob/main/Visage.FrontEnd/Visage.FrontEnd.Web"
    click MAUI "https://github.com/hackerspacemumbai/visage/blob/main/Visage.FrontEnd/Visage.FrontEnd"
    click SharedUI "https://github.com/hackerspacemumbai/visage/blob/main/Visage.FrontEnd/Visage.FrontEnd.Shared"
    click AppHost "https://github.com/hackerspacemumbai/visage/blob/main/Visage.AppHost"
    click Eventing "https://github.com/hackerspacemumbai/visage/blob/main/services/Visage.Services.Eventing"
    click Registrations "https://github.com/hackerspacemumbai/visage/blob/main/services/Visage.Services.Registrations"
    click Cloudinary "https://github.com/hackerspacemumbai/visage/tree/main/services/CloudinaryImageSigning"

    %% Styles
    classDef frontend fill:#D0E6FF,stroke:#0366d6,stroke-width:2px
    classDef service fill:#DFFFE0,stroke:#28a745,stroke-width:2px,rx:10,ry:10
    classDef db fill:#FFE5B4,stroke:#d16914,stroke-width:2px
    classDef cloud fill:#E6DAFF,stroke:#6f42c1,stroke-width:2px,shape:cloud
```
