# foprc/choretracker architecture

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

- Interactive diagram: https://gitdiagram.com/foprc/choretracker
- Repository: https://github.com/foprc/choretracker

## Overview

##### Project Type & Purpose
- The project is a WoW addon, as indicated by the .toc file (ChoreTracker.toc), lua source files, and WoW-specific libraries.
- Its purpose is to assist players by tracking various in-game chores (quests or tasks related to events, professions, etc.), with a user-friendly UI.

##### Analyzing the File Structure
- Key Top-Level Directories:
- AceGUI & Libs/AceGUI-3.0: These provide the underlying UI framework and widget system for customization.
- Data: Organized subdirectories (Chores, Professions, Timers) that hold configuration and data logic for different chore types and events.
- Modules: Contains distinct functionality modules (Display, Options, Scanner, Timers) that likely separate concerns in the addon.
- Libs: Contains several dependencies (AceAddon-3.0, AceBucket-3.0, AceConfig, AceConsole, AceDB, AceEvent, etc.) that indicate an event-driven and modular design.
- Other Files:
- The .toc and .lua files (e.g., ChoreTracker.lua) signify entry points and core execution flows.
- GitHub workflows for release automation are also provided.

##### Key Components
a. User Interface (UI) Layer:
- AceGUI framework (with custom skins/widgets from AceGUI and SharedMediaWidgets) representing the addon’s graphical interface.
- UI components such as Frames and Widgets (contained in AceGUI/ and various Libs/AceGUI-3.0/widgets).
b. Core Addon Logic:
- The main entry point (ChoreTracker.lua and the .toc file) which registers and bootstraps the addon.
- Modules: Display, Options, Scanner, Timers – each handling specific aspects of chore tracking.
c. Data & Configuration Layer:
- Data folder (subdirectories for Chores, Professions, Timers): Contains chore-specific scripts (including profession-specific chores) that feed data into the addon.
- Static assets (images in Assets) used for creating visual indicators.
d. Dependency Libraries:
- Ace libraries (AceAddon, AceBucket, AceConfig, AceConsole, AceDB, AceEvent, etc.) that provide the fundamental event handling, configuration, and utility functions.
- LibCandyBar and LibSharedMedia for additional UI components and theme management.
e. External Integration:
- Although it is a WoW addon, consider the integration with the game client’s API and the event system provided by the WoW engine.

##### Final Steps
- Entry point with a clear label (e.g., “ChoreTracker Loader (ChoreTracker.toc & ChoreTracker.lua)”).
- The Modules, which in turn interface with:
◦ The UI Layer (AceGUI elements, assets).
◦ The Data Layer (Chore and Profession data).
◦ The external libraries which manage events, configuration, and add-on methods.
- Every element (from configuration libraries to assets) is distinctly labeled and visually separated.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Addon
    CORE["ChoreTracker Loader (Entry Point)"]:::core

    %% UI Layer
    UI["UI Layer (AceGUI & Widgets)"]:::ui

    %% Modules Subgraph
    subgraph "Modules"
        Display["Display Module"]:::module
        Options["Options Module"]:::module
        Scanner["Scanner Module"]:::module
        Timers["Timers Module"]:::module
    end

    %% Data & Configuration Subgraph
    subgraph "Data & Configuration"
        DataMain["Data (Root)"]:::data
        DataChores["Chores"]:::data
        DataChoreProf["Chores/Professions"]:::data
        DataTimers["Timers"]:::data
        ProfConfig["Professions.lua"]:::data
    end

    %% Asset Module
    Assets["Asset Module (Images & Icons)"]:::asset

    %% Dependency Libraries Subgraph
    subgraph "Dependency Libraries"
        AceAddon["AceAddon-3.0"]:::lib
        AceBucket["AceBucket-3.0"]:::lib
        AceConfig["AceConfig-3.0"]:::lib
        AceConsole["AceConsole-3.0"]:::lib
        AceDB["AceDB-3.0"]:::lib
        AceDBOptions["AceDBOptions-3.0"]:::lib
        AceEvent["AceEvent-3.0"]:::lib
        AceGUIDep["AceGUI-3.0"]:::lib
        AceHook["AceHook-3.0"]:::lib
        AceLocale["AceLocale-3.0"]:::lib
        AceTimer["AceTimer-3.0"]:::lib
        CallbackHandler["CallbackHandler-1.0"]:::lib
        LibCandyBar["LibCandyBar-3.0"]:::lib
        LibSharedMedia["LibSharedMedia-3.0"]:::lib
        LibStub["LibStub"]:::lib
    end

    %% Connections from Core Addon
    CORE -->|"loads"| Display
    CORE -->|"loads"| Options
    CORE -->|"loads"| Scanner
    CORE -->|"loads"| Timers
    CORE -->|"initializes"| UI
    CORE -->|"reads"| DataMain
    CORE -->|"utilizes"| Assets
    CORE -->|"registers"| AceEvent

    %% Data & Config hierarchy
    DataMain -->|"contains"| DataChores
    DataMain -->|"contains"| DataTimers
    DataChores -->|"includes"| DataChoreProf
    DataMain -->|"includes"| ProfConfig

    %% Module interactions
    Display -->|"renders with"| UI
    Options -->|"configures"| UI
    Scanner -->|"fetches"| DataMain
    Timers -->|"manages"| DataTimers

    %% Modules dependency usage
    Display -->|"calls"| AceEvent
    Options -->|"calls"| AceConfig
    Scanner -->|"calls"| AceEvent
    Timers -->|"calls"| AceTimer

    %% UI Layer uses Assets
    UI -->|"displays"| Assets

    %% Click Events for Core Addon
    click CORE "https://github.com/foprc/choretracker/blob/main/ChoreTracker.toc"
    click CORE "https://github.com/foprc/choretracker/blob/main/ChoreTracker.lua"

    %% Click Events for UI Layer
    click UI "https://github.com/foprc/choretracker/tree/main/AceGUI"
    click UI "https://github.com/foprc/choretracker/blob/main/Libs/AceGUI-3.0"
    click UI "https://github.com/foprc/choretracker/blob/main/Libs/AceGUI-3.0-SharedMediaWidgets"

    %% Click Events for Modules
    click Display "https://github.com/foprc/choretracker/blob/main/Modules/Display.lua"
    click Options "https://github.com/foprc/choretracker/blob/main/Modules/Options.lua"
    click Scanner "https://github.com/foprc/choretracker/blob/main/Modules/Scanner.lua"
    click Timers "https://github.com/foprc/choretracker/blob/main/Modules/Timers.lua"

    %% Click Events for Data & Configuration
    click DataMain "https://github.com/foprc/choretracker/tree/main/Data"
    click DataChores "https://github.com/foprc/choretracker/tree/main/Data/Chores"
    click DataChoreProf "https://github.com/foprc/choretracker/tree/main/Data/Chores/Professions"
    click DataTimers "https://github.com/foprc/choretracker/tree/main/Data/Timers"
    click ProfConfig "https://github.com/foprc/choretracker/blob/main/Data/Professions.lua"

    %% Click Event for Asset Module
    click Assets "https://github.com/foprc/choretracker/tree/main/Assets"

    %% Click Events for Dependency Libraries
    click AceAddon "https://github.com/foprc/choretracker/blob/main/Libs/AceAddon-3.0"
    click AceBucket "https://github.com/foprc/choretracker/blob/main/Libs/AceBucket-3.0"
    click AceConfig "https://github.com/foprc/choretracker/blob/main/Libs/AceConfig-3.0"
    click AceConsole "https://github.com/foprc/choretracker/blob/main/Libs/AceConsole-3.0"
    click AceDB "https://github.com/foprc/choretracker/blob/main/Libs/AceDB-3.0"
    click AceDBOptions "https://github.com/foprc/choretracker/blob/main/Libs/AceDBOptions-3.0"
    click AceEvent "https://github.com/foprc/choretracker/blob/main/Libs/AceEvent-3.0"
    click AceGUIDep "https://github.com/foprc/choretracker/blob/main/Libs/AceGUI-3.0"
    click AceHook "https://github.com/foprc/choretracker/blob/main/Libs/AceHook-3.0"
    click AceLocale "https://github.com/foprc/choretracker/blob/main/Libs/AceLocale-3.0"
    click AceTimer "https://github.com/foprc/choretracker/blob/main/Libs/AceTimer-3.0"
    click CallbackHandler "https://github.com/foprc/choretracker/blob/main/Libs/CallbackHandler-1.0"
    click LibCandyBar "https://github.com/foprc/choretracker/blob/main/Libs/LibCandyBar-3.0"
    click LibSharedMedia "https://github.com/foprc/choretracker/blob/main/Libs/LibSharedMedia-3.0"
    click LibStub "https://github.com/foprc/choretracker/tree/main/Libs/LibStub"

    %% Style Classes
    classDef core fill:#aqua,stroke:#000,stroke-width:2px;
    classDef module fill:#ccffcc,stroke:#000,stroke-width:2px;
    classDef ui fill:#ffffcc,stroke:#000,stroke-width:2px;
    classDef data fill:#ffddcc,stroke:#000,stroke-width:2px;
    classDef asset fill:#e0ccff,stroke:#000,stroke-width:2px;
    classDef lib fill:#cccccc,stroke:#000,stroke-width:2px;
```
