# solidarityhub-organization/solidarityhub architecture

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

- Interactive diagram: https://gitdiagram.com/solidarityhub-organization/solidarityhub
- Repository: https://github.com/solidarityhub-organization/solidarityhub

## Overview

##### Project type and purpose
- This is a full-stack emergency-management application named SolidarityHub.
- Frontend: Flutter apps targeting mobile (App/), desktop (Desktop/), web, Linux, macOS, Windows, and iOS.
- Backend: ASP.NET Core Web API (“LogicPersistence.Api”) with Entity Framework Core migrations, layered into Controllers → Services → Repositories → Database.

##### File structure
- Frontend “App/” and “Desktop/” share a Flutter-style layout:
- lib/controllers, models, services, interface/screens, widgets → UI and business-logic layers.
- Platform folders (android/, ios/, linux/, macos/, windows/, web/) contain build configurations and native bootstrap code.
- Backend “Backend/LogicPersistence/LogicPersistence.Api/”:
- Controllers/ expose REST endpoints.
- Services/ contain business logic and Observer-pattern notifications.
- Repositories/ (and Interfaces/) abstract data persistence via EF Core.
- Models/ domain entities, DTOs, mappers, intermediate models.
- Migrations/ define database schema evolution.
- appsettings.json, Docker-compose in Backend/ for Postgres container.

##### Additional insights from README
- Frontend connects to backend via HTTP to Postgres-backed API.
- Docker-compose is used to spin up Postgres for development.
- Environment variables (.env.development) hold database credentials.

##### Detail
- ObserverPattern sub-component under Services for notifications.
- Migrations path and configuration files (appsettings.json, Docker-compose.yml).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend - Mobile/Tablet App" 
        direction TB
        MCtrl["Controllers"]:::frontend
        MModels["Models"]:::frontend
        MInterface["Interface & Widgets"]:::frontend
        MServices["Services"]:::frontend
    end
    subgraph "Frontend - Desktop App"
        direction TB
        DCtrl["Controllers"]:::frontend
        DModels["Models"]:::frontend
        DScreens["Screens"]:::frontend
        DServices["Services"]:::frontend
        DUtils["Utilities"]:::frontend
        DWidgets["Widgets"]:::frontend
    end
    subgraph "Frontend - Web App"
        Web["Static Assets & Entry"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend - ASP.NET Core API"
        direction TB
        subgraph "API Layer (Controllers)"
            Controllers["Controllers"]:::backend
        end
        subgraph "Business Layer (Services)"
            CoreServices["Services"]:::backend
            ServiceInterfaces["Service Interfaces"]:::backend
            Observer["ObserverPattern"]:::backend
        end
        subgraph "Data Persistence (Repositories)"
            Repos["Repositories"]:::backend
            RepoInterfaces["Repository Interfaces"]:::backend
            Migrations["EF Core Migrations"]:::backend
        end
        subgraph "Domain & DTO Models"
            DomainModels["Domain Entities & Builders"]:::backend
            DTOs["DTOs"]:::backend
            InterModels["Intermediate Models"]:::backend
        end
        Mappers["Data Mappers"]:::backend
        Strategies["Strategies"]:::backend
        subgraph "Configuration & Startup"
            AppSettings["appsettings.json"]:::backend
            ProgramCS["Program.cs"]:::backend
            LaunchSettings["launchSettings.json"]:::backend
            Solution[".sln & .csproj"]:::backend
        end
    end

    %% Database & Containers
    Postgres["PostgreSQL (Docker)"]:::database
    DockerCompose["docker-compose.yml"]:::backend

    %% External Services
    GeoAPI["Geolocation/Map APIs"]:::external
    NotifyAPI["Notification Channels"]:::external

    %% Connections
    MInterface -->|HTTP Request| Controllers
    DServices -->|HTTP Request| Controllers
    Web -->|HTTP Request| Controllers
    Controllers -->|Invoke| CoreServices
    CoreServices -->|Use| Repos
    Repos -->|SQL Query| Postgres
    CoreServices -->|Notify| Observer
    Observer -->|Event| NotifyAPI
    CoreServices -->|Map Data| GeoAPI
    DockerCompose -->|Launch| Postgres

    %% Click Events - Frontend Mobile
    click MCtrl "https://github.com/solidarityhub-organization/solidarityhub/tree/main/App/lib/controllers/"
    click MModels "https://github.com/solidarityhub-organization/solidarityhub/tree/main/App/lib/models/"
    click MInterface "https://github.com/solidarityhub-organization/solidarityhub/tree/main/App/lib/interface/"
    click MServices "https://github.com/solidarityhub-organization/solidarityhub/tree/main/App/lib/services/"
    click MInterface "https://github.com/solidarityhub-organization/solidarityhub/tree/main/App/lib/widgets/"
    click MInterface "https://github.com/solidarityhub-organization/solidarityhub/tree/main/App/web/"
    click MCtrl "https://github.com/solidarityhub-organization/solidarityhub/tree/main/App/android/"
    click MCtrl "https://github.com/solidarityhub-organization/solidarityhub/tree/main/App/ios/"
    click MCtrl "https://github.com/solidarityhub-organization/solidarityhub/tree/main/App/linux/"
    click MCtrl "https://github.com/solidarityhub-organization/solidarityhub/tree/main/App/macos/"
    click MCtrl "https://github.com/solidarityhub-organization/solidarityhub/tree/main/App/windows/"

    %% Click Events - Frontend Desktop
    click DCtrl "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Desktop/lib/controllers/"
    click DModels "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Desktop/lib/models/"
    click DScreens "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Desktop/lib/screens/"
    click DServices "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Desktop/lib/services/"
    click DUtils "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Desktop/lib/utils/"
    click DWidgets "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Desktop/lib/widgets/"
    click DServices "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Desktop/android/"
    click DServices "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Desktop/ios/"
    click DServices "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Desktop/linux/"
    click DServices "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Desktop/macos/"
    click DServices "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Desktop/windows/"

    %% Click Events - Backend
    click Controllers "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Backend/LogicPersistence/LogicPersistence.Api/Controllers/"
    click CoreServices "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Backend/LogicPersistence/LogicPersistence.Api/Services/"
    click ServiceInterfaces "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Backend/LogicPersistence/LogicPersistence.Api/Services/Interfaces/"
    click Observer "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Backend/LogicPersistence/LogicPersistence.Api/Services/ObserverPattern/"
    click Repos "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Backend/LogicPersistence/LogicPersistence.Api/Repositories/"
    click RepoInterfaces "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Backend/LogicPersistence/LogicPersistence.Api/Repositories/Interfaces/"
    click Migrations "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Backend/LogicPersistence/LogicPersistence.Api/Migrations/"
    click DomainModels "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Backend/LogicPersistence/LogicPersistence.Api/Models/"
    click DTOs "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Backend/LogicPersistence/LogicPersistence.Api/Models/DTOs/"
    click InterModels "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Backend/LogicPersistence/LogicPersistence.Api/Models/IntermediateModels/"
    click Mappers "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Backend/LogicPersistence/LogicPersistence.Api/Mappers/"
    click Strategies "https://github.com/solidarityhub-organization/solidarityhub/tree/main/Backend/LogicPersistence/LogicPersistence.Api/Strategies/"
    click AppSettings "https://github.com/solidarityhub-organization/solidarityhub/blob/main/Backend/LogicPersistence/LogicPersistence.Api/appsettings.json"
    click ProgramCS "https://github.com/solidarityhub-organization/solidarityhub/blob/main/Backend/LogicPersistence/LogicPersistence.Api/Program.cs"
    click LaunchSettings "https://github.com/solidarityhub-organization/solidarityhub/blob/main/Backend/LogicPersistence/LogicPersistence.Api/Properties/launchSettings.json"
    click Solution "https://github.com/solidarityhub-organization/solidarityhub/blob/main/Backend/LogicPersistence/LogicPersistence.Api/LogicPersistence.Api.sln"
    click DockerCompose "https://github.com/solidarityhub-organization/solidarityhub/blob/main/Backend/docker-compose.yml"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0094FF,stroke-width:1px
    classDef backend fill:#DFF8D8,stroke:#28A745,stroke-width:1px
    classDef database fill:#FFE9B3,stroke:#FF9900,stroke-width:1px
    classDef external fill:#E0E0E0,stroke:#666666,stroke-width:1px
```
