# etjump/etjump architecture

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

- Interactive diagram: https://gitdiagram.com/etjump/etjump
- Repository: https://github.com/etjump/etjump

## Overview

##### Main Components Identification
- Game Module (src/game)
- Client Game Module (src/cgame)
- UI Module (src/ui)

##### Architecture Overview

a) Core Layer:
- Game Engine Integration (syscalls)
- Shared Components (q_shared, bg_*)
- Database System (etj_database*)

b) Game Logic Layer:
- Timerun System (etj_timerun*)
- Save System (etj_save_system)
- RTV System (etj_rtv)
- Player Management (etj_user)
- Command System (etj_command*)

c) Client Layer:
- HUD Components
- Visual Feedback Systems
- Input Handling
- Demo Recording

d) UI Layer:
- Menu System
- Settings Interface
- Custom UI Components

##### Key Relationships to Highlight

- Data flow between modules
- Component dependencies
- Client-server communication
- Event handling paths

##### External Dependencies
Integration with:
- SQLite (deps/sqlite)
- JSON processing (deps/json)
- Format library (deps/fmt)
- Testing framework (deps/gtest)

##### Additional Elements

Include:
- Version control integration
- Build system components
- Asset management
- Testing framework integration

- Component types
- Data flow indicators
- Module boundaries
- Integration points
- Dependency types

Keep the abstraction level high enough to show the overall architecture while including sufficient detail to understand the relationships between major components and the flow of data through the system.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef core fill:#e0e0e0,stroke:#333
    classDef game fill:#b3d9ff,stroke:#333
    classDef client fill:#b3ffb3,stroke:#333
    classDef ui fill:#ffcc99,stroke:#333
    classDef db fill:#e6b3ff,stroke:#333
    classDef deps fill:#ffb3b3,stroke:#333

    %% Core Layer
    subgraph CoreLayer
        Engine["Game Engine Integration"]:::core
        Shared["Shared Components"]:::core
        BGMove["Movement System"]:::core
    end

    %% Game Logic Layer
    subgraph GameLogic
        GameMod["Game Module"]:::game
        TimeRun["Timerun System"]:::game
        SaveSys["Save System"]:::game
        RTVSys["RTV System"]:::game
        PlayerMgmt["Player Management"]:::game
        CmdSys["Command System"]:::game
        AuthSys["Authentication System"]:::game
        MapStats["Statistics Tracking"]:::game
        Portal["Portal Gun System"]:::game
        DB["Database System"]:::db
    end

    %% Client Layer
    subgraph ClientLayer
        CGMod["Client Game Module"]:::client
        HUD["HUD Components"]:::client
        Visual["Visual Feedback"]:::client
        Input["Input Handling"]:::client
        Demo["Demo Recording"]:::client
    end

    %% UI Layer
    subgraph UILayer
        UIMod["UI Module"]:::ui
        Menu["Menu System"]:::ui
        Settings["Settings Interface"]:::ui
        ColorPick["Color Picker"]:::ui
        CustomUI["Custom UI Components"]:::ui
    end

    %% External Dependencies
    subgraph Dependencies
        SQLite["SQLite"]:::deps
        JSON["JSON Processing"]:::deps
        FMT["Format Library"]:::deps
        GTest["Testing Framework"]:::deps
    end

    %% Relationships
    Engine --> GameMod
    Engine --> CGMod
    Engine --> UIMod
    GameMod --> DB
    DB --> SQLite
    GameMod --> TimeRun
    GameMod --> SaveSys
    GameMod --> RTVSys
    GameMod --> PlayerMgmt
    GameMod --> CmdSys
    GameMod --> AuthSys
    GameMod --> MapStats
    GameMod --> Portal
    CGMod --> HUD
    CGMod --> Visual
    CGMod --> Input
    CGMod --> Demo
    UIMod --> Menu
    UIMod --> Settings
    UIMod --> ColorPick
    UIMod --> CustomUI
    BGMove --> GameMod
    BGMove --> CGMod

    %% Click Events
    click GameMod "https://github.com/etjump/etjump/tree/master/src/game/"
    click CGMod "https://github.com/etjump/etjump/tree/master/src/cgame/"
    click UIMod "https://github.com/etjump/etjump/tree/master/src/ui/"
    click DB "https://github.com/etjump/etjump/blob/master/src/game/etj_database.cpp"
    click TimeRun "https://github.com/etjump/etjump/blob/master/src/game/etj_timerun_v2.cpp"
    click SaveSys "https://github.com/etjump/etjump/blob/master/src/game/etj_save_system.cpp"
    click RTVSys "https://github.com/etjump/etjump/blob/master/src/game/etj_rtv.cpp"
    click CmdSys "https://github.com/etjump/etjump/blob/master/src/game/etj_command_parser.cpp"
    click AuthSys "https://github.com/etjump/etjump/blob/master/src/game/etj_iauthentication.h"
    click HUD "https://github.com/etjump/etjump/blob/master/src/cgame/etj_cvar_master_drawer.cpp"
    click Demo "https://github.com/etjump/etjump/blob/master/src/cgame/etj_demo_recorder.cpp"
    click Visual "https://github.com/etjump/etjump/blob/master/src/cgame/etj_drawable.cpp"
    click Menu "https://github.com/etjump/etjump/blob/master/src/ui/ui_main.cpp"
    click ColorPick "https://github.com/etjump/etjump/blob/master/src/ui/etj_colorpicker.cpp"
    click SQLite "https://github.com/etjump/etjump/tree/master/deps/sqlite/"
    click JSON "https://github.com/etjump/etjump/tree/master/deps/json/"
    click FMT "https://github.com/etjump/etjump/tree/master/deps/fmt/"
    click GTest "https://github.com/etjump/etjump/tree/master/deps/gtest/"
    click Portal "https://github.com/etjump/etjump/blob/master/assets/weapons/portalgun.weap"
    click BGMove "https://github.com/etjump/etjump/blob/master/src/game/bg_pmove.cpp"
    click MapStats "https://github.com/etjump/etjump/blob/master/src/game/etj_map_statistics.cpp"

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Game Logic"]:::game
        L3["Client Features"]:::client
        L4["UI Elements"]:::ui
        L5["Database Systems"]:::db
        L6["External Dependencies"]:::deps
    end
```
