# martijn-heil/fables-and-fantasy-rp architecture

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

- Interactive diagram: https://gitdiagram.com/martijn-heil/fables-and-fantasy-rp
- Repository: https://github.com/martijn-heil/fables-and-fantasy-rp

## Overview

This project is a multi-module Gradle repository that produces a suite of independent Spigot plugins written in Kotlin. Each subproject (located mostly under the “plugin” directory) corresponds to a distinct functional or technical plugin for a Minecraft role-playing server. The project also contains dedicated directories for build conventions (buildSrc), code examples (examples), and third‐party dependency jars (lib).

##### Build and Deployment Infrastructure
- A “Gradle Build System” component at the top. Note that the buildSrc module is used as the centralized conventions plugin for dependency management, configuration, and shared build rules.
- “Deployment Scripts” (e.g., deployto.sh, dependencies.sh) that take the produced plugin JAR files and copy them to the destination server.
- Overall build pipeline: source code (per subproject) → Gradle build → Individual plugin JARs.

##### Modular Plugin Architecture
- Subprojects into logical clusters. For instance, the “plugin/core” folder holds key function plugins (Characters, Chat, Economy, Inventory, etc.); “plugin/extra” contains add‑ons (Activity, DailyRewards, FastTravel and others); and “plugin/technical” includes integrations (Database, DenizenInterop, Discord, WorldGuardInterop, etc.).
– Core plugins (direct gameplay systems),
– Extra plugins (optional or add-on systems), and
– Technical plugins (infrastructure, integrations, and utilities).

##### Runtime and External Dependencies
- Connections from plugins to external libraries or systems:
– Database components (H2 Database, migration scripts, and associated repository layers) for persistence support.
– Third‑party jar dependencies from the “lib” folder and any external APIs referenced in the README (e.g., Spigot Javadocs).
- Mention that many plugins follow similar architectural patterns: a main plugin class, event listeners, commands, domain layers (for data and business logic), and sometimes web or interop modules (e.g., for Discord and Denizen).

- If space permits, include annotations that mention key design principles applied in the project – such as modularity (each plugin is a self-contained subproject), separation of concerns (domain logic, presentation via GUIs, data persistence), and the event‐driven architecture typical of Spigot plugins.
- Depicting a layered view: the top layer shows build/deployment processes, the middle layer shows the various plugin modules interacting with the Spigot server, and the bottom layer shows data sources (e.g., H2 database, configuration files) and external integrations (Discord, Denizen).

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Build & Deployment Infrastructure
    subgraph "Build & Deployment Infrastructure"
        direction TB
        subgraph "Gradle Build System"
            direction TB
            gradle1["build.gradle.kts"]:::buildInfra
            gradle2["settings.gradle.kts"]:::buildInfra
            buildSrc["buildSrc"]:::buildInfra
        end
        subgraph "Deployment Scripts"
            direction TB
            dep1["dependencies.sh"]:::deploymentScript
            dep2["deployto.sh"]:::deploymentScript
            dep3["nmsupdate.sh"]:::deploymentScript
        end
    end

    %% Jar Output and Deployment Process
    jar["Plugin JARs"]:::jarOutput
    deployProc["Deployment Process"]:::deployProcess

    %% Modular Plugin Architecture
    subgraph "Modular Plugin Architecture"
        direction TB
        subgraph "Core Plugins"
            direction TB
            core1["Characters"]:::pluginCore
            core2["Chat"]:::pluginCore
            core3["Economy"]:::pluginCore
        end
        subgraph "Extra Plugins"
            direction TB
            extra1["Activity"]:::pluginExtra
            extra2["FastTravel"]:::pluginExtra
        end
        subgraph "Technical Plugins"
            direction TB
            tech1["Database"]:::pluginTech
            tech2["Discord"]:::pluginTech
            tech3["DenizenInterop"]:::pluginTech
            tech4["WorldGuardInterop"]:::pluginTech
        end
    end

    %% Runtime and External Dependencies
    subgraph "Runtime & External Dependencies"
        direction TB
        spigot["Spigot Server Platform"]:::runtime
        extLib["Third-Party Jars"]:::runtime
        extEx["Plugin Examples"]:::runtime
    end

    %% Relationships / Data Flow
    %% Build Pipeline
    buildSrc --> jar
    core1 --> jar
    extra1 --> jar
    tech1 --> jar
    jar --> dep2
    dep2 --> deployProc
    deployProc --> spigot

    %% Direct plugin attachment to runtime
    core2 --> spigot
    core3 --> spigot
    extra2 --> spigot
    tech2 --> spigot
    tech3 --> spigot
    tech4 --> spigot

    %% Integration between technical plugins
    tech2 -->|"integrates-with"| tech1
    tech2 -->|"integrates-with"| tech3

    %% External dependencies
    extLib --> spigot
    extEx --> spigot

    %% Styles
    classDef buildInfra fill:#FDE28A,stroke:#333,stroke-width:2px;
    classDef deploymentScript fill:#FFD1DC,stroke:#333,stroke-width:2px;
    classDef jarOutput fill:#E6E6FA,stroke:#333,stroke-width:2px;
    classDef deployProcess fill:#D1F2EB,stroke:#333,stroke-width:2px;
    classDef pluginCore fill:#C3FDB8,stroke:#333,stroke-width:2px;
    classDef pluginExtra fill:#B8DAF9,stroke:#333,stroke-width:2px;
    classDef pluginTech fill:#F9C0C0,stroke:#333,stroke-width:2px;
    classDef runtime fill:#E3C9F9,stroke:#333,stroke-width:2px;

    %% Click Events
    click gradle1 "https://github.com/martijn-heil/fables-and-fantasy-rp/blob/master/build.gradle.kts"
    click gradle2 "https://github.com/martijn-heil/fables-and-fantasy-rp/blob/master/settings.gradle.kts"
    click buildSrc "https://github.com/martijn-heil/fables-and-fantasy-rp/tree/master/buildSrc/"
    click dep1 "https://github.com/martijn-heil/fables-and-fantasy-rp/blob/master/script/dependencies.sh"
    click dep2 "https://github.com/martijn-heil/fables-and-fantasy-rp/blob/master/script/deployto.sh"
    click dep3 "https://github.com/martijn-heil/fables-and-fantasy-rp/blob/master/script/nmsupdate.sh"
    click core1 "https://github.com/martijn-heil/fables-and-fantasy-rp/tree/master/plugin/core/Characters"
    click core2 "https://github.com/martijn-heil/fables-and-fantasy-rp/tree/master/plugin/core/Chat"
    click core3 "https://github.com/martijn-heil/fables-and-fantasy-rp/tree/master/plugin/core/Economy"
    click extra1 "https://github.com/martijn-heil/fables-and-fantasy-rp/tree/master/plugin/extra/Activity"
    click extra2 "https://github.com/martijn-heil/fables-and-fantasy-rp/tree/master/plugin/extra/FastTravel"
    click tech1 "https://github.com/martijn-heil/fables-and-fantasy-rp/tree/master/plugin/technical/Database"
    click tech2 "https://github.com/martijn-heil/fables-and-fantasy-rp/tree/master/plugin/technical/Discord"
    click tech3 "https://github.com/martijn-heil/fables-and-fantasy-rp/tree/master/plugin/technical/DenizenInterop"
    click tech4 "https://github.com/martijn-heil/fables-and-fantasy-rp/tree/master/plugin/technical/WorldGuardInterop"
    click extLib "https://github.com/martijn-heil/fables-and-fantasy-rp/tree/master/lib/"
    click extEx "https://github.com/martijn-heil/fables-and-fantasy-rp/tree/master/examples/BlankSystem/"
```
