How eitaar/driichi works
This is a multiplayer mahjong application: players enter rooms and play through a projected game view, while administrators manage rooms, replays, and benchmarks. The Rust workspace separates game rules and room state from server, replay, and protocol-facing crates; the frontend renders gameplay and administrative workflows. The excerpts establish several frontend and replay-module relationships, but do not show most server routing or core runtime calls, so those connections are omitted or marked unverified.
Main entry points: app.tsx Web app routes · gameplay.tsx Gameplay view · three-table.tsx 3D table renderer · room.rs Room runtime
Components 27
Game runtime
- Game domain
crates/double_riichi_core/src/domain.rs - Game engine
crates/double_riichi_core/src/engine.rs - Legal decisions
crates/double_riichi_core/src/decision.rs - Match progression
crates/double_riichi_core/src/match_machine.rs - State projection
crates/double_riichi_core/src/projection.rs
Server and rooms
- Room runtime
crates/double_riichi_core/src/room.rs - HTTP service
crates/double_riichi_server/src/http.rs - Authentication
crates/double_riichi_server/src/auth.rs - SQLite storage
crates/double_riichi_server/src/storage.rs - OAuth integration
crates/double_riichi_server/src/oauth.rs
Replay system
- MJSON codec
crates/double_riichi_replay/src/mjson.rs - Replay frames
crates/double_riichi_replay/src/frames.rs - Replay persistence
crates/double_riichi_replay/src/persistence.rs
Player and admin UI
- Web app routes
frontend/src/app.tsx - Frontend API
frontend/src/api.ts - Gameplay view
frontend/src/game/gameplay.tsx - Game state store
frontend/src/game/store.ts - 3D table renderer
frontend/src/game/three-table.tsx - Table scene
frontend/src/game/three-table-scene.tsx - Scene layout
frontend/src/game/three-table-layout.ts - Table geometry
frontend/src/game/table-geometry.ts - Replay workspace
frontend/src/replay.tsx
External interfaces
- MJAI adapter
crates/double_riichi_mjai/src/lib.rs - MCP interface
crates/double_riichi_mcp/src/lib.rs - ChatGPT gateway
crates/double_riichi_server/src/chatgpt_gateway.rs
Other components
- Players
- Administrators
Connections 25
- Players → Web app routes: use
- Administrators → Web app routes: use
- Web app routes → Gameplay view: renders
frontend/src/app.tsx - Web app routes → Replay workspace: routes to
frontend/src/app.tsx - Web app routes → Frontend API: uses
frontend/src/app.tsx - Gameplay view → 3D table renderer: renders
frontend/src/game/gameplay.tsx - Gameplay view → Game state store: uses
frontend/src/game/gameplay.tsx - 3D table renderer → Table scene: renders
frontend/src/game/three-table.tsx - 3D table renderer → Scene layout: builds layout
frontend/src/game/three-table.tsx - Table scene → Scene layout: uses
frontend/src/game/three-table-scene.tsx - Scene layout → Table geometry: uses
frontend/src/game/three-table-layout.ts - Replay workspace → Frontend API: requests replay data
frontend/src/replay.tsx - Match progression → Game domain: uses types
crates/double_riichi_core/src/match_machine.rs - Room runtime → Match progression: advances matches
- Room runtime → State projection: projects state
- Game engine → Legal decisions: computes actions
- HTTP service → Room runtime: dispatches room actions
- HTTP service → SQLite storage: persists records
- Authentication → SQLite storage: reads and writes
crates/double_riichi_server/src/auth.rs - Replay frames → MJSON codec: uses codec
crates/double_riichi_replay/src/frames.rs - Replay persistence → MJSON codec: encodes events
crates/double_riichi_replay/src/persistence.rs - MJAI adapter → Game engine: adapts game
- MCP interface → HTTP service: exposes tools
- ChatGPT gateway → MCP interface: connects tools
- OAuth integration → Authentication: supports sign-in