# bun3/bun3-kit architecture

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

- Interactive diagram: https://gitdiagram.com/bun3/bun3-kit
- Repository: https://github.com/bun3/bun3-kit

## Overview

bun3-kit is a personal framework monorepo: cross-platform gameplay libraries, reusable .NET server modules, and Unity packages. Gameplay tags flow from editable source documents through catalog compilation to runtime use; server modules provide hosting, transport, sessions, RPC, and player services. The tree also shows gameplay effects and attributes, achievements, items, Unity audio/acoustics, and UI. Several of these capabilities are represented from the tree rather than inspected source, so their internal connections are omitted.

Main entry points: [`common/src/com.bun3.gameplay/Runtime/Tags/TagCatalog.cs`](https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Runtime/Tags/TagCatalog.cs) (Runtime tag catalog), [`server/src/Bun3.Server.Transport.Tcp/TcpTransportListener.cs`](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Transport.Tcp/TcpTransportListener.cs) (TCP listener), [`common/src/com.bun3.gameplay/Runtime/Effects/EffectPipeline.cs`](https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Runtime/Effects/EffectPipeline.cs) (Effect pipeline), [`server/src/Bun3.Server.Hosting/PlayersServiceCollectionExtensions.cs`](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Hosting/PlayersServiceCollectionExtensions.cs) (Player hosting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Gameplay libraries"]
  node_tag_editor["Tag editor"]
  node_tag_edit_session["Tag edit session"]
  node_tag_build["Catalog build context"]
  node_tag_document["Tag source document"]
  node_tag_cli["Tag CLI<br/>[Program.cs]"]
  node_tag_runtime["Runtime tag catalog<br/>[TagCatalog.cs]"]
  node_tag_query["Tag queries"]
  node_effects["Effect pipeline<br/>[EffectPipeline.cs]"]
  node_bignum["Big numbers<br/>[BigNum.cs]"]
  node_attributes["Attributes<br/>[AttributeSet.cs]"]
end

subgraph group_server["Server modules"]
  node_achievements["Achievements"]
  node_items["Items and inventory<br/>[ItemInventory.cs]"]
  node_server_hosting["Server hosting"]
  node_player_hosting["Player hosting"]
  node_hosted_server["Hosted server<br/>[HostedServer.cs]"]
  node_tcp_listener["TCP listener"]
  node_session["Server session<br/>[Session.cs]"]
  node_connection["Connection contract<br/>[IConnection.cs]"]
  node_rpc_client["RPC client<br/>[RpcClient.cs]"]
  node_rpc_server["RPC server<br/>[RpcServer.cs]"]
  node_server_tag_setup["Server tag setup"]
  node_tag_loader["Tag catalog loader"]
end

subgraph group_unity["Unity packages"]
  node_audio["Sound system<br/>[SoundSystem.cs]"]
  node_acoustics["Acoustic grid queries"]
  node_popup_manager["Popup manager<br/>[PopupManager.cs]"]
end

subgraph group_common["Shared utilities"]
  node_common_pool["Object pooling"]
end

node_game_author(("Game developer"))
node_remote_peer(("Remote peer"))
node_tcp_network(("TCP network"))

node_tag_editor -->|"edits through"| node_tag_edit_session
node_tag_editor -->|"builds catalog"| node_tag_build
node_tag_build -->|"uses source"| node_tag_document
node_tag_cli -.->|"compiles sources"| node_tag_document
node_tag_query -->|"queries"| node_tag_runtime
node_effects -->|"reads tags"| node_tag_runtime
node_effects -->|"uses magnitudes"| node_bignum
node_effects -->|"applies modifiers"| node_attributes
node_server_hosting -->|"registers"| node_hosted_server
node_server_hosting -->|"configures"| node_tcp_listener
node_hosted_server -.->|"accepts connections"| node_tcp_listener
node_player_hosting -->|"creates"| node_rpc_server
node_player_hosting -->|"uses listener"| node_tcp_listener
node_player_hosting -.->|"creates sessions"| node_session
node_session -->|"sends through"| node_connection
node_rpc_client -->|"uses connection"| node_connection
node_remote_peer -.->|"connects over"| node_tcp_network
node_tcp_network -.->|"delivers packets"| node_tcp_listener
node_server_tag_setup -->|"registers loader"| node_tag_loader
node_server_tag_setup -->|"registers catalog"| node_tag_runtime
node_tag_loader -->|"loads catalog"| node_tag_runtime
node_game_author -.->|"edits tags"| node_tag_editor

click node_tag_editor "https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Editor/Tags/GameplayTagCatalogWindowController.cs"
click node_tag_edit_session "https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Editor/Tags/GameplayTagCatalogEditSession.cs"
click node_tag_build "https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Catalog/GameCatalogBuildContext.cs"
click node_tag_document "https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Catalog/TagSourceDocument.cs"
click node_tag_cli "https://github.com/bun3/bun3-kit/blob/main/common/src/Bun3.Gameplay.Tags.Cli/Program.cs"
click node_tag_runtime "https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Runtime/Tags/TagCatalog.cs"
click node_tag_query "https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Runtime/Tags/TagQueryContainer.cs"
click node_effects "https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Runtime/Effects/EffectPipeline.cs"
click node_bignum "https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Runtime/Numerics/BigNum.cs"
click node_attributes "https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Runtime/Attributes/AttributeSet.cs"
click node_achievements "https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Achievements/AchievementManager.cs"
click node_items "https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Items/ItemInventory.cs"
click node_server_hosting "https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Hosting/ServerServiceCollectionExtensions.cs"
click node_player_hosting "https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Hosting/PlayersServiceCollectionExtensions.cs"
click node_hosted_server "https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Hosting/HostedServer.cs"
click node_tcp_listener "https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Transport.Tcp/TcpTransportListener.cs"
click node_session "https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Core/Session.cs"
click node_connection "https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Abstractions/IConnection.cs"
click node_rpc_client "https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Rpc/RpcClient.cs"
click node_rpc_server "https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Rpc/RpcServer.cs"
click node_server_tag_setup "https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.GameplayTags/GameplayTagServiceCollectionExtensions.cs"
click node_tag_loader "https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.GameplayTags/GameplayTagCatalogLoader.cs"
click node_audio "https://github.com/bun3/bun3-kit/blob/main/unity/Packages/com.bun3.unity.audio/Runtime/SoundSystem.cs"
click node_acoustics "https://github.com/bun3/bun3-kit/blob/main/unity/Packages/com.bun3.unity.acoustics/Runtime/AcousticGridQuery.cs"
click node_popup_manager "https://github.com/bun3/bun3-kit/blob/main/unity/Packages/com.bun3.unity.ui/Runtime/Popups/PopupManager.cs"
click node_common_pool "https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.common/Runtime/Pooling/ConcurrentObjectPool.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_tag_editor,node_tag_edit_session,node_tag_build,node_tag_document,node_tag_cli,node_tag_runtime,node_tag_query,node_effects,node_bignum,node_attributes toneBlue
class node_achievements,node_items,node_server_hosting,node_player_hosting,node_hosted_server,node_tcp_listener,node_session,node_connection,node_rpc_client,node_rpc_server,node_server_tag_setup,node_tag_loader toneAmber
class node_audio,node_acoustics,node_popup_manager toneMint
class node_common_pool toneRose
class node_game_author,node_remote_peer,node_tcp_network toneIndigo
```

## Components

### Gameplay libraries

- [Tag editor](https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Editor/Tags/GameplayTagCatalogWindowController.cs): `common/src/com.bun3.gameplay/Editor/Tags/GameplayTagCatalogWindowController.cs`
- [Tag edit session](https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Editor/Tags/GameplayTagCatalogEditSession.cs): `common/src/com.bun3.gameplay/Editor/Tags/GameplayTagCatalogEditSession.cs`
- [Catalog build context](https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Catalog/GameCatalogBuildContext.cs): `common/src/com.bun3.gameplay/Catalog/GameCatalogBuildContext.cs`
- [Tag source document](https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Catalog/TagSourceDocument.cs): `common/src/com.bun3.gameplay/Catalog/TagSourceDocument.cs`
- [Tag CLI](https://github.com/bun3/bun3-kit/blob/main/common/src/Bun3.Gameplay.Tags.Cli/Program.cs): `common/src/Bun3.Gameplay.Tags.Cli/Program.cs`
- [Runtime tag catalog](https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Runtime/Tags/TagCatalog.cs): `common/src/com.bun3.gameplay/Runtime/Tags/TagCatalog.cs`
- [Tag queries](https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Runtime/Tags/TagQueryContainer.cs): `common/src/com.bun3.gameplay/Runtime/Tags/TagQueryContainer.cs`
- [Effect pipeline](https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Runtime/Effects/EffectPipeline.cs): `common/src/com.bun3.gameplay/Runtime/Effects/EffectPipeline.cs`
- [Big numbers](https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Runtime/Numerics/BigNum.cs): `common/src/com.bun3.gameplay/Runtime/Numerics/BigNum.cs`
- [Attributes](https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.gameplay/Runtime/Attributes/AttributeSet.cs): `common/src/com.bun3.gameplay/Runtime/Attributes/AttributeSet.cs`

### Server modules

- [Achievements](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Achievements/AchievementManager.cs): `server/src/Bun3.Server.Achievements/AchievementManager.cs`
- [Items and inventory](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Items/ItemInventory.cs): `server/src/Bun3.Server.Items/ItemInventory.cs`
- [Server hosting](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Hosting/ServerServiceCollectionExtensions.cs): `server/src/Bun3.Server.Hosting/ServerServiceCollectionExtensions.cs`
- [Player hosting](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Hosting/PlayersServiceCollectionExtensions.cs): `server/src/Bun3.Server.Hosting/PlayersServiceCollectionExtensions.cs`
- [Hosted server](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Hosting/HostedServer.cs): `server/src/Bun3.Server.Hosting/HostedServer.cs`
- [TCP listener](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Transport.Tcp/TcpTransportListener.cs): `server/src/Bun3.Server.Transport.Tcp/TcpTransportListener.cs`
- [Server session](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Core/Session.cs): `server/src/Bun3.Server.Core/Session.cs`
- [Connection contract](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Abstractions/IConnection.cs): `server/src/Bun3.Server.Abstractions/IConnection.cs`
- [RPC client](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Rpc/RpcClient.cs): `server/src/Bun3.Server.Rpc/RpcClient.cs`
- [RPC server](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.Rpc/RpcServer.cs): `server/src/Bun3.Server.Rpc/RpcServer.cs`
- [Server tag setup](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.GameplayTags/GameplayTagServiceCollectionExtensions.cs): `server/src/Bun3.Server.GameplayTags/GameplayTagServiceCollectionExtensions.cs`
- [Tag catalog loader](https://github.com/bun3/bun3-kit/blob/main/server/src/Bun3.Server.GameplayTags/GameplayTagCatalogLoader.cs): `server/src/Bun3.Server.GameplayTags/GameplayTagCatalogLoader.cs`

### Unity packages

- [Sound system](https://github.com/bun3/bun3-kit/blob/main/unity/Packages/com.bun3.unity.audio/Runtime/SoundSystem.cs): `unity/Packages/com.bun3.unity.audio/Runtime/SoundSystem.cs`
- [Acoustic grid queries](https://github.com/bun3/bun3-kit/blob/main/unity/Packages/com.bun3.unity.acoustics/Runtime/AcousticGridQuery.cs): `unity/Packages/com.bun3.unity.acoustics/Runtime/AcousticGridQuery.cs`
- [Popup manager](https://github.com/bun3/bun3-kit/blob/main/unity/Packages/com.bun3.unity.ui/Runtime/Popups/PopupManager.cs): `unity/Packages/com.bun3.unity.ui/Runtime/Popups/PopupManager.cs`

### Shared utilities

- [Object pooling](https://github.com/bun3/bun3-kit/blob/main/common/src/com.bun3.common/Runtime/Pooling/ConcurrentObjectPool.cs): `common/src/com.bun3.common/Runtime/Pooling/ConcurrentObjectPool.cs`

### Other components

- **Game developer**
- **Remote peer**
- **TCP network**

## Connections

- Tag editor → Tag edit session: edits through (evidence: `common/src/com.bun3.gameplay/Editor/Tags/GameplayTagCatalogWindowController.cs`)
- Tag editor → Catalog build context: builds catalog (evidence: `common/src/com.bun3.gameplay/Editor/Tags/GameplayTagCatalogWindowController.cs`)
- Catalog build context → Tag source document: uses source (evidence: `common/src/com.bun3.gameplay/Catalog/GameCatalogBuildContext.cs`)
- Tag CLI → Tag source document: compiles sources
- Tag queries → Runtime tag catalog: queries (evidence: `common/src/com.bun3.gameplay/Runtime/Tags/TagQueryContainer.cs`)
- Effect pipeline → Runtime tag catalog: reads tags (evidence: `common/src/com.bun3.gameplay/Runtime/Effects/EffectPipeline.cs`)
- Effect pipeline → Big numbers: uses magnitudes (evidence: `common/src/com.bun3.gameplay/Runtime/Effects/EffectPipeline.cs`)
- Effect pipeline → Attributes: applies modifiers (evidence: `common/src/com.bun3.gameplay/Runtime/Effects/EffectPipeline.cs`)
- Server hosting → Hosted server: registers (evidence: `server/src/Bun3.Server.Hosting/ServerServiceCollectionExtensions.cs`)
- Server hosting → TCP listener: configures (evidence: `server/src/Bun3.Server.Hosting/ServerServiceCollectionExtensions.cs`)
- Hosted server → TCP listener: accepts connections
- Player hosting → RPC server: creates (evidence: `server/src/Bun3.Server.Hosting/PlayersServiceCollectionExtensions.cs`)
- Player hosting → TCP listener: uses listener (evidence: `server/src/Bun3.Server.Hosting/PlayersServiceCollectionExtensions.cs`)
- Player hosting → Server session: creates sessions
- Server session → Connection contract: sends through (evidence: `server/src/Bun3.Server.Core/Session.cs`)
- RPC client → Connection contract: uses connection (evidence: `server/src/Bun3.Server.Rpc/RpcClient.cs`)
- Remote peer → TCP network: connects over
- TCP network → TCP listener: delivers packets
- Server tag setup → Tag catalog loader: registers loader (evidence: `server/src/Bun3.Server.GameplayTags/GameplayTagServiceCollectionExtensions.cs`)
- Server tag setup → Runtime tag catalog: registers catalog (evidence: `server/src/Bun3.Server.GameplayTags/GameplayTagServiceCollectionExtensions.cs`)
- Tag catalog loader → Runtime tag catalog: loads catalog
- Game developer → Tag editor: edits tags
