# tebexio/tebex-minecraft architecture

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

- Interactive diagram: https://gitdiagram.com/tebexio/tebex-minecraft
- Repository: https://github.com/tebexio/tebex-minecraft

## Overview

##### Project Type and Purpose
- The project is an open-source monetization engine for game (Minecraft) servers. Its aim is to integrate with different server platforms (Bukkit, Bungeecord, Fabric, Velocity) to sell in-game items and subscriptions.

##### Analyzing the File Structure
- The project is divided into multiple top-level directories, each corresponding to a specific platform integration:
- “bukkit” – Contains the Bukkit/Spigot plugin (with its own commands, events, GUI, and managers).
- “bungeecord” – Contains the BungeeCord/Waterfall plugin.
- “velocity” – Contains the Velocity plugin integration.
- Several “fabric” directories for different Minecraft versions (1.20.x, 1.21.x) – Each includes similar structure to handle Fabric integrations.
- “sdk” – Contains shared classes, APIs, and utility functions (such as request handling, object models, placeholders, platform abstraction, and helper utilities). This module is an essential backbone for handling common functionality across plugins.
- Also the presence of configuration files (build scripts, gradle setup, plugin descriptors like plugin.yml and fabric.mod.json) which indicate specific build and runtime setups for each platform.

##### Relationships and Interactions
- The flow from the plugin modules to the Shared SDK (e.g., plugin commands invoke SDK methods for processing store reactions).
- Communication from the SDK to the external Tebex service (for validating payments, pulling order info, handling commands to deliver items).
- Interaction between the plugins and the in-game events (for example, Listener components within each platform’s module that trigger command execution or GUI updates).

##### Highlighting Architectural Patterns and Key Technologies
- That the project is modular with a common SDK shared between different platform-specific implementations. This is an example of the “Modular Architecture” pattern.
- That each platform module follows similar architectural layers:
- Controller (Command handling and event listeners)
- GUI or Service Layer (managing in-game interactions like BuyGUI or TebexBuyScreenHandler)
- Manager Layer (CommandManager and similar classes)
- Rectangles for core modules (SDK, Plugin modules)
- Ovals for external systems (e.g., Tebex Web Store/Payment API)

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Plugin Modules"
        BP["Bukkit Plugin"]
        BCP["BungeeCord Plugin"]
        VP["Velocity Plugin"]
        subgraph "Fabric Plugins"
            F1["Fabric Plugin (1.20.1)"]
            F2["Fabric Plugin (1.20.4)"]
            F3["Fabric Plugin (1.21.1)"]
            F4["Fabric Plugin (1.21.4)"]
        end
    end

    SDK["Shared SDK"]
    External["Tebex Web Store / Payment API"]
    Build["Gradle Build Scripts & Config"]

    BP -->|"InvokesSDK"| SDK
    BCP -->|"InvokesSDK"| SDK
    VP -->|"InvokesSDK"| SDK
    F1 -->|"InvokesSDK"| SDK
    F2 -->|"InvokesSDK"| SDK
    F3 -->|"InvokesSDK"| SDK
    F4 -->|"InvokesSDK"| SDK

    SDK -->|"SendsRequest"| External
    External -->|"ReceivesResponse"| SDK

    Build -.->|"Builds"| BP
    Build -.->|"Builds"| BCP
    Build -.->|"Builds"| VP
    Build -.->|"Builds"| F1
    Build -.->|"Builds"| F2
    Build -.->|"Builds"| F3
    Build -.->|"Builds"| F4
    Build -.->|"Builds"| SDK

    click BP "https://github.com/tebexio/tebex-minecraft/blob/2.2.1/bukkit/src/main/java/io/tebex/plugin/TebexPlugin.java"
    click BCP "https://github.com/tebexio/tebex-minecraft/blob/2.2.1/bungeecord/src/main/java/io/tebex/plugin/TebexPlugin.java"
    click VP "https://github.com/tebexio/tebex-minecraft/blob/2.2.1/velocity/src/main/java/io/tebex/plugin/TebexPlugin.java"
    click F1 "https://github.com/tebexio/tebex-minecraft/blob/2.2.1/fabric-1.20.1/src/main/java/io/tebex/plugin/TebexPlugin.java"
    click F2 "https://github.com/tebexio/tebex-minecraft/blob/2.2.1/fabric-1.20.4/src/main/java/io/tebex/plugin/TebexPlugin.java"
    click F3 "https://github.com/tebexio/tebex-minecraft/blob/2.2.1/fabric-1.21.1/src/main/java/io/tebex/plugin/TebexPlugin.java"
    click F4 "https://github.com/tebexio/tebex-minecraft/blob/2.2.1/fabric-1.21.4/src/main/java/io/tebex/plugin/TebexPlugin.java"
    click SDK "https://github.com/tebexio/tebex-minecraft/tree/2.2.1/sdk/src/main/java/io/tebex/sdk"

    class BP,BCP,VP,F1,F2,F3,F4 plugin
    class SDK sdk
    class External external
    class Build build

    classDef plugin fill:#ADD8E6,stroke:#000,stroke-width:2px
    classDef sdk fill:#90EE90,stroke:#000,stroke-width:2px
    classDef external fill:#FFA500,stroke:#000,stroke-width:2px,stroke-dasharray: 5 5
    classDef build fill:#D3D3D3,stroke:#000,stroke-width:2px
```
