# bdubdesigns/runespace architecture

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

- Interactive diagram: https://gitdiagram.com/bdubdesigns/runespace
- Repository: https://github.com/bdubdesigns/runespace
- Video tour (about a minute): https://gitdiagram.com/bdubdesigns/runespace/video

## Overview

RuneSpace is a browser-first sci-fi RPG built as a server-authoritative modular monolith. A player creates a character, enters Play, and performs activities whose outcomes and progression are resolved and persisted on the server; the Play server composes activity state for the client shell. The graph also preserves account access, social, moderation, and public-world capabilities documented or represented in the tree. Some subsystem links are documented only at a high level; unsampled implementation details are not inferred.

Main entry points: [`server/actions.ts`](https://github.com/bdubdesigns/runespace/blob/main/server/actions.ts) (Server actions), [`db/rune-space.ts`](https://github.com/bdubdesigns/runespace/blob/main/db/rune-space.ts) (PostgreSQL data), [`features/play/PlayContext.tsx`](https://github.com/bdubdesigns/runespace/blob/main/features/play/PlayContext.tsx) (Play client shell), [`server/play.ts`](https://github.com/bdubdesigns/runespace/blob/main/server/play.ts) (Play orchestration and state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Player experience"]
  node_account["Registration and sign-in<br/>[SignInForm.tsx]"]
  node_characters["Character management"]
  node_playui["Play client shell<br/>[PlayContext.tsx]"]
  node_storageui["Storage transfers"]
end

subgraph group_gameplay["Gameplay systems"]
  node_travel["Travel and scavenging<br/>[JourneyPanel.tsx]"]
  node_mining["Mining<br/>[MiningActivity.tsx]"]
  node_refining["Refining"]
  node_fabrication["Fabrication and tinkering"]
  node_welding["Welding and repair"]
  node_inventory["Inventory and equipment<br/>[InventoryPanel.tsx]"]
  node_missions["Missions and progression"]
  node_world["Locations and NPCs"]
  node_playserver["Play orchestration and state<br/>[play.ts]"]
  node_actions["Server actions<br/>[actions.ts]"]
  node_trade["Player and NPC trade<br/>[trade.ts]"]
end

subgraph group_platform["Accounts and social"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_access["Gameplay access and ownership<br/>[gameplay-access.ts]"]
  node_social["Chat and realtime<br/>[chat.ts]"]
end

subgraph group_operations["Operations and content"]
  node_moderation["Moderation"]
  node_admin["Admin console"]
  node_public["Wiki and updates<br/>[PublicWikiPage.tsx]"]
end

subgraph group_persistence["Persistence"]
  node_database[("PostgreSQL data<br/>[rune-space.ts]")]
end

node_player(("Player"))

node_player -->|"registers"| node_account
node_player -->|"creates character"| node_characters
node_player -->|"plays"| node_playui
node_playui -->|"loads state"| node_playserver
node_playui -->|"submits commands"| node_actions
node_actions -->|"dispatches gameplay"| node_playserver
node_playserver -->|"reads and persists"| node_database
node_actions -.->|"resolves activity"| node_travel
node_actions -->|"resolves activity"| node_mining
node_actions -->|"resolves activity"| node_refining
node_actions -->|"dispatches commands"| node_fabrication
node_actions -->|"dispatches commands"| node_welding
node_actions -->|"completes missions"| node_missions
node_playui -->|"renders storage"| node_storageui
node_storageui -.->|"moves items"| node_inventory
node_characters -->|"checks access"| node_access
node_access -->|"reads access state"| node_database
node_access -->|"uses identity"| node_auth
node_social -.->|"stores messages"| node_database
node_moderation -->|"reads sanctions"| node_database
node_admin -.->|"manages cases"| node_moderation
node_trade -.->|"persists trades"| node_database
node_world -.->|"uses world state"| node_playserver
node_public -.->|"presents game info"| node_player

click node_account "https://github.com/bdubdesigns/runespace/blob/main/features/auth/SignInForm.tsx"
click node_characters "https://github.com/bdubdesigns/runespace/blob/main/features/characters/CreateCharacterForm.tsx"
click node_playui "https://github.com/bdubdesigns/runespace/blob/main/features/play/PlayContext.tsx"
click node_storageui "https://github.com/bdubdesigns/runespace/blob/main/features/storage/StorageTransferSurface.tsx"
click node_travel "https://github.com/bdubdesigns/runespace/blob/main/features/travel/JourneyPanel.tsx"
click node_mining "https://github.com/bdubdesigns/runespace/blob/main/features/mining/MiningActivity.tsx"
click node_refining "https://github.com/bdubdesigns/runespace/blob/main/features/refining/RefiningConsole.tsx"
click node_fabrication "https://github.com/bdubdesigns/runespace/blob/main/features/fabrication/FabricationStation.tsx"
click node_welding "https://github.com/bdubdesigns/runespace/blob/main/features/welding/RepairWorkPanel.tsx"
click node_inventory "https://github.com/bdubdesigns/runespace/blob/main/features/inventory/InventoryPanel.tsx"
click node_missions "https://github.com/bdubdesigns/runespace/blob/main/features/missions/MissionLogPanel.tsx"
click node_world "https://github.com/bdubdesigns/runespace/blob/main/features/location-scene/LocationSurface.tsx"
click node_playserver "https://github.com/bdubdesigns/runespace/blob/main/server/play.ts"
click node_actions "https://github.com/bdubdesigns/runespace/blob/main/server/actions.ts"
click node_auth "https://github.com/bdubdesigns/runespace/blob/main/server/auth.ts"
click node_access "https://github.com/bdubdesigns/runespace/blob/main/server/gameplay-access.ts"
click node_social "https://github.com/bdubdesigns/runespace/blob/main/server/chat.ts"
click node_trade "https://github.com/bdubdesigns/runespace/blob/main/server/trade.ts"
click node_moderation "https://github.com/bdubdesigns/runespace/blob/main/server/moderation-notices.ts"
click node_admin "https://github.com/bdubdesigns/runespace/blob/main/features/admin/AdminModerationPanel.tsx"
click node_public "https://github.com/bdubdesigns/runespace/blob/main/features/public-site/PublicWikiPage.tsx"
click node_database "https://github.com/bdubdesigns/runespace/blob/main/db/rune-space.ts"

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_account,node_characters,node_playui,node_storageui toneBlue
class node_travel,node_mining,node_refining,node_fabrication,node_welding,node_inventory,node_missions,node_world,node_playserver,node_actions,node_trade toneAmber
class node_auth,node_access,node_social toneMint
class node_moderation,node_admin,node_public toneRose
class node_database,node_player toneIndigo
```

## Components

### Player experience

- [Registration and sign-in](https://github.com/bdubdesigns/runespace/blob/main/features/auth/SignInForm.tsx): `features/auth/SignInForm.tsx`
- [Character management](https://github.com/bdubdesigns/runespace/blob/main/features/characters/CreateCharacterForm.tsx): `features/characters/CreateCharacterForm.tsx`
- [Play client shell](https://github.com/bdubdesigns/runespace/blob/main/features/play/PlayContext.tsx): `features/play/PlayContext.tsx`
- [Storage transfers](https://github.com/bdubdesigns/runespace/blob/main/features/storage/StorageTransferSurface.tsx): `features/storage/StorageTransferSurface.tsx`

### Gameplay systems

- [Travel and scavenging](https://github.com/bdubdesigns/runespace/blob/main/features/travel/JourneyPanel.tsx): `features/travel/JourneyPanel.tsx`
- [Mining](https://github.com/bdubdesigns/runespace/blob/main/features/mining/MiningActivity.tsx): `features/mining/MiningActivity.tsx`
- [Refining](https://github.com/bdubdesigns/runespace/blob/main/features/refining/RefiningConsole.tsx): `features/refining/RefiningConsole.tsx`
- [Fabrication and tinkering](https://github.com/bdubdesigns/runespace/blob/main/features/fabrication/FabricationStation.tsx): `features/fabrication/FabricationStation.tsx`
- [Welding and repair](https://github.com/bdubdesigns/runespace/blob/main/features/welding/RepairWorkPanel.tsx): `features/welding/RepairWorkPanel.tsx`
- [Inventory and equipment](https://github.com/bdubdesigns/runespace/blob/main/features/inventory/InventoryPanel.tsx): `features/inventory/InventoryPanel.tsx`
- [Missions and progression](https://github.com/bdubdesigns/runespace/blob/main/features/missions/MissionLogPanel.tsx): `features/missions/MissionLogPanel.tsx`
- [Locations and NPCs](https://github.com/bdubdesigns/runespace/blob/main/features/location-scene/LocationSurface.tsx): `features/location-scene/LocationSurface.tsx`
- [Play orchestration and state](https://github.com/bdubdesigns/runespace/blob/main/server/play.ts): `server/play.ts`
- [Server actions](https://github.com/bdubdesigns/runespace/blob/main/server/actions.ts): `server/actions.ts`
- [Player and NPC trade](https://github.com/bdubdesigns/runespace/blob/main/server/trade.ts): `server/trade.ts`

### Accounts and social

- [Authentication](https://github.com/bdubdesigns/runespace/blob/main/server/auth.ts): `server/auth.ts`
- [Gameplay access and ownership](https://github.com/bdubdesigns/runespace/blob/main/server/gameplay-access.ts): `server/gameplay-access.ts`
- [Chat and realtime](https://github.com/bdubdesigns/runespace/blob/main/server/chat.ts): `server/chat.ts`

### Operations and content

- [Moderation](https://github.com/bdubdesigns/runespace/blob/main/server/moderation-notices.ts): `server/moderation-notices.ts`
- [Admin console](https://github.com/bdubdesigns/runespace/blob/main/features/admin/AdminModerationPanel.tsx): `features/admin/AdminModerationPanel.tsx`
- [Wiki and updates](https://github.com/bdubdesigns/runespace/blob/main/features/public-site/PublicWikiPage.tsx): `features/public-site/PublicWikiPage.tsx`

### Persistence

- [PostgreSQL data](https://github.com/bdubdesigns/runespace/blob/main/db/rune-space.ts): `db/rune-space.ts`

### Other components

- **Player**

## Connections

- Player → Registration and sign-in: registers (evidence: `README.md`)
- Player → Character management: creates character (evidence: `README.md`)
- Player → Play client shell: plays (evidence: `README.md`)
- Play client shell → Play orchestration and state: loads state (evidence: `features/play/PlayContext.tsx`)
- Play client shell → Server actions: submits commands (evidence: `features/inventory/useEquipCommand.ts`)
- Server actions → Play orchestration and state: dispatches gameplay (evidence: `server/actions.ts`)
- Play orchestration and state → PostgreSQL data: reads and persists (evidence: `server/play.ts`)
- Server actions → Travel and scavenging: resolves activity
- Server actions → Mining: resolves activity (evidence: `server/actions.ts`)
- Server actions → Refining: resolves activity (evidence: `server/actions.ts`)
- Server actions → Fabrication and tinkering: dispatches commands (evidence: `server/actions.ts`)
- Server actions → Welding and repair: dispatches commands (evidence: `server/actions.ts`)
- Server actions → Missions and progression: completes missions (evidence: `server/actions.ts`)
- Play client shell → Storage transfers: renders storage
- Storage transfers → Inventory and equipment: moves items
- Character management → Gameplay access and ownership: checks access
- Gameplay access and ownership → PostgreSQL data: reads access state (evidence: `server/gameplay-access.ts`)
- Gameplay access and ownership → Authentication: uses identity
- Chat and realtime → PostgreSQL data: stores messages
- Moderation → PostgreSQL data: reads sanctions (evidence: `server/moderation-notices.ts`)
- Admin console → Moderation: manages cases
- Player and NPC trade → PostgreSQL data: persists trades
- Locations and NPCs → Play orchestration and state: uses world state
- Wiki and updates → Player: presents game info
