# bizilabs/halo architecture

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

- Interactive diagram: https://gitdiagram.com/bizilabs/halo
- Repository: https://github.com/bizilabs/halo

## Overview

##### Project type and purpose
- This is an open-source Kotlin Multiplatform library (“Halo”) providing Compose UI components and charting on Android and Desktop.
- It includes two main modules: “halo” (core UI components, theming, base primitives) and “charts” (chart data models, drawing logic).
- Sample apps (Android and Desktop) demonstrate usage of those modules.
- GitHub workflows handle building, testing, and publishing artifacts to a Maven repository.

##### File structure
- Top-level build files: settings.gradle.kts, build.gradle.kts, gradle.properties, gradlew scripts, GitHub workflow configs.
- charts/ module: commonMain code under charts/src/commonMain/kotlin/org/bizilabs/halo/charts; contains data models, drawing helpers, style definitions, and a UI entrypoint (HaloLineChart).
- halo/ module: commonMain code under halo/src/commonMain/kotlin/org/bizilabs/halo; subdivided into:
- composeResources (fonts)
- components (buttons, cards, badges, textfields, bottom sheets, etc.)
- extensions and state utilities
- sample/ module: two subprojects:
- sample/android: Android app depending on halo and charts, showcasing a UI in MainActivity
- sample/desktop: Desktop Compose multiplatform app with screens for each component
- charts and halo modules are compiled as multiplatform libraries without platform-specific code.
- CI/CD: .github/workflows defines build, publish, and tagging pipelines.

##### README for additional insights
- Confirms the library is Compose Multiplatform for all platforms.

a. Main components
- Developer workstation with Gradle and Kotlin Multiplatform plugin
- Core library: halo module (UI primitives, theming)
- Chart library: charts module (data, drawing, chart UI)
- Sample Android app (Android module)
- Sample Desktop app (Desktop module)
- External dependencies: Kotlin Stdlib, Compose Multiplatform, Kotlinx libraries
- CI/CD pipeline (GitHub Actions)
- Artifact repository (Maven Central or GitHub Packages)
b. Relationships and interactions
- halo and charts modules depend on Compose Multiplatform and Kotlinx
- sample apps depend on both modules
- CI/CD pipeline triggers on push/tags, builds all modules, runs tests, and publishes artifacts
- Developer workstation pushes code to GitHub, CI/CD builds and publishes, consumers (sample apps or external projects) fetch artifacts
c. Architectural patterns and design principles
- Modular KMP architecture: shared commonMain code, no platform-specific code in core modules
- Separation of concerns: UI primitives in halo, chart logic in charts
- Sample apps implement thin platform-specific layers to consume shared code
- Theming and style objects are centralized for consistency across components
d. Technologies, frameworks, and libraries
- Kotlin Multiplatform
- Compose Multiplatform UI
- Kotlinx Serialization or coroutines (if used)
- Gradle Kotlin DSL for build scripts
- GitHub Actions for CI/CD

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Developer Environment"
        Dev["Developer Workstation"]:::dev
    end

    subgraph "Version Control"
        GitHub["GitHub Repository"]:::external
        Root["Root Build Configuration"]:::external
    end

    subgraph "CI/CD Pipeline"
        Build["Build Workflow"]:::ci
        Publish["Publish Workflow"]:::ci
        Tag["Tag Workflow"]:::ci
    end

    subgraph "Artifact Repository"
        Repo["Maven Repository"]:::repo
    end

    subgraph "Shared Modules"
        Halo["halo (UI primitives)"]:::shared
        Charts["charts (Chart library)"]:::shared
    end

    subgraph "External Dependencies"
        Compose["Compose MPP"]:::external
        Kotlinx["Kotlinx Libraries"]:::external
    end

    subgraph "Consumer Apps"
        Android["Sample Android App"]:::app
        Desktop["Sample Desktop App"]:::app
    end

    Dev -->|"push code"| GitHub
    GitHub -->|"trigger push"| Build
    GitHub -->|"trigger on tag"| Tag
    Build -->|"Gradle build & test"| Repo
    Tag -->|"tag & release"| Publish
    Publish -->|"publish artifacts (HTTP)"| Repo
    Android -->|"Gradle fetch"| Repo
    Desktop -->|"Gradle fetch"| Repo

    Halo -->|"Gradle compile"| Android
    Charts -->|"Gradle compile"| Android
    Halo -->|"Gradle compile"| Desktop
    Charts -->|"Gradle compile"| Desktop

    Halo -->|"depend on"| Compose
    Charts -->|"depend on"| Compose
    Halo -->|"depend on"| Kotlinx
    Charts -->|"depend on"| Kotlinx

    GitHub --> Root

    click Halo "https://github.com/bizilabs/halo/tree/main/halo/src/commonMain/kotlin/org/bizilabs/halo"
    click Halo "https://github.com/bizilabs/halo/blob/main/halo/build.gradle.kts"
    click Charts "https://github.com/bizilabs/halo/tree/main/charts/src/commonMain/kotlin/org/bizilabs/halo/charts"
    click Charts "https://github.com/bizilabs/halo/blob/main/charts/build.gradle.kts"
    click Android "https://github.com/bizilabs/halo/tree/main/sample/android/src/main/java/org/bizilabs/sample/halo"
    click Android "https://github.com/bizilabs/halo/blob/main/sample/android/src/main/java/org/bizilabs/sample/halo/MainActivity.kt"
    click Android "https://github.com/bizilabs/halo/blob/main/sample/android/build.gradle.kts"
    click Desktop "https://github.com/bizilabs/halo/tree/main/sample/desktop/src/desktopMain/kotlin/org/bizilabs/halo/desktop"
    click Desktop "https://github.com/bizilabs/halo/blob/main/sample/desktop/src/desktopMain/kotlin/org/bizilabs/halo/desktop/App.kt"
    click Desktop "https://github.com/bizilabs/halo/blob/main/sample/desktop/src/desktopMain/kotlin/org/bizilabs/halo/desktop/main.kt"
    click Desktop "https://github.com/bizilabs/halo/blob/main/sample/desktop/build.gradle.kts"
    click Build "https://github.com/bizilabs/halo/blob/main/.github/workflows/build.yml"
    click Publish "https://github.com/bizilabs/halo/blob/main/.github/workflows/publish.yml"
    click Tag "https://github.com/bizilabs/halo/blob/main/.github/workflows/tagged.yml"
    click GitHub "https://github.com/bizilabs/halo/tree/main/.github/workflows"
    click Root "https://github.com/bizilabs/halo/blob/main/settings.gradle.kts"
    click Root "https://github.com/bizilabs/halo/blob/main/build.gradle.kts"
    click Root "https://github.com/bizilabs/halo/blob/main/gradle.properties"
    click Root "https://github.com/bizilabs/halo/blob/main/gradle/libs.versions.toml"

    classDef shared fill:#f0f8ff,stroke:#000080,color:#000080
    classDef app fill:#fffacd,stroke:#b8860b,color:#b8860b
    classDef ci fill:#e6e6fa,stroke:#9370db,color:#9370db
    classDef repo fill:#f5f5f5,stroke:#708090,color:#708090
    classDef external fill:#ffe4e1,stroke:#cd5c5c,color:#cd5c5c
    classDef dev fill:#e0ffff,stroke:#20b2aa,color:#20b2aa
```
