How wangkech/pool-master works
Pool Master is an offline-first React PWA for managing billiards sessions. A player starts a session, records pots or fouls during rounds, and ends rounds or sessions; the game engine updates immutable snapshots, while the hook persists state locally. Completed sessions feed history, analytics, and rankings views. The graph preserves the documented PWA capability, although the sampled service-worker registration is commented out; several provider and domain internals were inferred only from the repository tree and README.
Components 21
React UI
- Application Entry
src/main.jsx - App Shell
src/App.jsx - Game Screen
src/tabs/GameTab.jsx - Active Game
src/components/ActiveGame/ActiveGameContainer.jsx - Player Setup
src/components/AddPlayerModal/AddPlayerModal.jsx - History Screens
src/tabs/HistoryTab.jsx - Rankings Screen
src/tabs/RankingsTab.jsx
Application Layer
- Game Hook
src/hooks/useGame.js - Game Context
src/context/GameProvider.jsx - Game Controller
src/logic/controller.js - Dialog Context
src/context/DialogContext.jsx
Game Domain
- Game Engine
src/logic/gameEngine.js - Session Model
src/logic/session.js - Round Model
src/logic/round.js - Player Model
src/logic/player.js - Ball Rules
src/logic/balls.js
History Analytics
- Analytics Engine
src/logic/Analytics/analyticEngine.js - Session Statistics
src/logic/Analytics/sessionAnalytics.js
Offline Runtime
- Local Game State
- PWA Runtime
src/pwa/pwaconfig.js
Other components
- Player
Connections 24
- Player → Player Setup: starts setup
- Application Entry → App Shell: renders
- App Shell → Game Screen: shows game
- App Shell → History Screens: shows history
- App Shell → Rankings Screen: shows rankings
- Game Screen → Active Game: renders round
- Game Screen → Player Setup: opens setup
- Game Context → Game Hook: provides state
- Active Game → Game Hook: dispatches actions
- Player Setup → Game Hook: adds players
- History Screens → Game Context: reads history
- Rankings Screen → Game Context: reads rankings
- Game Hook → Game Controller: calls commands
- Game Hook → Local Game State: saves state
- Game Controller → Local Game State: restores state
- Game Controller → Game Engine: orchestrates game
- Game Engine → Player Model: creates players
- Game Engine → Session Model: starts sessions
- Session Model → Round Model: manages rounds
- Round Model → Ball Rules: applies ball rules
- Game Controller → Analytics Engine: requests stats
- Analytics Engine → Session Statistics: analyzes sessions
- App Shell → Dialog Context: provides dialogs
- PWA Runtime → App Shell: caches application