# homarr-labs/dashboard-icons architecture

> Architecture diagram of the GitHub repository homarr-labs/dashboard-icons, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/homarr-labs/dashboard-icons
- Repository: https://github.com/homarr-labs/dashboard-icons

## Overview

##### Components to Highlight
- “Repository Source”:
– The main repository holds the source SVG files (in the “svg” directory), pre‐generated PNG and WEBP files (in their respective directories), metadata files (in the “meta” folder), and documentation.
- “Build & Processing Layer (Automation Scripts)”: The “scripts” folder contains Python scripts that perform operations such as:
– Generating and updating metadata (generate_meta.py, generate_metadata*.py)
– Producing file trees (generate_file_tree.py)
- “CI/CD Pipeline (GitHub Actions)”: The “.github/workflows” directory hosts several workflows that automate tasks like:
– Compression and update pipelines (compress_icons.yml, update_icons_and_resources.yml, etc.)
– Handling pull request events (on_icon_addition_approved.yml, on_icon_update_approved.yml)

##### Relationships & Data Flow
- Once a change is made (via pull requests or issues), the CI/CD workflows are triggered.
- GitHub Actions then run the processing scripts which:
– Convert SVGs into PNG/WEBP formats.
– Update the metadata and generate updated “tree.xml” and “tree.json” files.
- End-users or external dashboards dynamically reference these assets using stable URLs (via jsDelivr or direct GitHub links).

##### Architectural Patterns
- Automated CI/CD: There is strong reliance on GitHub Actions to ensure that any contribution triggers standardized processing, validation, and deployment.
- Source-Of-Truth: SVG files serve as the base asset from which other formats are generated, ensuring consistency.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Contributors
    subgraph "Contributors"
        A["Contributors / Users\n(Submit PR/Issue)"]:::contributor
    end

    %% Repository Source with internal content
    subgraph "Repository Source"
        R["Repository"]:::repo
        subgraph "Repository Content"
            SVG["SVG Assets"]:::assets
            PNG["PNG Assets"]:::assets
            WEBP["WEBP Assets"]:::assets
            META["Metadata (JSON)"]:::assets
            DOCS["Documentation/Guidelines"]:::doc
        end
        R -->|"contains"| SVG
        R -->|"contains"| PNG
        R -->|"contains"| WEBP
        R -->|"contains"| META
        R -->|"contains"| DOCS
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        C["GitHub Actions Workflows"]:::pipeline
    end

    %% Build & Processing Layer
    subgraph "Build & Processing Layer"
        S["Processing/Build Scripts\n(Python Automation)"]:::automation
    end

    %% External CDN/Consumers
    subgraph "External"
        E["External CDN/Consumers\n(jsDelivr, Dashboards)"]:::external
    end

    %% Connections / Data Flow
    A -->|"Submit_Icon"| R
    R -->|"Trigger_Workflows"| C
    A -->|"PR_Event"| C
    C -->|"Execute_Scripts"| S
    S -->|"Deploy_Assets"| R
    R -->|"Publish_Assets"| E

    %% Click Events
    click A "https://github.com/homarr-labs/dashboard-icons/blob/main/CONTRIBUTING.md"
    click SVG "https://github.com/homarr-labs/dashboard-icons/tree/main/svg directory"
    click PNG "https://github.com/homarr-labs/dashboard-icons/tree/main/png directory"
    click WEBP "https://github.com/homarr-labs/dashboard-icons/tree/main/webp directory"
    click META "https://github.com/homarr-labs/dashboard-icons/tree/main/meta directory"
    click S "https://github.com/homarr-labs/dashboard-icons/tree/main/scripts directory"
    click C "https://github.com/homarr-labs/dashboard-icons/tree/main/.github/workflows directory"
    click DOCS "https://github.com/homarr-labs/dashboard-icons/blob/main/README.md"

    %% Styles
    classDef contributor fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef repo fill:#AED6F1,stroke:#2874A6,stroke-width:2px;
    classDef assets fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
    classDef automation fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef pipeline fill:#FADBD8,stroke:#E74C3C,stroke-width:2px;
    classDef external fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
    classDef doc fill:#E8DAEF,stroke:#8E44AD,stroke-width:2px;
```
