# lawnchairlauncher/lawnicons architecture

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

- Interactive diagram: https://gitdiagram.com/lawnchairlauncher/lawnicons
- Repository: https://github.com/lawnchairlauncher/lawnicons

## Overview

##### File structure
- Top-level “app” module: the Android application
- src/main/kotlin/app/lawnchair/lawnicons/ui      → Compose UI components & themes
- viewmodel  → MVVM ViewModels
- repository & api  → data layer, REST clients (GitHubContributorsAPI, IconRequestSettingsAPI), PreferenceManager
- di  → dependency-injection modules
- model  → domain data classes
- “svg-processor”: Kotlin CLI to consume raw SVGs & appfilter.xml, produce optimized drawables/resources
- CI/CD under .github/workflows: build APKs, optimize SVGs, Crowdin uploads

##### Elements
- Blue rectangles for runtime components (UI, ViewModel, Repository, API)
- Green for local storage
- Orange for external services
- Gray for build tools/scripts and CI/CD

##### Detail
- MVVM layer and data source
- Tooling modules (svg-processor, icontool.py) as separate processes feeding the app

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Android Application
    subgraph "Android App" 
        direction TB
        AA["LawniconsApplication"]:::runtime
        MA["MainActivity"]:::runtime
        UI["Compose UI\n(app/src/.../ui)"]:::runtime
        VM["ViewModels\n(app/src/.../viewmodel)"]:::runtime
        REP["Repositories\n(app/src/.../repository)"]:::runtime
        API["REST API Clients\n(app/src/.../api)"]:::runtime
        PM["PreferenceManager"]:::local
        DI["DI Modules\n(app/src/.../di)"]:::runtime
        MD["Domain Models\n(app/src/.../model)"]:::runtime
    end

    %% External Services
    subgraph "External Services"
        direction TB
        GHAPI["GitHub Contributors API"]:::external
        IRAPI["IconRequestSettings API"]:::external
        CR["Crowdin"]:::external
    end

    %% Tooling Scripts
    subgraph "Tooling"
        direction TB
        SP["svg-processor CLI"]:::scripts
        IT["icontool.py"]:::scripts
        NT["send_notifications.py"]:::scripts
        AF["app/assets/appfilter.xml"]:::scripts
    end

    %% CI/CD
    subgraph "CI/CD Pipelines\n(.github/workflows)" 
        direction TB
        CD1["build_debug_apk.yml"]:::scripts
        CD2["build_release_apk.yml"]:::scripts
        CD3["optimize_svgs.yml"]:::scripts
        CD4["crowdin.yml"]:::scripts
        CD5["crowdin_upload.yml"]:::scripts
        CD6["icon_checklist.yml"]:::scripts
        CD7["close_stale_prs.yml"]:::scripts
        CD8["labeler.yml"]:::scripts
    end

    %% Data & Control Flows
    AA --> MA
    MA --> UI
    UI --> VM
    VM --> REP
    REP --> API
    REP --> PM
    API --> GHAPI
    API --> IRAPI
    UI --> MD
    VM --> MD
    DI --> VM
    DI --> REP

    %% Tooling Relationships
    SP --> AF
    SP --> SP
    SP -.-> AA
    IT -.-> AF
    NT -.-> AA

    %% CI/CD Triggers
    CD1 --> AA
    CD2 --> AA
    CD3 --> SP
    CD4 --> CR
    CD5 --> CR
    CD6 --> AA
    CD7 --> AA
    CD8 --> AA

    %% Click Events
    click AA "https://github.com/lawnchairlauncher/lawnicons/blob/develop/app/src/main/kotlin/app/lawnchair/lawnicons/LawniconsApplication.kt"
    click MA "https://github.com/lawnchairlauncher/lawnicons/blob/develop/app/src/main/kotlin/app/lawnchair/lawnicons/MainActivity.kt"
    click UI "https://github.com/lawnchairlauncher/lawnicons/tree/develop/app/src/main/kotlin/app/lawnchair/lawnicons/ui"
    click VM "https://github.com/lawnchairlauncher/lawnicons/tree/develop/app/src/main/kotlin/app/lawnchair/lawnicons/viewmodel"
    click REP "https://github.com/lawnchairlauncher/lawnicons/tree/develop/app/src/main/kotlin/app/lawnchair/lawnicons/repository"
    click API "https://github.com/lawnchairlauncher/lawnicons/tree/develop/app/src/main/kotlin/app/lawnchair/lawnicons/api"
    click DI "https://github.com/lawnchairlauncher/lawnicons/tree/develop/app/src/main/kotlin/app/lawnchair/lawnicons/di"
    click MD "https://github.com/lawnchairlauncher/lawnicons/tree/develop/app/src/main/kotlin/app/lawnchair/lawnicons/model"
    click PM "https://github.com/lawnchairlauncher/lawnicons/blob/develop/app/src/main/kotlin/app/lawnchair/lawnicons/repository/PreferenceManager.kt"
    click SP "https://github.com/lawnchairlauncher/lawnicons/blob/develop/svg-processor/src/main/kotlin/app/lawnchair/lawnicons/helper/Main.kt"
    click SP "https://github.com/lawnchairlauncher/lawnicons/blob/develop/svg-processor/src/main/kotlin/app/lawnchair/lawnicons/helper/ConfigProcessor.kt"
    click SP "https://github.com/lawnchairlauncher/lawnicons/blob/develop/svg-processor/src/main/kotlin/app/lawnchair/lawnicons/helper/SvgFilesProcessor.kt"
    click SP "https://github.com/lawnchairlauncher/lawnicons/blob/develop/svg-processor/src/main/kotlin/app/lawnchair/lawnicons/helper/AppfilterDiffCreator.kt"
    click SP "https://github.com/lawnchairlauncher/lawnicons/blob/develop/svg-processor/src/main/kotlin/app/lawnchair/lawnicons/helper/XmlUtil.kt"
    click IT "https://github.com/lawnchairlauncher/lawnicons/blob/develop/icontool.py"
    click NT "https://github.com/lawnchairlauncher/lawnicons/blob/develop/send_notifications.py"
    click CD1 "https://github.com/lawnchairlauncher/lawnicons/blob/develop/.github/workflows/build_debug_apk.yml"
    click CD2 "https://github.com/lawnchairlauncher/lawnicons/blob/develop/.github/workflows/build_release_apk.yml"
    click CD3 "https://github.com/lawnchairlauncher/lawnicons/blob/develop/.github/workflows/optimize_svgs.yml"
    click CD4 "https://github.com/lawnchairlauncher/lawnicons/blob/develop/.github/workflows/crowdin.yml"
    click CD5 "https://github.com/lawnchairlauncher/lawnicons/blob/develop/.github/workflows/crowdin_upload.yml"
    click CD6 "https://github.com/lawnchairlauncher/lawnicons/blob/develop/.github/workflows/icon_checklist.yml"
    click CD7 "https://github.com/lawnchairlauncher/lawnicons/blob/develop/.github/workflows/close_stale_prs.yml"
    click CD8 "https://github.com/lawnchairlauncher/lawnicons/blob/develop/.github/workflows/labeler.yml"

    %% Styles
    classDef runtime fill:#cfe2f3,stroke:#6fa8dc,color:#073763
    classDef local fill:#d9ead3,stroke:#6aa84f,color:#274e13
    classDef external fill:#ffe599,stroke:#f1c232,color:#874e0f
    classDef scripts fill:#d3d3d3,stroke:#999999,color:#333333
```
