# goodtimes14/pivot architecture

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

- Interactive diagram: https://gitdiagram.com/goodtimes14/pivot
- Repository: https://github.com/goodtimes14/pivot

## Overview

##### Main Components

a. Core Module
- Command Framework
- Database Layer
- Redis Integration
- Configuration System
- API Interfaces
- Type Conversion System

b. Platform-Specific Implementations
- Spigot Implementation
- BungeeCord Implementation
- Velocity Implementation

##### Connection Flows

- Platform implementations extending core interfaces
- Command flow from platform to core command system
- Database interactions
- Redis publish/subscribe patterns
- Configuration loading paths

##### Specific Implementation Details

- Annotation processing flow
- Command registration service
- Method handling system
- Tab completion system

b. Database Component:
- Connection pooling
- Query building
- Lock management
- Data access objects

c. Redis Component:
- Caching system
- Pub/Sub messaging
- Listener framework

##### Important Relationships to Highlight

- How PivotAPI interfaces with all platform implementations
- Demonstrate the command flow from platform-specific command executors to the core command system
- Database connection pooling and management
- Redis message flow between servers

##### Additional Elements

- Notes for important configuration points
- Extension points for plugin developers
- Version compatibility information

##### Technical Details

- HikariCP connection pooling
- Lettuce Redis client integration
- Command annotation system
- Type conversion system
- Configuration management

Remember to include:
- Version compatibility information
- Required dependencies
- Extension points for developers
- Configuration requirements
- Platform-specific considerations

This will create a comprehensive system design that accurately represents the Pivot framework's architecture while maintaining clarity and usefulness for developers working with the system.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Platform Layer
    subgraph Platforms
        SpigotImpl["Spigot Implementation"]:::spigot
        BungeeImpl["BungeeCord Implementation"]:::bungee
        VelocityImpl["Velocity Implementation"]:::velocity
    end

    %% Core Layer
    subgraph Core["Core API"]
        PivotAPI["PivotAPI Interface"]:::core
        
        subgraph CommandSystem["Command Framework"]
            CmdAnnotations["Command Annotations"]:::command
            CmdMethods["Command Methods"]:::command
            CmdExec["Command Executor"]:::command
        end
        
        subgraph Database["Database System"]
            HikariCP["HikariCP Connection"]:::database
            QueryBuilder["Query Builder"]:::database
            LockManager["Lock Management"]:::database
        end
        
        subgraph Redis["Redis Integration"]
            LettuceClient["Lettuce Client"]:::redis
            RedisCache["Redis Cache"]:::redis
            RedisListeners["Redis Listeners"]:::redis
        end
        
        Config["Configuration System"]:::config
        TypeConv["Type Conversion System"]:::core
    end

    %% Infrastructure Layer
    subgraph Infrastructure
        SQL[(SQL Database)]:::database
        RedisDB[(Redis Server)]:::redis
        ConfigFiles[("Configuration Files")]:::config
    end

    %% Platform-specific Command Systems
    SpigotCmd["Spigot Commands"]:::spigot
    BungeeCmd["BungeeCord Commands"]:::bungee
    VelocityCmd["Velocity Commands"]:::velocity

    %% Relationships
    SpigotImpl --> PivotAPI
    BungeeImpl --> PivotAPI
    VelocityImpl --> PivotAPI

    SpigotImpl --> SpigotCmd
    BungeeImpl --> BungeeCmd
    VelocityImpl --> VelocityCmd

    SpigotCmd --> CmdExec
    BungeeCmd --> CmdExec
    VelocityCmd --> CmdExec

    CmdExec --> CmdAnnotations
    CmdExec --> CmdMethods

    PivotAPI --> Database
    PivotAPI --> Redis
    PivotAPI --> Config
    PivotAPI --> TypeConv

    Database --> SQL
    Redis --> RedisDB
    Config --> ConfigFiles

    %% Click Events
    click PivotAPI "https://github.com/GoodTimes14/Pivot/blob/2.0-REBORN/core/src/main/java/eu/magicmine/pivot/api/PivotAPI.java"
    click CmdAnnotations "https://github.com/GoodTimes14/Pivot/tree/2.0-REBORN/core/src/main/java/eu/magicmine/pivot/api/commands/annotation/"
    click CmdMethods "https://github.com/GoodTimes14/Pivot/tree/2.0-REBORN/core/src/main/java/eu/magicmine/pivot/api/commands/methods/"
    click HikariCP "https://github.com/GoodTimes14/Pivot/blob/2.0-REBORN/core/src/main/java/eu/magicmine/pivot/api/database/connection/impl/HikariConnection.java"
    click QueryBuilder "https://github.com/GoodTimes14/Pivot/blob/2.0-REBORN/core/src/main/java/eu/magicmine/pivot/api/database/query/QueryBuilder.java"
    click LockManager "https://github.com/GoodTimes14/Pivot/tree/2.0-REBORN/core/src/main/java/eu/magicmine/pivot/api/database/lock/"
    click LettuceClient "https://github.com/GoodTimes14/Pivot/blob/2.0-REBORN/core/src/main/java/eu/magicmine/pivot/api/redis/LettuceConnection.java"
    click RedisCache "https://github.com/GoodTimes14/Pivot/tree/2.0-REBORN/core/src/main/java/eu/magicmine/pivot/api/redis/cache/"
    click RedisListeners "https://github.com/GoodTimes14/Pivot/tree/2.0-REBORN/core/src/main/java/eu/magicmine/pivot/api/redis/listener/"
    click Config "https://github.com/GoodTimes14/Pivot/tree/2.0-REBORN/core/src/main/java/eu/magicmine/pivot/api/configuration/"
    click TypeConv "https://github.com/GoodTimes14/Pivot/blob/2.0-REBORN/core/src/main/java/eu/magicmine/pivot/api/conversion/manager/ConversionManager.java"
    click SpigotImpl "https://github.com/GoodTimes14/Pivot/blob/2.0-REBORN/spigot/src/main/java/eu/magicmine/pivot/spigot/PivotSpigot.java"
    click BungeeImpl "https://github.com/GoodTimes14/Pivot/blob/2.0-REBORN/bungee/src/main/java/eu/magicmine/pivot/bungee/PivotBungee.java"
    click VelocityImpl "https://github.com/GoodTimes14/Pivot/blob/2.0-REBORN/velocity/src/main/java/eu/magicmine/pivot/velocity/PivotVelocity.java"
    click SpigotCmd "https://github.com/GoodTimes14/Pivot/tree/2.0-REBORN/spigot/src/main/java/eu/magicmine/pivot/spigot/command/"
    click BungeeCmd "https://github.com/GoodTimes14/Pivot/tree/2.0-REBORN/bungee/src/main/java/eu/magicmine/pivot/bungee/command/"
    click VelocityCmd "https://github.com/GoodTimes14/Pivot/tree/2.0-REBORN/velocity/src/main/java/eu/magicmine/pivot/velocity/command/"

    %% Styling
    classDef spigot fill:#90EE90,stroke:#333,stroke-width:2px
    classDef bungee fill:#FFA500,stroke:#333,stroke-width:2px
    classDef velocity fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef core fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef command fill:#4169E1,stroke:#333,stroke-width:2px
    classDef database fill:#FFD700,stroke:#333,stroke-width:2px
    classDef redis fill:#FF6B6B,stroke:#333,stroke-width:2px
    classDef config fill:#98FB98,stroke:#333,stroke-width:2px
```
