# b1rtek/geode-gddlintegration architecture

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

- Interactive diagram: https://gitdiagram.com/b1rtek/geode-gddlintegration
- Repository: https://github.com/b1rtek/geode-gddlintegration

## Overview

##### Project Type & Purpose
- This project is a C++ mod that integrates with Geometry Dash Demon Ladder. It enhances the game by displaying demon level ratings, skillset statistics, detailed level information, and offers direct in-game rating submission through various custom UI popups.
- The README emphasizes features such as advanced level info popups, demon split pages, integrated search features, and configurable UI settings. The purpose is to blend external GDDL functionality into the game experience.

##### Analyzing the File Structure
- Top-Level Files: You have typical build and configuration files (CMakeLists.txt, mod.json, LICENSE) along with GitHub CI configuration in the .github directory.
- Source (src): Contains the main application entry (main.cpp) and several subdirectories that reflect clear modularization:
- layers/: Contains UI layer classes for popups and various UI components (e.g., GDDLLoginLayer, GDDLSearchLayer) that handle user interactions.
- modified/: Holds modified versions or overrides of existing game layers (e.g., LevelBrowserLayer, LevelSearchLayer) suggesting a patching/modification architecture.
- objects/: Encapsulates data entities (e.g., GDDLRating, RatingsSpread, Skillsets) used by the mod to store and manage rating/submission information.
- settings/: Manages UI configuration and mod settings (e.g., positioning settings, exclusion ranges) allowing adjustability of integrated UI elements.
- Other support files: RatingsManager.cpp/h and Utils.cpp/h provide core functionalities, such as managing ratings retrieval and utility functions/application logic.

##### Main Components
- Core Mod Application:
- Main Entry (main.cpp) – The starting point that initializes the mod.
- RatingsManager & Utils – Handle business logic for fetching, processing, and distributing rating data.
- UI Layers:
- Primary Pop-up Layers (GDDLLoginLayer, GDDLLevelInfoPopup, GDDLAdvancedLevelInfoPopup, etc.) – Manage interactions, logins, and rating submission interfaces.
- Modified Layers – Patching or augmenting existing game UI elements (e.g., LevelBrowserLayer, LevelSearchLayer) to integrate GDDL features.
- Data & Object Models:
- Objects (GDDLRating, RatingsSpread, Skillsets, Submission) – Represent complex data used for displaying ratings and statistics.
- Nodes (BarChartNode) – Custom UI components for data visualization.
- Settings Module:
- Contains nodes and classes for user-configurable settings regarding button positions, cache reset, login configurations and more.
- External Resources:
- Resources Folder – Includes assets (e.g., images like gddlpopup.png, search.png) for enhanced UI presentation.
- CI/CD & Build Pipeline:
- GitHub workflows and CMakeLists.txt indicate the build and deployment steps, though they are less central to runtime architecture.

##### Relationships & Interactions
- The main module invokes initialization routines (via main.cpp) and sets up the RatingsManager, which then orchestrates data collection from the GDDL API.
- UI Layers (both in layers/ and modified/) handle user interaction; for example, the GDDLLoginLayer facilitates user authentication while GDDLRatingSubmissionLayer sends user ratings.
- Data objects are populated and passed between layers and the RatingsManager to update UI displays (charts, level info popups).
- The Settings module influences the UI layout (e.g., through ButtonPositionSettingNodeV3) ensuring that the mod’s UI elements adapt to other mods or user preferences.
- Utilities in Utils.cpp/h provide common helper functions across these components.

##### Key Architectural Patterns & Principles
- Modular Design: Different folders (layers, nodes, objects, settings) clearly separate concerns.
- UI-Logic Separation: The UI layers are distinctly separated from core logic classes like RatingsManager and data objects.
- Extensibility: The existence of a “modified” directory suggests an override or extension pattern to enhance existing game functionalities without rewriting everything.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Core Application
    subgraph "Core Application"
        MainEntry["Main Entry"]
        RatingsManager["RatingsManager"]
        Utils["Utils"]
    end

    %% UI Layers
    subgraph "UI Layers"
        GDDLLoginLayer["GDDLLoginLayer"]
        GDDLLevelInfoPopup["GDDLLevelInfoPopup"]
        GDDLAdvancedLevelInfoPopup["GDDLAdvancedLevelInfoPopup"]
        GDDLRatingSubmissionLayer["GDDLRatingSubmissionLayer"]
        GDDLSearchLayer["GDDLSearchLayer"]
        GDDLDemonSplitLayer["GDDLDemonSplitLayer"]
    end

    %% Modified Game Layers
    subgraph "Modified Game Layers"
        LevelBrowserLayer["LevelBrowserLayer"]
        LevelSearchLayer["LevelSearchLayer"]
        LevelInfoLayer["LevelInfoLayer"]
        GDDLBoomScrollLayer["GDDLBoomScrollLayer"]
        GDDLRobtopLevelsLayer["GDDLRobtopLevelsLayer"]
        ProfilePage["ProfilePage"]
    end

    %% Custom UI Nodes
    subgraph "Custom UI Nodes"
        BarChartNode["BarChartNode"]
    end

    %% Data & Object Models
    subgraph "Data & Object Models"
        GDDLRating["GDDLRating"]
        RatingsSpread["RatingsSpread"]
        Skillsets["Skillsets"]
        Submission["Submission"]
    end

    %% Settings Module
    subgraph "Settings"
        SettingsModule["Settings & Configuration"]
    end

    %% External Resources
    subgraph "External Resources"
        Assets["Assets"]
    end

    %% CI/CD & Build Pipeline
    subgraph "CI/CD & Build Pipeline"
        BuildConfigs["Build Configurations"]
        GitHubCI["GitHub Workflows & Issues"]
    end

    %% Relationships and Interactions
    MainEntry -->|"initializes"| RatingsManager
    RatingsManager -->|"uses"| Utils

    GDDLLoginLayer -->|"authenticates"| RatingsManager
    GDDLRatingSubmissionLayer -->|"submitsRating"| RatingsManager
    GDDLSearchLayer -->|"searchRequest"| RatingsManager

    RatingsManager -->|"populates"| GDDLRating
    RatingsManager -->|"populates"| RatingsSpread
    RatingsManager -->|"populates"| Skillsets
    RatingsManager -->|"populates"| Submission

    SettingsModule -->|"configures"| GDDLLoginLayer
    SettingsModule -->|"configures"| LevelBrowserLayer

    RatingsSpread -->|"visualizes"| BarChartNode
    BarChartNode -->|"embeddedIn"| GDDLAdvancedLevelInfoPopup

    Assets -->|"resources"| GDDLAdvancedLevelInfoPopup
    LevelBrowserLayer -->|"modifies"| GDDLLevelInfoPopup
    ProfilePage -->|"updates"| RatingsManager

    BuildConfigs -->|"builds"| MainEntry
    GitHubCI -->|"supports"| BuildConfigs

    %% Styles
    classDef core fill:#ffcccc,stroke:#333,stroke-width:2px;
    classDef ui fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef modified fill:#d4edda,stroke:#333,stroke-width:2px;
    classDef data fill:#fff3cd,stroke:#333,stroke-width:2px;
    classDef settings fill:#e2e3e5,stroke:#333,stroke-width:2px;
    classDef external fill:#f8d7da,stroke:#333,stroke-width:2px;
    classDef pipeline fill:#d1ecf1,stroke:#333,stroke-width:2px;
    classDef custom fill:#e6ccff,stroke:#333,stroke-width:2px;

    class MainEntry,RatingsManager,Utils core;
    class GDDLLoginLayer,GDDLLevelInfoPopup,GDDLAdvancedLevelInfoPopup,GDDLRatingSubmissionLayer,GDDLSearchLayer,GDDLDemonSplitLayer ui;
    class LevelBrowserLayer,LevelSearchLayer,LevelInfoLayer,GDDLBoomScrollLayer,GDDLRobtopLevelsLayer,ProfilePage modified;
    class GDDLRating,RatingsSpread,Skillsets,Submission data;
    class SettingsModule settings;
    class Assets external;
    class BuildConfigs,GitHubCI pipeline;
    class BarChartNode custom;

    %% Click Events for Core Mod Application
    click MainEntry "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/main.cpp"
    click RatingsManager "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/RatingsManager.cpp"
    click Utils "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/Utils.cpp"

    %% Click Events for UI Layers
    click GDDLLoginLayer "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/layers/GDDLLoginLayer.cpp"
    click GDDLLevelInfoPopup "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/layers/GDDLLevelInfoPopup.cpp"
    click GDDLAdvancedLevelInfoPopup "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/layers/GDDLAdvancedLevelInfoPopup.cpp"
    click GDDLRatingSubmissionLayer "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/layers/GDDLRatingSubmissionLayer.cpp"
    click GDDLSearchLayer "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/layers/GDDLSearchLayer.cpp"
    click GDDLDemonSplitLayer "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/layers/GDDLDemonSplitLayer.cpp"

    %% Click Events for Modified Game Layers
    click LevelBrowserLayer "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/modified/LevelBrowserLayer.cpp"
    click LevelSearchLayer "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/modified/LevelSearchLayer.cpp"
    click LevelInfoLayer "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/modified/LevelInfoLayer.cpp"
    click GDDLBoomScrollLayer "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/modified/GDDLBoomScrollLayer.cpp"
    click GDDLRobtopLevelsLayer "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/modified/GDDLRobtopLevelsLayer.cpp"
    click ProfilePage "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/modified/ProfilePage.cpp"

    %% Click Events for Custom UI Nodes
    click BarChartNode "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/nodes/BarChartNode.cpp"

    %% Click Events for Data & Object Models
    click GDDLRating "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/objects/GDDLRating.cpp"
    click RatingsSpread "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/objects/RatingsSpread.cpp"
    click Skillsets "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/objects/Skillsets.cpp"
    click Submission "https://github.com/b1rtek/geode-gddlintegration/blob/master/src/objects/Submission.cpp"

    %% Click Event for Settings Module
    click SettingsModule "https://github.com/b1rtek/geode-gddlintegration/tree/master/src/settings"

    %% Click Event for External Resources
    click Assets "https://github.com/b1rtek/geode-gddlintegration/tree/master/resources"

    %% Click Events for CI/CD & Build Pipeline
    click BuildConfigs "https://github.com/b1rtek/geode-gddlintegration/blob/master/CMakeLists.txt"
    click GitHubCI "https://github.com/b1rtek/geode-gddlintegration/blob/master/.github"
```
