# mnvrtx/cycladeui architecture

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

- Interactive diagram: https://gitdiagram.com/mnvrtx/cycladeui
- Repository: https://github.com/mnvrtx/cycladeui

## Overview

##### Main Components
- Unity Host Environment – the overall Unity project structure with Scenes, Prefabs, and ScriptableObjects (e.g., the ExampleScene, GlobalPopupSystemSettings, PopupSystemSettings, etc.).
- Core Libraries:
– GameLogger: Provides logging functionality and debugging tools.
– BaseShared: Offers shared utilities and basic helper functions.
– CycladeBase: Forms part of the core infrastructure and media management (e.g., handling Materials, Prefabs for base debugging canvas, performance analyzer, etc.).
- UI and Interaction Libraries:
– CycladeUI: Manages the UI interfaces and popup system. Key components include the PopupSystem prefab and the related settings.
– CycladeBindings: Handles state management and automatic reference binding for UI elements.
- Supporting Libraries:
– CycladeLocalization: Provides multilingual support by syncing with a Google Sheet and managing localization strings.
– CycladeStorage: Offers persistence and local storage management via a simple API.
- External Dependencies:
– DOTween (from Demigiant): Used by CycladeBindings (and possibly by CycladeUI for animations).
– NewtonsoftJson: Used for serialization and required by CycladeLocalization and CycladeStorage.

##### Relationships and Dependencies
- Within the Unity project, represent each plugin or library as a separate block. For instance:
– CycladeLocalization depends on both NewtonsoftJson and CycladeStorage; similarly, CycladeStorage needs NewtonsoftJson.
– CycladeUI is at the top layer for UI management and depends on CycladeBindings for state and reference setup.
- External service dependencies such as Google Sheets (for localization sync) as another block, showing that CycladeLocalization interacts with it during its setup (credential JSON, sheet_info.json).

##### Architectural Patterns & Integration Points
- The architecture follows a modular pattern where each library is self-contained (e.g., each has its own asmdef file) and integrated into the main Unity project using a package-based approach.
- "PopupSystem" as the entry point for UI creation, and then show how popups are created by deriving from the BasePopup class.
- That settings for different popup systems (scriptable objects) allow multiple popup system instances to coexist, representing a flexible and extendable design.
- How the StaticEntryPoint integrates initialization for localization and storage components.

##### Relevant Technologies, Frameworks, and Libraries
- Unity (with its specific directories such as Assets, ProjectSettings, Packages) as the host environment.
- DOTween for UI animation and asynchronous loading (for popup types like FastFollow and Preload).
- NewtonsoftJson for serialization/deserialization in localization and storage.
- Google Sheets API for data synchronization in CycladeLocalization.
- The usage of Unity’s ScriptableObjects and Prefabs to drive configuration and runtime behavior (e.g., in the popup system).

- Clearly labeled blocks for the main components: Unity Host (Scenes/Prefabs), Core Libraries (GameLogger, BaseShared, CycladeBase), UI Libraries (CycladeUI, CycladeBindings), and Supporting Libraries (CycladeLocalization, CycladeStorage).
- Annotations or sidebar notes that capture configuration aspects like the Google Sheets credential and sheet info handling.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Unity Host Environment
    subgraph "Unity Host Environment"
        UH1["Example Scene"]
        UH2["Prefabs"]
        UH3["ScriptableObjects"]
    end

    %% Core Libraries
    subgraph "Core Libraries"
        C1["GameLogger"]
        C2["BaseShared"]
        C3["CycladeBase"]
    end

    %% UI and Interaction Libraries
    subgraph "UI Libraries"
        UI1["CycladeUI (PopupSystem)"]
        UI2["CycladeBindings"]
    end

    %% Supporting Libraries
    subgraph "Supporting Libraries"
        S1["CycladeLocalization"]
        S2["CycladeStorage"]
    end

    %% External Dependencies
    subgraph "External Dependencies"
        E1["DOTween"]
        E2["NewtonsoftJson"]
        E3["Google Sheets API"]
    end

    %% Relationships from Unity Host to UI layer
    UH1 -->|"initiates"| UI1

    %% UI Libraries dependencies
    UI1 -->|"dependsOn"| UI2
    UI2 -->|"uses"| E1

    %% Core Library dependencies (UI Libraries)
    UI1 -->|"requires"| C1
    UI1 -->|"requires"| C2
    UI1 -->|"requires"| C3
    UI2 -->|"requires"| C1
    UI2 -->|"requires"| C2
    UI2 -->|"requires"| C3

    %% Core Library dependencies (Supporting Libraries)
    S1 -->|"requires"| C1
    S1 -->|"requires"| C2
    S1 -->|"requires"| C3
    S2 -->|"requires"| C1
    S2 -->|"requires"| C2
    S2 -->|"requires"| C3

    %% Supporting Libraries inter-dependencies and external usage
    S1 -->|"usesNewtonsoft"| E2
    S2 -->|"usesNewtonsoft"| E2
    S1 -->|"dependsOn"| S2
    S1 -->|"syncWith"| E3

    %% Class definitions for colour theming
    class UH1,UH2,UH3 unity
    class C1,C2,C3 core
    class UI1,UI2 ui
    class S1,S2 support
    class E1,E2,E3 external

    %% Click Events
    click UH1 "https://github.com/mnvrtx/cycladeui/blob/main/Assets/Scenes/ExampleScene.unity"
    click UH2 "https://github.com/mnvrtx/cycladeui/tree/main/Assets/Prefabs"
    click UH3 "https://github.com/mnvrtx/cycladeui/tree/main/Assets/ScriptableObjects"
    click C1 "https://github.com/mnvrtx/cycladeui/tree/main/Assets/Plugins/GameLogger"
    click C2 "https://github.com/mnvrtx/cycladeui/tree/main/Assets/Plugins/BaseShared"
    click C3 "https://github.com/mnvrtx/cycladeui/tree/main/Assets/Plugins/CycladeBase"
    click UI1 "https://github.com/mnvrtx/cycladeui/blob/main/Assets/Plugins/CycladeUI/PopupSystem.prefab"
    click UI2 "https://github.com/mnvrtx/cycladeui/tree/main/Assets/Plugins/CycladeBindings"
    click S1 "https://github.com/mnvrtx/cycladeui/tree/main/Assets/Plugins/CycladeLocalization"
    click S2 "https://github.com/mnvrtx/cycladeui/tree/main/Assets/Plugins/CycladeStorage"
    click E1 "https://github.com/mnvrtx/cycladeui/tree/main/Assets/ExternalAssets/Demigiant/DOTween"
    click E3 "https://github.com/mnvrtx/cycladeui/tree/main/Assets/Editor/CycladeSettings"

    %% Styles
    classDef unity fill:#D3D3D3,stroke:#333,stroke-width:2px;
    classDef core fill:#AED6F1,stroke:#333,stroke-width:2px;
    classDef ui fill:#ABEBC6,stroke:#333,stroke-width:2px;
    classDef support fill:#D2B4DE,stroke:#333,stroke-width:2px;
    classDef external fill:#F9D79F,stroke:#333,stroke-width:2px;
```
