# thepaperpilot/profectus architecture

> Architecture diagram of the GitHub repository thepaperpilot/profectus, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thepaperpilot/profectus
- Repository: https://github.com/thepaperpilot/profectus

## Overview

##### Supporting Systems (Side Panels)

Left Panel:
- Utility Services
- Formula System (src/game/formulas)
- Modifier System (src/game/modifiers)
- Requirements System (src/game/requirements)

Right Panel:
- External Integrations
- Break_eternity.js Integration
- PIXI.js Integration
- Testing Framework

- Core Engine: Deep Blue
- Feature Modules: Green
- UI Components: Light Blue
- Utility Services: Orange
- External Integrations: Gray

Specific Implementation Details:

##### Feature Modules should be represented as connected rectangles, each with
- Module Name
- Key Components

##### UI Layer should be represented as a series of connected components showing
- Component Hierarchy
- Vue Component Integration
- Event Handling Flow

- Component lifecycle
- Data persistence flow
- Event propagation

##### Development tools integration
- Vite integration
- Testing framework
- Build process

- Nested components
- Grouping and layers
- Export to high-resolution formats

Remember to maintain a balance between detail and clarity, focusing on the architectural relationships while avoiding overwhelming detail at the component level.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef core fill:#2E4057,color:white
    classDef feature fill:#4CAF50,color:white
    classDef ui fill:#03A9F4,color:white
    classDef util fill:#FF9800,color:white
    classDef external fill:#9E9E9E,color:white

    %% Core Engine Layer
    subgraph CoreEngine["Core Engine Layer"]
        GameLoop["Game Loop"]:::core
        StateManagement["State Management"]:::core
        Persistence["Persistence"]:::core
        Events["Events System"]:::core
        PlayerManagement["Player Management"]:::core
        LayerManagement["Layer Management"]:::core
        Notifications["Notifications"]:::core
        Settings["Settings"]:::core
    end

    %% Feature Modules Layer
    subgraph Features["Feature Modules"]
        Resources["Resources System"]:::feature
        Achievements["Achievement System"]:::feature
        Challenges["Challenge System"]:::feature
        Clickables["Clickables System"]:::feature
        Particles["Particles System"]:::feature
        Trees["Tree System"]:::feature
        Boards["Board System"]:::feature
    end

    %% UI Layer
    subgraph UIComponents["UI Components"]
        Layout["Layout Components"]:::ui
        Fields["Field Components"]:::ui
        Modals["Modal Components"]:::ui
        Math["Math Components"]:::ui
    end

    %% Supporting Systems
    subgraph Utils["Utility Services"]
        Formulas["Formula System"]:::util
        Modifiers["Modifier System"]:::util
        Requirements["Requirements System"]:::util
    end

    %% External Integrations
    subgraph External["External Integrations"]
        BreakEternity["Break_eternity.js"]:::external
        PIXI["PIXI.js"]:::external
    end

    %% Relationships
    CoreEngine --> Features
    Features --> UIComponents
    Utils --> CoreEngine
    Utils --> Features
    External --> CoreEngine

    %% Click Events
    click GameLoop "https://github.com/thepaperpilot/profectus/blob/main/src/game/gameLoop.ts"
    click StateManagement "https://github.com/thepaperpilot/profectus/blob/main/src/game/state.ts"
    click Persistence "https://github.com/thepaperpilot/profectus/blob/main/src/game/persistence.ts"
    click Events "https://github.com/thepaperpilot/profectus/blob/main/src/game/events.ts"
    click PlayerManagement "https://github.com/thepaperpilot/profectus/blob/main/src/game/player.ts"
    click LayerManagement "https://github.com/thepaperpilot/profectus/blob/main/src/game/layers.tsx"
    click Notifications "https://github.com/thepaperpilot/profectus/blob/main/src/game/notifications.ts"
    click Settings "https://github.com/thepaperpilot/profectus/blob/main/src/game/settings.ts"
    
    click Resources "https://github.com/thepaperpilot/profectus/tree/main/src/features/resources"
    click Achievements "https://github.com/thepaperpilot/profectus/tree/main/src/features/achievements"
    click Challenges "https://github.com/thepaperpilot/profectus/tree/main/src/features/challenges"
    click Clickables "https://github.com/thepaperpilot/profectus/tree/main/src/features/clickables"
    click Particles "https://github.com/thepaperpilot/profectus/tree/main/src/features/particles"
    click Trees "https://github.com/thepaperpilot/profectus/tree/main/src/features/trees"
    click Boards "https://github.com/thepaperpilot/profectus/tree/main/src/game/boards"
    
    click Layout "https://github.com/thepaperpilot/profectus/tree/main/src/components/layout"
    click Fields "https://github.com/thepaperpilot/profectus/tree/main/src/components/fields"
    click Modals "https://github.com/thepaperpilot/profectus/tree/main/src/components/modals"
    click Math "https://github.com/thepaperpilot/profectus/tree/main/src/components/math"
    
    click Formulas "https://github.com/thepaperpilot/profectus/tree/main/src/game/formulas"
    click Modifiers "https://github.com/thepaperpilot/profectus/blob/main/src/game/modifiers.tsx"
    click Requirements "https://github.com/thepaperpilot/profectus/blob/main/src/game/requirements.tsx"
    
    click BreakEternity "https://github.com/thepaperpilot/profectus/blob/main/src/lib/break_eternity.ts"
    click PIXI "https://github.com/thepaperpilot/profectus/blob/main/src/lib/pixi.ts"

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Feature Modules]:::feature
        L3[UI Components]:::ui
        L4[Utility Services]:::util
        L5[External Integrations]:::external
    end
```
