# bl4ckswordsman/cerberustiles architecture

> Architecture diagram of the GitHub repository bl4ckswordsman/cerberustiles, 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/bl4ckswordsman/cerberustiles
- Repository: https://github.com/bl4ckswordsman/cerberustiles

## Overview

##### Main Components
- App Module – This is the core of the Android application.
- Activities – The project defines several UI entry points such as MainActivity, OverlayActivity, and ToggleActivity. Represent these as separate components, indicating that they form the main user interface.
- Quick Settings Tiles Services – The package “quicksettingstiles” contains services like AdaptiveBrightnessTileService that integrate with Android’s quick settings. Add these as separate modular components.
- UI Components & Themes – Under the “ui” and “theme” directories, the project defines various UI elements (Components.kt, MainScreen.kt, dialogs, and styling information). Group these into a User Interface Layer.
- Helper Utilities & Business Logic – Classes such as SettingsUtils, VersionManager, Constants, and LicencesInfo encapsulate application logic. Represent these as underlying business logic or helper modules that support the UI.
- Navigation – The “navbar” package (e.g., BottomNavBar) represents navigation-related components.
- Resources – Drawable, mipmap, XML, layouts, and assets (like the open_source_licenses.html file) should be shown as part of the resource management layer.

##### Out Interactions & Relationships
- That the Quick Settings Tile Services (like AdaptiveBrightnessTileService) interact directly with Android’s system services to update system settings.

##### Architectural Patterns
- Although not explicitly mentioned as MVVM or MVP, the separation between UI (activities, Fragments, dialogs) and business logic (utility classes, version management) follows common Android architectural practices.
- That there’s a clear separation between presentation (UI/activities) and logic (services/utilities), which may evolve into a more formal design pattern with further development.

##### Relevant Technologies and Frameworks
- Kotlin as the primary programming language.
- Android SDK components (activities, services, resources).
- Gradle as the build system, including the Kotlin DSL (build.gradle.kts).
- GitHub Actions (workflows for code quality, builds, and releases) to ensure continuous integration and deployment.
- (Optional) CodeQL for security and quality analysis.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "App Module"
        A1["App Module"]:::build
        
        subgraph "UI Layer"
            subgraph "Activities"
                MA["MainActivity"]:::activity
                OA["OverlayActivity"]:::activity
                TA["ToggleActivity"]:::activity
            end
            NAV["BottomNavBar"]:::nav
            UI["UI Components (MainScreen, OverlayDialog, etc.)"]:::ui
            THEMES["Themes (Color, Theme, Type)"]:::ui
            RES["Android Resources & Assets"]:::resource
        end

        subgraph "Business Logic"
            BIZ["Helper Utilities & Business Logic (SettingsUtils, VersionManager, LicencesInfo, Constants, ShortcutHelper)"]:::biz
        end

        subgraph "Quick Settings"
            QS["AdaptiveBrightnessTileService"]:::service
        end

        subgraph "Build & CI/CD"
            BUILD["Build Scripts"]:::build
            CICD["CI/CD Config"]:::build
        end
    end

    %% Interactions among components
    MA -->|"launches"| OA
    MA -->|"triggers"| TA
    MA -->|"invokes"| BIZ
    MA -->|"opens"| UI
    UI -->|"applies"| THEMES
    UI -->|"renders"| RES
    MA -->|"uses"| NAV

    %% Build and CI/CD interactions
    BUILD -.->|"builds"| A1
    CICD -.->|"deploys"| A1

    %% Styles definitions
    classDef activity fill:#FFCC00,stroke:#333,stroke-width:2px;
    classDef service fill:#FF9999,stroke:#333,stroke-width:2px;
    classDef ui fill:#AAFFAA,stroke:#333,stroke-width:2px;
    classDef biz fill:#AACCFf,stroke:#333,stroke-width:2px;
    classDef nav fill:#FFCCFF,stroke:#333,stroke-width:2px;
    classDef resource fill:#DDDDDD,stroke:#333,stroke-width:2px;
    classDef build fill:#CCCCCC,stroke:#333,stroke-width:2px;

    %% Click Events
    click A1 "https://github.com/bl4ckswordsman/cerberustiles/tree/master/app"
    click MA "https://github.com/bl4ckswordsman/cerberustiles/tree/master/app/src/main/kotlin/com/bl4ckswordsman/cerberustiles/activities"
    click OA "https://github.com/bl4ckswordsman/cerberustiles/tree/master/app/src/main/kotlin/com/bl4ckswordsman/cerberustiles/activities"
    click TA "https://github.com/bl4ckswordsman/cerberustiles/tree/master/app/src/main/kotlin/com/bl4ckswordsman/cerberustiles/activities"
    click QS "https://github.com/bl4ckswordsman/cerberustiles/blob/master/app/src/main/kotlin/com/bl4ckswordsman/cerberustiles/quicksettingstiles/AdaptiveBrightnessTileService.kt"
    click UI "https://github.com/bl4ckswordsman/cerberustiles/tree/master/app/src/main/kotlin/com/bl4ckswordsman/cerberustiles/ui"
    click THEMES "https://github.com/bl4ckswordsman/cerberustiles/tree/master/app/src/main/kotlin/com/bl4ckswordsman/cerberustiles/ui/theme"
    click BIZ "https://github.com/bl4ckswordsman/cerberustiles/tree/master/app/src/main/kotlin/com/bl4ckswordsman/cerberustiles"
    click NAV "https://github.com/bl4ckswordsman/cerberustiles/blob/master/app/src/main/kotlin/com/bl4ckswordsman/cerberustiles/navbar/BottomNavBar.kt"
    click RES "https://github.com/bl4ckswordsman/cerberustiles/tree/master/app/src/main/res"
    click BUILD "https://github.com/bl4ckswordsman/cerberustiles/blob/master/build.gradle.kts"
    click CICD "https://github.com/bl4ckswordsman/cerberustiles/blob/master/.github"
```
