# cassidyjames/dippi architecture

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

- Interactive diagram: https://gitdiagram.com/cassidyjames/dippi
- Repository: https://github.com/cassidyjames/dippi

## Overview

#### Purpose and Runtime
Dippi is a local GNOME desktop utility that calculates display characteristics—DPI, aspect ratio, logical resolution, and density guidance—from user-entered display dimensions and resolution. It is a Vala application using GTK and libadwaita, intended primarily for Flatpak/Flathub distribution.

Core entry points:
- `src/App.vala` — application lifecycle and startup.
- `src/MainWindow.vala` — primary interactive window and calculation-driven UI.
- `src/dippi.blp` — Blueprint UI definition.

#### Application Shell and UI Composition
The application object initializes the GNOME/Adwaita app and presents the main window. UI structure is declared separately in Blueprint and consumed by Vala window code, separating layout/resource definitions from input handling and presentation logic.

Key paths:
- `src/App.vala`
- `src/MainWindow.vala`
- `src/dippi.blp`

#### Display-Analysis Flow
The central flow is user input → validation/normalization → display-metric calculations → density classification/advice → reactive UI updates. The window is the orchestration boundary: it captures physical-size and pixel-resolution inputs, invokes calculation utilities, and maps results into labels, recommendations, and visual state.

Calculation/domain support is concentrated in:
- `src/MainWindow.vala`
- `src/Utils.vala`

#### Configuration and Identity
Build-time application constants, such as application identity and installed resource locations, are generated from a template. This isolates environment-specific values from application logic and supports installed/Flatpak execution.

Key paths:
- `src/Config.vala.in`
- `meson.build`
- `com.cassidyjames.dippi.json`

#### Resources, Styling, and Desktop Integration
UI assets are bundled as a GResource, allowing the executable to load its Blueprint/UI-related resources, CSS, and icons through stable resource paths. Desktop metadata provides launcher and app-store integration; AppStream metadata supplies product information and screenshots.

Key paths:
- `data/gresource.xml`
- `data/styles/style.css`
- `data/launcher.desktop.in`
- `data/metainfo.appdata.xml.in`

#### Build and Distribution Boundary
Meson is the source build orchestrator, including the application, data resources, and translations. The Flatpak manifest defines the sandboxed runtime/build environment used for distribution through Flathub. There is no backend, database, or network-dependent application service evident; calculations run locally.

Key paths:
- `meson.build`
- `data/meson.build`
- `com.cassidyjames.dippi.json`
- `.github/workflows/flatpak.yml`

#### Localization Pipeline
User-facing strings are translated through gettext catalogs. The primary `po/` catalog set covers application strings, while `po/extra/` holds a second translation domain/catalog set. Meson integrates these catalogs during builds, making localization an application-wide presentation boundary.

Key paths:
- `po/meson.build`
- `po/LINGUAS`
- `po/extra/meson.build`

Main entry points: [`meson.build`](https://github.com/cassidyjames/dippi/blob/main/meson.build) (Meson build), [`src/MainWindow.vala`](https://github.com/cassidyjames/dippi/blob/main/src/MainWindow.vala) (Main window), [`data/meson.build`](https://github.com/cassidyjames/dippi/blob/main/data/meson.build) (Data build rules), [`data/gresource.xml`](https://github.com/cassidyjames/dippi/blob/main/data/gresource.xml) (GResource bundle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["GNOME Application"]
  node_app_entry["Application lifecycle<br/>Vala entry point<br/>[App.vala]"]
  node_main_window["Main window<br/>UI orchestrator<br/>[MainWindow.vala]"]
  node_blueprint_ui["Blueprint UI<br/>layout definition<br/>[dippi.blp]"]
  node_display_inputs["Display inputs<br/>physical size and pixels<br/>[MainWindow.vala]"]
  node_calculation_utils["Display metrics<br/>calculation utilities<br/>[Utils.vala]"]
  node_ui_results["Results and advice<br/>reactive presentation<br/>[MainWindow.vala]"]
end

subgraph group_resources["Resources &amp; Integration"]
  node_gresource["GResource bundle<br/>compiled resources<br/>[gresource.xml]"]
  node_stylesheet["Application styling<br/>CSS<br/>[style.css]"]
  node_desktop_launcher["Desktop launcher<br/>desktop metadata"]
  node_appstream["AppStream metadata<br/>store metadata"]
end

subgraph group_build["Build &amp; Distribution"]
  node_config_template["Generated app constants<br/>configuration template<br/>[Config.vala.in]"]
  node_meson_root{{"Meson build<br/>build orchestrator<br/>[meson.build]"}}
  node_data_build["Data build rules<br/>Meson subproject rules<br/>[meson.build]"]
  node_flatpak_manifest["Flatpak manifest<br/>distribution environment"]
  node_flatpak_ci["Flatpak CI<br/>GitHub Actions workflow<br/>[flatpak.yml]"]
end

subgraph group_i18n["Localization"]
  node_translations["Application catalogs<br/>gettext translations<br/>[meson.build]"]
  node_linguas["Supported languages<br/>locale list"]
  node_extra_translations["Extra catalog domain<br/>gettext translations<br/>[meson.build]"]
end

node_app_entry -->|"presents"| node_main_window
node_main_window -->|"binds layout"| node_blueprint_ui
node_main_window -->|"captures"| node_display_inputs
node_display_inputs -->|"validates and normalizes"| node_calculation_utils
node_calculation_utils -->|"metrics and guidance"| node_ui_results
node_main_window -->|"updates"| node_ui_results
node_config_template -->|"generated constants"| node_app_entry
node_gresource -->|"packages"| node_blueprint_ui
node_gresource -->|"includes"| node_stylesheet
node_meson_root -->|"generates"| node_config_template
node_meson_root -->|"includes"| node_data_build
node_data_build -->|"builds"| node_gresource
node_data_build -->|"installs"| node_desktop_launcher
node_data_build -->|"installs"| node_appstream
node_meson_root -->|"integrates"| node_translations
node_translations -->|"uses"| node_linguas
node_meson_root -->|"integrates"| node_extra_translations
node_flatpak_manifest -->|"builds with"| node_meson_root
node_flatpak_ci -->|"builds"| node_flatpak_manifest

click node_app_entry "https://github.com/cassidyjames/dippi/blob/main/src/App.vala"
click node_main_window "https://github.com/cassidyjames/dippi/blob/main/src/MainWindow.vala"
click node_blueprint_ui "https://github.com/cassidyjames/dippi/blob/main/src/dippi.blp"
click node_display_inputs "https://github.com/cassidyjames/dippi/blob/main/src/MainWindow.vala"
click node_calculation_utils "https://github.com/cassidyjames/dippi/blob/main/src/Utils.vala"
click node_ui_results "https://github.com/cassidyjames/dippi/blob/main/src/MainWindow.vala"
click node_config_template "https://github.com/cassidyjames/dippi/blob/main/src/Config.vala.in"
click node_gresource "https://github.com/cassidyjames/dippi/blob/main/data/gresource.xml"
click node_stylesheet "https://github.com/cassidyjames/dippi/blob/main/data/styles/style.css"
click node_desktop_launcher "https://github.com/cassidyjames/dippi/blob/main/data/launcher.desktop.in"
click node_appstream "https://github.com/cassidyjames/dippi/blob/main/data/metainfo.appdata.xml.in"
click node_meson_root "https://github.com/cassidyjames/dippi/blob/main/meson.build"
click node_data_build "https://github.com/cassidyjames/dippi/blob/main/data/meson.build"
click node_flatpak_manifest "https://github.com/cassidyjames/dippi/blob/main/com.cassidyjames.dippi.json"
click node_flatpak_ci "https://github.com/cassidyjames/dippi/blob/main/.github/workflows/flatpak.yml"
click node_translations "https://github.com/cassidyjames/dippi/blob/main/po/meson.build"
click node_linguas "https://github.com/cassidyjames/dippi/blob/main/po/LINGUAS"
click node_extra_translations "https://github.com/cassidyjames/dippi/blob/main/po/extra/meson.build"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_entry,node_main_window,node_blueprint_ui,node_display_inputs,node_calculation_utils,node_ui_results toneBlue
class node_gresource,node_stylesheet,node_desktop_launcher,node_appstream toneAmber
class node_config_template,node_meson_root,node_data_build,node_flatpak_manifest,node_flatpak_ci toneMint
class node_translations,node_linguas,node_extra_translations toneRose
```

## Components

### GNOME Application

- [Application lifecycle](https://github.com/cassidyjames/dippi/blob/main/src/App.vala): Vala entry point · Initializes the Adwaita application and presents the main window. · `src/App.vala`
- [Main window](https://github.com/cassidyjames/dippi/blob/main/src/MainWindow.vala): UI orchestrator · Coordinates input, calculations, and reactive presentation. · `src/MainWindow.vala`
- [Blueprint UI](https://github.com/cassidyjames/dippi/blob/main/src/dippi.blp): layout definition · `src/dippi.blp`
- [Display inputs](https://github.com/cassidyjames/dippi/blob/main/src/MainWindow.vala): physical size and pixels · `src/MainWindow.vala`
- [Display metrics](https://github.com/cassidyjames/dippi/blob/main/src/Utils.vala): calculation utilities · Calculates DPI, aspect ratio, logical resolution, and density guidance. · `src/Utils.vala`
- [Results and advice](https://github.com/cassidyjames/dippi/blob/main/src/MainWindow.vala): reactive presentation · `src/MainWindow.vala`

### Resources & Integration

- [GResource bundle](https://github.com/cassidyjames/dippi/blob/main/data/gresource.xml): compiled resources · Bundles UI assets for stable runtime resource loading. · `data/gresource.xml`
- [Application styling](https://github.com/cassidyjames/dippi/blob/main/data/styles/style.css): CSS · `data/styles/style.css`
- [Desktop launcher](https://github.com/cassidyjames/dippi/blob/main/data/launcher.desktop.in): desktop metadata · `data/launcher.desktop.in`
- [AppStream metadata](https://github.com/cassidyjames/dippi/blob/main/data/metainfo.appdata.xml.in): store metadata · `data/metainfo.appdata.xml.in`

### Build & Distribution

- [Generated app constants](https://github.com/cassidyjames/dippi/blob/main/src/Config.vala.in): configuration template · Provides application identity and installed resource locations. · `src/Config.vala.in`
- [Meson build](https://github.com/cassidyjames/dippi/blob/main/meson.build): build orchestrator · Builds the application and includes data and translations. · `meson.build`
- [Data build rules](https://github.com/cassidyjames/dippi/blob/main/data/meson.build): Meson subproject rules · `data/meson.build`
- [Flatpak manifest](https://github.com/cassidyjames/dippi/blob/main/com.cassidyjames.dippi.json): distribution environment · Defines the sandboxed build and runtime for Flathub distribution. · `com.cassidyjames.dippi.json`
- [Flatpak CI](https://github.com/cassidyjames/dippi/blob/main/.github/workflows/flatpak.yml): GitHub Actions workflow · `.github/workflows/flatpak.yml`

### Localization

- [Application catalogs](https://github.com/cassidyjames/dippi/blob/main/po/meson.build): gettext translations · Translates application-facing strings. · `po/meson.build`
- [Supported languages](https://github.com/cassidyjames/dippi/blob/main/po/LINGUAS): locale list · `po/LINGUAS`
- [Extra catalog domain](https://github.com/cassidyjames/dippi/blob/main/po/extra/meson.build): gettext translations · `po/extra/meson.build`

## Connections

- Application lifecycle → Main window: presents
- Main window → Blueprint UI: binds layout
- Main window → Display inputs: captures
- Display inputs → Display metrics: validates and normalizes
- Display metrics → Results and advice: metrics and guidance
- Main window → Results and advice: updates
- Generated app constants → Application lifecycle: generated constants
- GResource bundle → Blueprint UI: packages
- GResource bundle → Application styling: includes
- Meson build → Generated app constants: generates
- Meson build → Data build rules: includes
- Data build rules → GResource bundle: builds
- Data build rules → Desktop launcher: installs
- Data build rules → AppStream metadata: installs
- Meson build → Application catalogs: integrates
- Application catalogs → Supported languages: uses
- Meson build → Extra catalog domain: integrates
- Flatpak manifest → Meson build: builds with
- Flatpak CI → Flatpak manifest: builds
