# kyoripowered/adventure architecture

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

- Interactive diagram: https://gitdiagram.com/kyoripowered/adventure
- Repository: https://github.com/kyoripowered/adventure

## Overview

##### Project Type and Purpose
- This is a multi-module Java library (“adventure”) providing a serverside UI toolkit for Minecraft: Java Edition.
- It exposes a core API (components, text, boss bars, inventories, permissions, translation, etc.) and ships a variety of implementations and extensions (serialization layers, logging adapters, Kotlin DSLs, annotation processors, etc.).

##### File-Structure Analysis
- Top-level modules:
– build-logic: custom Gradle conventions/plugins
– bom: Maven bill-of-materials for consistent versions
– annotation-processors: build-time code generators (PlatformAPIAnnotationProcessor)
- Core modules:
– api: the public interfaces and core data models (Component, Audience, BossBar, Title, etc.) plus JMH benchmarks
– key: utilities for namespaced keys
– nbt: model and I/O for Named Binary Tag structures
- Serialization modules: each implements converting Components or NBT to/from various formats:
– serializer-commons: shared serialization utilities
– serializer-configurate4: Configurate4 support
– text-serializer-ansi, text-serializer-plain, text-serializer-legacy, text-serializer-gson, text-serializer-json (plus legacy impls)
- Text-processing modules:
– text-minimessage: parser/serializer for MiniMessage markup
– text-logger-slf4j: SLF4J-based Component logger
- Language-specific extension:
– extra-kotlin: Kotlin DSL and extension functions for the API

##### Key Architectural Patterns
- Layered architecture:
– Core API layer (interfaces + data models)
– Extension/implementation layer (serialization, logging, DSLs)
– Build-time tooling (annotation processors, custom Gradle logic)
- Plugin pattern: consumers can pick and combine only the modules they need (e.g., JSON serializer, MiniMessage, NBT I/O).
- Shared-core principle: every implementation module depends on api (and often on serializer-commons) rather than on each other, enabling loose coupling.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Build-time Tools
    subgraph "Build-time Tools"
        BL["build-logic"]:::build
        AP["annotation-processors"]:::build
        BOM["bom"]:::build
    end

    %% Core API Layer
    subgraph "Core API Layer"
        API["api"]:::core
        KEY["key"]:::core
        NBT["nbt"]:::core
    end

    %% Serialization Layer
    subgraph "Serialization Layer"
        COMMS["text-serializer-commons"]:::serial
        CONF4["serializer-configurate4"]:::serial
        ANSI["text-serializer-ansi"]:::serial
        PLAIN["text-serializer-plain"]:::serial
        LEG["text-serializer-legacy"]:::serial
        GS["text-serializer-gson"]:::serial
        GSLEG["text-serializer-gson-legacy-impl"]:::serial
        JSON["text-serializer-json"]:::serial
        JSLEG["text-serializer-json-legacy-impl"]:::serial
    end

    %% Text Processing Layer
    subgraph "Text Processing Layer"
        MM["text-minimessage"]:::text
        SLF["text-logger-slf4j"]:::text
    end

    %% Extensions
    subgraph "Extensions"
        KT["extra-kotlin"]:::ext
    end

    %% External Dependencies
    JDK["JDK 8+"]:::external
    SLFJ["SLF4J"]:::external
    CONF4EXT["Configurate4"]:::external
    GSONEXT["Gson"]:::external

    %% Dependencies
    AP -.->|invoked at compile time| API
    BOM -.->|manages versions| API
    BOM -.->|manages versions| COMMS

    COMMS -->|used by| CONF4
    COMMS -->|used by| ANSI
    COMMS -->|used by| PLAIN
    COMMS -->|used by| LEG
    COMMS -->|used by| GS
    COMMS -->|used by| GSLEG
    COMMS -->|used by| JSON
    COMMS -->|used by| JSLEG

    CONF4 -->|depends on| API
    ANSI -->|depends on| API
    PLAIN -->|depends on| API
    LEG -->|depends on| API
    GS -->|depends on| API
    GSLEG -->|depends on| API
    JSON -->|depends on| API
    JSLEG -->|depends on| API

    MM -->|depends on| API
    MM -->|depends on| COMMS
    SLF -->|depends on| API
    SLF -->|depends on| SLFJ
    KT -->|depends on| API

    CONF4 -->|integrates with| CONF4EXT
    GS -->|integrates with| GSONEXT

    %% Build-time to Core
    BL -->|provides Gradle conventions| API

    %% External JDK
    API -->|runs on| JDK

    %% Click Events
    click BL "https://github.com/kyoripowered/adventure/tree/main/4/build-logic/"
    click AP "https://github.com/kyoripowered/adventure/tree/main/4/annotation-processors/"
    click BOM "https://github.com/kyoripowered/adventure/tree/main/4/bom/"
    click API "https://github.com/kyoripowered/adventure/tree/main/4/api/"
    click KEY "https://github.com/kyoripowered/adventure/tree/main/4/key/"
    click NBT "https://github.com/kyoripowered/adventure/tree/main/4/nbt/"
    click COMMS "https://github.com/kyoripowered/adventure/tree/main/4/text-serializer-commons/"
    click CONF4 "https://github.com/kyoripowered/adventure/tree/main/4/serializer-configurate4/"
    click ANSI "https://github.com/kyoripowered/adventure/tree/main/4/text-serializer-ansi/"
    click PLAIN "https://github.com/kyoripowered/adventure/tree/main/4/text-serializer-plain/"
    click LEG "https://github.com/kyoripowered/adventure/tree/main/4/text-serializer-legacy/"
    click GS "https://github.com/kyoripowered/adventure/tree/main/4/text-serializer-gson/"
    click GSLEG "https://github.com/kyoripowered/adventure/tree/main/4/text-serializer-gson-legacy-impl/"
    click JSON "https://github.com/kyoripowered/adventure/tree/main/4/text-serializer-json/"
    click JSLEG "https://github.com/kyoripowered/adventure/tree/main/4/text-serializer-json-legacy-impl/"
    click MM "https://github.com/kyoripowered/adventure/tree/main/4/text-minimessage/"
    click SLF "https://github.com/kyoripowered/adventure/tree/main/4/text-logger-slf4j/"
    click KT "https://github.com/kyoripowered/adventure/tree/main/4/extra-kotlin/"

    %% Styles
    classDef build fill:#cccccc,stroke:#333,stroke-width:1px
    classDef core fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef serial fill:#90ee90,stroke:#333,stroke-width:1px
    classDef text fill:#ffa500,stroke:#333,stroke-width:1px
    classDef ext fill:#dda0dd,stroke:#333,stroke-width:1px
    classDef external fill:#f0f0f0,stroke:#333,stroke-width:1px
```
