# houarizegai/calculator architecture

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

- Interactive diagram: https://gitdiagram.com/houarizegai/calculator
- Repository: https://github.com/houarizegai/calculator

## Overview

##### Project type and purpose
- This is a standalone desktop application written in Java 11+ using the Swing framework.

##### File structure
Top-level files:
- pom.xml – Maven build and dependency management
- README.md, LICENSE, .gitignore – documentation and configuration
- screenshots/ – sample UI images
src/main/java/com/houarizegai/calculator:
- App.java – application entry point (initializes theme and UI)
- ui/CalculatorUI.java – Swing-based user interface and event handling
- theme/ThemeLoader.java – reads theme definitions from application.yaml
- theme/properties/Theme.java, ThemeList.java – domain classes modeling each theme
src/main/resources/application.yaml – theme configuration file
src/test/java/com/.../CalculatorUITest.java – basic UI test

##### README for additional insights
- Confirms Swing UI, theming requirements, no external services or database dependencies.
- Emphasizes simple user experience and theming.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Launch Layer
    subgraph "Launch Layer"
        A["App Launcher"]:::launch
    end

    %% Theming Layer
    subgraph "Theming Layer"
        TL["ThemeLoader"]:::theming
        TList["ThemeList"]:::theming
        T["Theme"]:::theming
        Y["application.yaml 📄"]:::theming
    end

    %% UI Layer
    subgraph "UI Layer"
        U["User"]:::external
        SE["Swing Event Loop"]:::ui
        UI["CalculatorUI"]:::ui
    end

    %% Utility Layer
    subgraph "Utility Layer"
        CU["ColorUtil"]:::util
    end

    %% Test Layer
    subgraph "Test Layer"
        Test["CalculatorUITest"]:::test
    end

    %% Connections
    U -->|"input events"| SE
    SE -->|"dispatches events"| UI
    A -->|"initializes"| TL
    TL -->|"reads definitions from"| Y
    TL -->|"populates"| TList
    TList -->|"models themes as"| T
    A -->|"passes ThemeList to"| UI
    UI -->|"uses"| CU
    Test -->|"tests UI"| UI

    %% Click Events
    click A "https://github.com/houarizegai/calculator/blob/master/src/main/java/com/houarizegai/calculator/App.java"
    click TL "https://github.com/houarizegai/calculator/blob/master/src/main/java/com/houarizegai/calculator/theme/ThemeLoader.java"
    click T "https://github.com/houarizegai/calculator/blob/master/src/main/java/com/houarizegai/calculator/theme/properties/Theme.java"
    click TList "https://github.com/houarizegai/calculator/blob/master/src/main/java/com/houarizegai/calculator/theme/properties/ThemeList.java"
    click Y "https://github.com/houarizegai/calculator/blob/master/src/main/resources/application.yaml"
    click UI "https://github.com/houarizegai/calculator/blob/master/src/main/java/com/houarizegai/calculator/ui/CalculatorUI.java"
    click CU "https://github.com/houarizegai/calculator/blob/master/src/main/java/com/houarizegai/calculator/util/ColorUtil.java"
    click Test "https://github.com/houarizegai/calculator/blob/master/src/test/java/com/houarizegai/calculator/CalculatorUITest.java"

    %% Styles
    classDef launch fill:#cce5ff,stroke:#2b6cb0,color:#2b6cb0;
    classDef theming fill:#e6ffed,stroke:#2f855a,color:#2f855a;
    classDef ui fill:#fff5e6,stroke:#dd6b20,color:#dd6b20;
    classDef util fill:#f0f0f0,stroke:#4a5568,color:#4a5568;
    classDef test fill:#f7fafc,stroke:#718096,color:#718096;
    classDef external fill:#ffffff,stroke:#718096,color:#718096,stroke-dasharray: 5 5;
    class U external;
```
