# aliciaworks/partygame architecture

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

- Interactive diagram: https://gitdiagram.com/aliciaworks/partygame
- Repository: https://github.com/aliciaworks/partygame

## Overview

PartyGame is a serverless multiplayer game backend with a React operations console and game-engine clients. A player client authenticates through the Worker, joins matchmaking, and connects to a stateful game room; the Worker also exposes independent social, communication, progression, and content services. Administrators use the console to manage players, assets, modules, and platform settings. The README documents several capabilities whose implementation was not sampled; those are shown as product subsystems, with uncertain internal wiring omitted.

Main entry points: [`apps/worker/src/index.ts`](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/index.ts) (Worker API), [`sdks/unity/PartyGameSDK.cs`](https://github.com/aliciaworks/partygame/blob/main/sdks/unity/PartyGameSDK.cs) (Engine SDKs), [`apps/worker/src/modules/loader.ts`](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/loader.ts) (Module Loader), [`apps/worker/src/modules/player_auth/index.ts`](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/player_auth/index.ts) (Player Auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Clients"]
  node_engine_sdk["Engine SDKs<br/>[PartyGameSDK.cs]"]
end

subgraph group_runtime["Worker Runtime"]
  node_worker["Worker API<br/>[index.ts]"]
  node_module_loader["Module Loader<br/>[loader.ts]"]
  node_auth["Player Auth<br/>[index.ts]"]
  node_admin_auth["Admin Auth<br/>[admin-auth.ts]"]
end

subgraph group_gameplay["Gameplay Services"]
  node_game_room["Game Room<br/>[game-room.ts]"]
  node_plugins["Game Plugins<br/>[registry.ts]"]
  node_matchmaker["Matchmaker<br/>[matchmaker-room.ts]"]
  node_chat["Text Chat<br/>[chat-room.ts]"]
  node_voice["Voice Chat<br/>[index.ts]"]
end

subgraph group_platform["Platform Services"]
  node_player_profile["Profiles<br/>[index.ts]"]
  node_friends["Friends<br/>[index.ts]"]
  node_guilds["Guilds<br/>[index.ts]"]
  node_progress["Progress &amp; Rankings<br/>[index.ts]"]
  node_economy["Economy<br/>[index.ts]"]
  node_seasons["Seasons<br/>[index.ts]"]
  node_hotfix["OTA Hotfixes<br/>[index.ts]"]
  node_assets["Asset Variants<br/>[index.ts]"]
end

subgraph group_admin["Administration"]
  node_admin_app["Admin SPA<br/>[main.tsx]"]
  node_admin_routes["Admin Routes<br/>[Assets.tsx]"]
  node_admin_portal["Admin API Modules<br/>[admin-auth.ts]"]
end

node_player(("Game Player"))
node_r2[("R2 Platform Bucket")]
node_d1[("D1 Database")]
node_calls["Cloudflare Calls"]
node_ai["Workers AI"]
node_admin_user(("Administrator"))

node_player -->|"uses SDK"| node_engine_sdk
node_engine_sdk -->|"HTTP and WebSocket"| node_worker
node_worker -->|"dispatches modules"| node_module_loader
node_module_loader -->|"mounts routes"| node_auth
node_worker -->|"routes game sockets"| node_game_room
node_game_room -->|"selects game logic"| node_plugins
node_worker -->|"routes matchmaking"| node_matchmaker
node_worker -->|"routes chat"| node_chat
node_worker -->|"routes voice"| node_voice
node_worker -->|"dispatches profile API"| node_player_profile
node_worker -->|"dispatches friend API"| node_friends
node_worker -->|"dispatches guild API"| node_guilds
node_worker -->|"dispatches progress API"| node_progress
node_worker -->|"dispatches economy API"| node_economy
node_worker -->|"dispatches season API"| node_seasons
node_worker -->|"dispatches hotfix API"| node_hotfix
node_worker -->|"dispatches asset API"| node_assets
node_auth -->|"reads player accounts"| node_r2
node_player_profile -->|"stores profiles"| node_r2
node_friends -->|"stores friend lists"| node_r2
node_progress -->|"stores progress"| node_r2
node_hotfix -->|"stores patches"| node_r2
node_voice -.->|"uses SFU"| node_calls
node_chat -.->|"moderates messages"| node_ai
node_admin_user -->|"uses console"| node_admin_app
node_admin_app -->|"routes views"| node_admin_routes
node_admin_routes -->|"calls admin API"| node_worker
node_worker -->|"handles admin auth"| node_admin_auth
node_worker -->|"serves admin operations"| node_admin_portal
node_admin_auth -->|"stores credentials"| node_d1
node_admin_portal -.->|"uses platform records"| node_d1

click node_engine_sdk "https://github.com/aliciaworks/partygame/blob/main/sdks/unity/PartyGameSDK.cs"
click node_worker "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/index.ts"
click node_module_loader "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/loader.ts"
click node_auth "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/player_auth/index.ts"
click node_game_room "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/game/game-room.ts"
click node_plugins "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/plugins/registry.ts"
click node_matchmaker "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/matchmaker/matchmaker-room.ts"
click node_chat "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/chat/chat-room.ts"
click node_voice "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/voice/index.ts"
click node_player_profile "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/player_profile/index.ts"
click node_friends "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/friends/index.ts"
click node_guilds "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/guilds/index.ts"
click node_progress "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/player_progress/index.ts"
click node_economy "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/economy/index.ts"
click node_seasons "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/seasons/index.ts"
click node_hotfix "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/hotfix/index.ts"
click node_assets "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/player_management/index.ts"
click node_admin_app "https://github.com/aliciaworks/partygame/blob/main/apps/admin/src/main.tsx"
click node_admin_routes "https://github.com/aliciaworks/partygame/blob/main/apps/admin/src/routes/Assets.tsx"
click node_admin_auth "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/admin-auth.ts"
click node_admin_portal "https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/admin-auth.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_engine_sdk toneBlue
class node_worker,node_module_loader,node_auth,node_admin_auth,node_r2,node_d1 toneAmber
class node_game_room,node_plugins,node_matchmaker,node_chat,node_voice toneMint
class node_player_profile,node_friends,node_guilds,node_progress,node_economy,node_seasons,node_hotfix,node_assets,node_ai toneRose
class node_admin_app,node_admin_routes,node_admin_portal,node_player,node_calls,node_admin_user toneIndigo
```

## Components

### Clients

- [Engine SDKs](https://github.com/aliciaworks/partygame/blob/main/sdks/unity/PartyGameSDK.cs): `sdks/unity/PartyGameSDK.cs`

### Worker Runtime

- [Worker API](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/index.ts): `apps/worker/src/index.ts`
- [Module Loader](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/loader.ts): `apps/worker/src/modules/loader.ts`
- [Player Auth](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/player_auth/index.ts): `apps/worker/src/modules/player_auth/index.ts`
- [Admin Auth](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/admin-auth.ts): `apps/worker/src/admin-auth.ts`

### Gameplay Services

- [Game Room](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/game/game-room.ts): `apps/worker/src/game/game-room.ts`
- [Game Plugins](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/plugins/registry.ts): `apps/worker/src/plugins/registry.ts`
- [Matchmaker](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/matchmaker/matchmaker-room.ts): `apps/worker/src/matchmaker/matchmaker-room.ts`
- [Text Chat](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/chat/chat-room.ts): `apps/worker/src/chat/chat-room.ts`
- [Voice Chat](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/voice/index.ts): `apps/worker/src/modules/voice/index.ts`

### Platform Services

- [Profiles](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/player_profile/index.ts): `apps/worker/src/modules/player_profile/index.ts`
- [Friends](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/friends/index.ts): `apps/worker/src/modules/friends/index.ts`
- [Guilds](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/guilds/index.ts): `apps/worker/src/modules/guilds/index.ts`
- [Progress & Rankings](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/player_progress/index.ts): `apps/worker/src/modules/player_progress/index.ts`
- [Economy](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/economy/index.ts): `apps/worker/src/modules/economy/index.ts`
- [Seasons](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/seasons/index.ts): `apps/worker/src/modules/seasons/index.ts`
- [OTA Hotfixes](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/hotfix/index.ts): `apps/worker/src/modules/hotfix/index.ts`
- [Asset Variants](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/modules/player_management/index.ts): `apps/worker/src/modules/player_management/index.ts`

### Administration

- [Admin SPA](https://github.com/aliciaworks/partygame/blob/main/apps/admin/src/main.tsx): `apps/admin/src/main.tsx`
- [Admin Routes](https://github.com/aliciaworks/partygame/blob/main/apps/admin/src/routes/Assets.tsx): `apps/admin/src/routes/Assets.tsx`
- [Admin API Modules](https://github.com/aliciaworks/partygame/blob/main/apps/worker/src/admin-auth.ts): `apps/worker/src/admin-auth.ts`

### Other components

- **Game Player**
- **R2 Platform Bucket**
- **D1 Database**
- **Cloudflare Calls**
- **Workers AI**
- **Administrator**

## Connections

- Game Player → Engine SDKs: uses SDK
- Engine SDKs → Worker API: HTTP and WebSocket
- Worker API → Module Loader: dispatches modules
- Module Loader → Player Auth: mounts routes
- Worker API → Game Room: routes game sockets
- Game Room → Game Plugins: selects game logic
- Worker API → Matchmaker: routes matchmaking
- Worker API → Text Chat: routes chat
- Worker API → Voice Chat: routes voice
- Worker API → Profiles: dispatches profile API
- Worker API → Friends: dispatches friend API
- Worker API → Guilds: dispatches guild API
- Worker API → Progress & Rankings: dispatches progress API
- Worker API → Economy: dispatches economy API
- Worker API → Seasons: dispatches season API
- Worker API → OTA Hotfixes: dispatches hotfix API
- Worker API → Asset Variants: dispatches asset API
- Player Auth → R2 Platform Bucket: reads player accounts
- Profiles → R2 Platform Bucket: stores profiles
- Friends → R2 Platform Bucket: stores friend lists
- Progress & Rankings → R2 Platform Bucket: stores progress
- OTA Hotfixes → R2 Platform Bucket: stores patches
- Voice Chat → Cloudflare Calls: uses SFU
- Text Chat → Workers AI: moderates messages
- Administrator → Admin SPA: uses console
- Admin SPA → Admin Routes: routes views
- Admin Routes → Worker API: calls admin API
- Worker API → Admin Auth: handles admin auth
- Worker API → Admin API Modules: serves admin operations
- Admin Auth → D1 Database: stores credentials
- Admin API Modules → D1 Database: uses platform records
