How tvghung/monopoly works
Own the Block is a host-authoritative multiplayer Monopoly game for desktop and browser players. A desktop host starts the server and creates a LAN or online room; guests join through an invitation or LAN discovery, then play through the shared client while the host server owns room state and reconnect sessions. The graph also shows the client’s 3D presentation and audio layers, plus desktop updates and optional room-code lookup. Evidence is limited to the README and sampled or indexed source references; unverified implementation links are omitted or dashed.
Main entry points: App.tsx React Client · hostRuntime.ts Desktop Host · authoritativeServer.ts Server Runtime · rooms.ts Room Authority
Components 23
Desktop Host
- Desktop Host
apps/desktop/src/hostRuntime.ts - Desktop IPC
apps/desktop/src/ipc/windowHandlers.ts - App Updates
apps/desktop/src/update/updateService.ts
Authoritative Server
- Server Runtime
apps/server/src/authoritativeServer.ts - Room Authority
apps/server/src/rooms.ts - Command & Session Services
apps/server/src/services/runtime.ts - Player Admission
apps/server/src/services/playerSessionService.ts - In-Memory Store
apps/server/src/persistence/inMemory.ts - Socket Sessions
apps/server/src/socket/session.ts
Game Client
- React Client
apps/client/src/App.tsx - Reconnect Sessions
apps/client/src/playerSessionStorage.ts - Lobby & Joining
apps/client/src/components/Lobby.tsx - Game Dashboard
apps/client/src/components/Dashboard.tsx
Game Presentation
- Audio Engine
apps/client/src/audio/AudioEngine.ts - Event Presentation
apps/client/src/game/presentation/PresentationController.ts - 3D Game Scene
apps/client/src/game/scene/GameScene.tsx - 3D Board
apps/client/src/game/scene/board/Board3D.tsx
Shared Rules
- Game Rules & State
packages/shared/src/rules.ts - Power-up Rules
packages/shared/src/powerUps.ts
Other components
- Desktop or Browser Player
- Quick Tunnel
- Room Registry
services/room-registry/src/index.js - Update Service
Connections 28
- Desktop or Browser Player → Desktop Host: starts hosting
- Desktop Host → Server Runtime: starts process
- Desktop Host → Quick Tunnel: starts online
- Desktop or Browser Player → React Client: opens invitation
- React Client → Socket Sessions: joins room
- React Client → Reconnect Sessions: stores token
apps/client/src/App.tsx - React Client → Lobby & Joining: renders
apps/client/src/App.tsx - React Client → Game Dashboard: renders
apps/client/src/App.tsx - React Client → Event Presentation: updates
apps/client/src/App.tsx - Event Presentation → 3D Game Scene: drives
- 3D Game Scene → 3D Board: renders
- Event Presentation → Audio Engine: plays feedback
- Server Runtime → Command & Session Services: creates
apps/server/src/authoritativeServer.ts - Server Runtime → In-Memory Store: creates
apps/server/src/authoritativeServer.ts - Server Runtime → Socket Sessions: registers handlers
apps/server/src/authoritativeServer.ts - Server Runtime → Room Authority: configures
apps/server/src/authoritativeServer.ts - Command & Session Services → Player Admission: creates
apps/server/src/services/runtime.ts - Command & Session Services → In-Memory Store: uses
apps/server/src/services/runtime.ts - Player Admission → Room Authority: checks room
apps/server/src/services/playerSessionService.ts - Socket Sessions → Command & Session Services: dispatches
apps/server/src/socket/session.ts - Room Authority → Game Rules & State: uses rules
apps/server/src/rooms.ts - Room Authority → Power-up Rules: uses definitions
apps/server/src/rooms.ts - React Client → Game Rules & State: uses protocol
apps/client/src/App.tsx - Desktop Host → Desktop IPC: serves requests
apps/desktop/src/ipc/windowHandlers.ts - Desktop IPC → Desktop Host: resolves room
apps/desktop/src/ipc/windowHandlers.ts - Desktop Host → Room Registry: looks up room
apps/desktop/src/hostRuntime.ts - Desktop Host → App Updates: checks updates
- App Updates → Update Service: fetches release