How iliasalmerekov/darts works
Dart score app is a React client for preparing and scoring dart games, then reviewing game results and player statistics. Its principal workflow is organized around the lobby, active scoring, and post-game summary; the README also identifies account, settings, game-history, profile, and joined-player screens. Shared API modules communicate with the backend, while Nanostores, realtime hooks, and browser services support the screens. Some page and store internals were not sampled, so their detailed runtime relationships are omitted rather than inferred.
Main entry points: App.tsx App router · useThrowHandler.ts Throw handling · game.ts Game API · StartPage.tsx Game lobby
Components 27
Application
- App router
src/app/App.tsx - Login and registration
src/pages/LoginPage/useLogin.ts - Registration flow
src/pages/RegisterPage/useRegistration.ts
Game flow
- Game lobby
src/pages/StartPage/StartPage.tsx - Active game
src/pages/GamePage/index.tsx - Throw handling
src/pages/GamePage/throws/useThrowHandler.ts - Throw queue
src/pages/GamePage/throws/useThrowQueue.ts - Optimistic state
src/pages/GamePage/throws/throwStateService.ts - Throw reconciliation
src/pages/GamePage/throws/useThrowReconciliation.ts - Game summary
src/pages/GameSummaryPage/useGameSummaryPage.ts - Joined games
src/pages/JoinedGamePage/index.tsx
History and stats
- Games overview
src/pages/GamesOverviewPage/useGamesOverview.ts - Game details
src/pages/GameDetailPage/useGameDetailPage.ts - Player statistics
src/pages/StatisticsPage/usePlayerStats.ts - Player profile
src/pages/PlayerProfilePage/index.tsx - Game settings
src/pages/SettingsPage/index.tsx
Shared services
- HTTP client
src/shared/api/client.ts - Authentication API
src/shared/api/auth.ts - Game API
src/shared/api/game.ts - Room API
src/shared/api/room.ts - Statistics API
src/shared/api/statistics.ts - Event stream
src/shared/hooks/useEventSource.ts - Game state store
src/shared/store/game-state.ts - Auth store
src/shared/store/auth.ts - Sound playback
src/shared/services/browser/soundPlayer.ts
Other components
- Player
- Application backend
Connections 29
- Player → App router: uses
README.md - App router → Login and registration: routes to
src/app/App.tsx - App router → Registration flow: routes to
src/app/App.tsx - App router → Game lobby: routes to
src/app/App.tsx - App router → Active game: routes to
src/app/App.tsx - App router → Game summary: routes to
src/app/App.tsx - Login and registration → Authentication API: requests auth
src/pages/LoginPage/useLogin.ts - Registration flow → Authentication API: requests auth
src/pages/RegisterPage/useRegistration.ts - Game lobby → Room API: manages rooms
- Game lobby → Game API: loads players
- Active game → Throw handling: handles throws
- Throw handling → Optimistic state: applies optimistic state
src/pages/GamePage/throws/useThrowHandler.ts - Throw handling → Throw queue: enqueues throws
src/pages/GamePage/throws/useThrowHandler.ts - Throw handling → Throw reconciliation: reconciles state
src/pages/GamePage/throws/useThrowHandler.ts - Throw handling → Game state store: updates state
src/pages/GamePage/throws/useThrowHandler.ts - Throw queue → Game API: synchronizes throws
src/pages/GamePage/throws/useThrowQueue.ts - Game summary → Game API: loads game data
src/pages/GameSummaryPage/useGameSummaryPage.ts - Game summary → Sound playback: plays sounds
src/pages/GameSummaryPage/useGameSummaryPage.ts - Games overview → Statistics API: loads overview
src/pages/GamesOverviewPage/useGamesOverview.ts - Game details → Game API: loads details
src/pages/GameDetailPage/useGameDetailPage.ts - Player statistics → Statistics API: loads statistics
src/pages/StatisticsPage/usePlayerStats.ts - Login and registration → Auth store: updates session
src/pages/LoginPage/useLogin.ts - Auth store → Authentication API: invalidates session
src/shared/store/auth.ts - Authentication API → HTTP client: sends requests
src/shared/api/auth.ts - Game API → HTTP client: sends requests
src/shared/api/game.ts - Statistics API → HTTP client: sends requests
src/shared/api/statistics.ts - HTTP client → Application backend: calls
- Game lobby → Event stream: subscribes
- Joined games → Event stream: streams updates