# morpheuslauncher/morpheuslaunchergui architecture

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

- Interactive diagram: https://gitdiagram.com/morpheuslauncher/morpheuslaunchergui
- Repository: https://github.com/morpheuslauncher/morpheuslaunchergui

## Overview

##### Main Components
- Platform-Specific Plugin Components – These are the native integrations for macOS, Linux, Windows (and even Android). They’re found in separate directories (e.g., lib/macos, linux, windows, android) and include code that bridges Flutter with native capabilities (for instance, window effects like the frosted glass theme).
- Core Library Package – The “lib” directory contains the main Flutter package (e.g., flutter_acrylic.dart) along with supporting utilities (e.g., widgets for titlebar safe area, transparent sidebars).
- Example/Demo Application – The “example” folder shows how the Flutter GUI is set up and integrated into a complete application, and it also includes platform-specific build configurations (macOS, Linux, Windows).

##### Relationships and Interactions
- The Flutter UI layer interacts with the underlying native plugins. It calls into native platform code (via the plugin interfaces) to handle window effects, special themes (like Material You or frosted glass), and native integrations.
- The example application acts as an entry point that demonstrates how the core GUI package (“lib”) can be used to build the full-fledged launcher.
- The build and configuration scripts provided (build_linux.sh, build_mac.sh, build_windows.bat, various CMakeLists.txt files) indicate a robust deployment and cross-platform build pipeline.

##### Architectural Patterns and Design Principles
- Cross-Platform Architecture: The code is structured to separate the Flutter UI (written in Dart) from native implementations (in C++/Swift for desktop platforms). This modular separation allows for easier maintenance and platform-specific optimization.
- Plugin-based Integration: There is a clear boundary between how the UI interacts with the native operating system functionalities, which is achieved through the use of plugins.
- Multi-layered Design: The example project, core library, and platform-specific implementations indicate a layered approach; the example serves as the driver, the core package provides features, and the native directories implement OS-specific functionality.

##### Relevant Technologies and Frameworks
- Flutter SDK (as indicated by Flutter version 3.19.0 requirement).
- Dart language and its packages (pubspec.yaml and pubspec.lock files).
- Platform build tools like CMake (for Linux and Windows) and Xcode/Swift for macOS.
- Native integrations with code in C++ (for Windows/Linux) and Swift (for macOS).

##### Instructing the Principal Software Engineer – Elements
- Main Components:
- Flutter UI Layer:
- Widgets & Views (from the “example/lib/views”, “lib/widgets” directories)
- Business Logic – account handling, language localization (from “example/lib/account” and “example/lib/l10n”).
- Native Plugin Layer:
- macOS: code in “lib/macos”, “example/macos”
- Linux: code in “linux”, “example/linux”
- Windows: code in “windows”, “example/windows”
- Android: minimal plugin support (see “android” directory)
- Build & Configuration Tools:
- CMake scripts, platform-specific configuration files, and build scripts.
- Example Application:
- Serves as integration/demonstration for the GUI components.

- Relationships and Data Flow:
- How user interactions in the Flutter UI trigger calls to the native plugins.
- How the core library provides services/integration points that the example application uses.
- How configuration and deployment scripts tie into building each platform’s native code.

- Visual Suggestions:

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Flutter UI Layer
    subgraph "Flutter UI Layer"
        FW["Widgets & Views"]:::flutter
        FA["Account"]:::flutter
        FL["Localization"]:::flutter
        FU["Utils"]:::flutter
    end

    %% Core Library Package
    subgraph "Core Library Package"
        CP["Core Package"]:::core
        CW["Core Widgets"]:::core
    end

    %% Platform-Specific Plugin Components
    subgraph "Native Plugin Components"
        subgraph "macOS"
            MCore["macOS Plugin Core"]:::native
            MExample["macOS Plugin Example"]:::native
        end
        subgraph "Linux"
            LCore["Linux Plugin Core"]:::native
            LExample["Linux Plugin Example"]:::native
        end
        subgraph "Windows"
            WCore["Windows Plugin Core"]:::native
            WExample["Windows Plugin Example"]:::native
        end
        subgraph "Android"
            APlugin["Android Plugin"]:::native
        end
    end

    %% Example Application
    subgraph "Example Application"
        EXApp["Example App"]:::example
    end

    %% Build & Configuration Tools
    subgraph "Build & Config"
        BC["Build Configurations"]:::build
    end

    %% Relationships
    EXApp -->|"integrates"| FW
    EXApp -->|"integrates"| CP
    CP -->|"supports"| FW
    FW -->|"calls"| MCore
    FW -->|"calls"| LCore
    FW -->|"calls"| WCore
    FW -->|"calls"| APlugin
    BC -->|"configures"| MExample
    BC -->|"configures"| LExample
    BC -->|"configures"| WExample

    %% Click Events
    click FW "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/example/lib/views"
    click FA "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/example/lib/account"
    click FL "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/example/lib/l10n"
    click FU "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/example/lib/utils"
    click MCore "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/lib/macos"
    click MExample "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/example/macos"
    click LCore "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/linux"
    click LExample "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/example/linux"
    click WCore "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/windows"
    click WExample "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/example/windows"
    click APlugin "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/android"
    click CP "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/lib"
    click CW "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/lib/widgets"
    click EXApp "https://github.com/morpheuslauncher/morpheuslaunchergui/tree/main/example"

    %% Styles
    classDef flutter fill:#BBDEFB,stroke:#0D47A1,stroke-width:2,color:#000000;
    classDef native fill:#C8E6C9,stroke:#1B5E20,stroke-width:2,color:#000000;
    classDef core fill:#FFCDD2,stroke:#B71C1C,stroke-width:2,color:#000000;
    classDef example fill:#FFF9C4,stroke:#F57F17,stroke-width:2,color:#000000;
    classDef build fill:#D1C4E9,stroke:#512DA8,stroke-width:2,color:#000000;
```
