# tsinis/sealed_world architecture

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

- Interactive diagram: https://gitdiagram.com/tsinis/sealed_world
- Repository: https://github.com/tsinis/sealed_world

## Overview

##### Project type and purpose
- This is a multi‐package monorepo (a Dart/Flutter “ecosystem”) providing compile‐time, tree‐shakable libraries for world data: languages, currencies, countries, plus localization maps and Flutter UI pickers/flags.
- Core packages (“sealed_*”) supply sealed‐class models, l10n packages (“l10n_*”) supply localized name maps, and Flutter packages (“world_*”) build on the core to provide widgets and painters.

##### File structure
- Top‐level folders:
- packages/ – contains all pub packages (sealed_languages, sealed_currencies, sealed_countries, l10n_* packages, world_flags, world_countries, world_countries example).
- tools/ – code-generation scripts and utilities.
- .github/, .devcontainer/, workflows – CI/CD and developer environment.
- Architectural layers:
- Layer 1 (Core models): sealed_languages → sealed_currencies → sealed_countries
- Layer 2 (Localization): l10n_languages → l10n_currencies → l10n_countries
- Layer 3 (Flutter UI): world_flags → world_countries (with example apps)
- Each package follows a standard Dart package layout: lib/src, data, model, translations, tests, examples.

##### Key insights from README
- Emphasis on ISO-driven, tree-shakable const classes, heavy test coverage, semantic versioning, and CI pipelines.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Monorepo Root: Tools & CI
    subgraph "Tools & CI"
        direction TB
        Tools["Code Generation Tools"]:::tools
        GitHubWorkflows["GitHub Actions Workflows"]:::ci
        DevContainer["Devcontainer"]:::tools
        Pubspecs["Pubspecs"]:::config
    end

    %% Core Sealed Packages (Layer 1)
    subgraph "Core Sealed Packages" 
        direction TB
        SL["sealed_languages"]:::core
        SCu["sealed_currencies"]:::core
        SC["sealed_countries"]:::core
    end

    %% Localization Packages (Layer 2)
    subgraph "Localization Packages"
        direction TB
        LL["l10n_languages"]:::l10n
        LCu["l10n_currencies"]:::l10n
        LC["l10n_countries"]:::l10n
    end

    %% Flutter UI Packages (Layer 3)
    subgraph "Flutter UI Packages"
        direction TB
        WF["world_flags"]:::ui
        WC["world_countries"]:::ui
    end

    %% Example Applications
    subgraph "Example Applications"
        direction TB
        WFEx["world_flags/example"]:::example
        WCEx["world_countries/example"]:::example
    end

    %% External Services
    subgraph "External Services"
        direction TB
        PubDev["pub.dev"]:::external
    end

    %% Relationships
    Tools -->|codegen| SL
    Tools -->|codegen| LL
    Tools -->|codegen| SCu
    Tools -->|codegen| LCu
    Tools -->|codegen| SC
    Tools -->|codegen| LC

    SL -->|depends on| SCu
    SCu -->|depends on| SC
    SC -->|used by| WF
    WF -->|used by| WC

    LL -->|localizes| SL
    LCu -->|localizes| SCu
    LC -->|localizes| SC

    WFEx -->|demo for| WF
    WCEx -->|demo for| WC

    GitHubWorkflows -->|publish| PubDev

    %% Click Events
    click GitHubWorkflows "https://github.com/tsinis/sealed_world/tree/main/.github/workflows/"
    click DevContainer "https://github.com/tsinis/sealed_world/tree/main/.devcontainer/"
    click Tools "https://github.com/tsinis/sealed_world/tree/main/tools/"
    click SL "https://github.com/tsinis/sealed_world/tree/main/packages/sealed_languages/"
    click SCu "https://github.com/tsinis/sealed_world/tree/main/packages/sealed_currencies/"
    click SC "https://github.com/tsinis/sealed_world/tree/main/packages/sealed_countries/"
    click LL "https://github.com/tsinis/sealed_world/tree/main/packages/l10n_languages/"
    click LCu "https://github.com/tsinis/sealed_world/tree/main/packages/l10n_currencies/"
    click LC "https://github.com/tsinis/sealed_world/tree/main/packages/l10n_countries/"
    click WF "https://github.com/tsinis/sealed_world/tree/main/packages/world_flags/"
    click WC "https://github.com/tsinis/sealed_world/tree/main/packages/world_countries/"
    click WFEx "https://github.com/tsinis/sealed_world/tree/main/packages/world_flags/example/"
    click WCEx "https://github.com/tsinis/sealed_world/tree/main/packages/world_countries/example/"
    click Pubspecs "https://github.com/tsinis/sealed_world/blob/main/pubspec.yaml"

    %% Styles
    classDef core fill:#D0E8FF,stroke:#0066CC,stroke-width:2px;
    classDef l10n fill:#B3FFF2,stroke:#00CC99,stroke-width:2px;
    classDef ui fill:#99CCFF,stroke:#003399,stroke-width:2px;
    classDef tools fill:#EEEEEE,stroke:#777777,stroke-width:2px;
    classDef ci fill:#DDDDDD,stroke:#555555,stroke-width:2px,stroke-dasharray: 5 5;
    classDef example fill:#FFF2CC,stroke:#CC9900,stroke-width:2px;
    classDef external fill:#F5F5F5,stroke:#888888,stroke-width:2px,stroke-dasharray: 2 2;
    classDef config fill:#EFEFEF,stroke:#666666,stroke-width:2px;
```
