How martin-olh/trugen-scorer works
TRUGEN Scorer is a local scorekeeping app for Truco and Generala, with player rosters, match history, and player statistics. The evident workflow is to choose a game, set up and record a match, persist its scores, and review completed matches or player records. The graph connects routing and sampled data/service calls; page-to-hook wiring outside the sampled source is not asserted.
Main entry points: App.tsx App router · usePlayerStats.ts Player stats hooks · trucoMatchRepository.ts Truco match repository · generalaMatchRepository.ts Generala match repository
Components 20
App and pages
- App router
src/App.tsx - Home and roster
src/pages/HomePage.tsx - Match history
src/pages/HistoryPage.tsx - Player profile
src/pages/PlayerProfilePage.tsx
Match scoring
- Truco setup
src/pages/truco/TrucoSetupPage.tsx - Truco match
src/pages/truco/TrucoMatchPage.tsx - Generala setup
src/pages/generala/GeneralaSetupPage.tsx - Generala match
src/pages/generala/GeneralaMatchPage.tsx - Truco match hooks
src/hooks/useTrucoMatch.ts - Generala match hooks
src/hooks/useGeneralaMatch.ts - Truco tally rules
src/services/trucoTally.ts - Generala scoring
src/services/generalaScoring.ts
Players and stats
- Player hooks
src/hooks/usePlayers.ts - Player stats hooks
src/hooks/usePlayerStats.ts - Stats calculations
src/services/statsService.ts
Local persistence
- Truco match repository
src/data/repositories/trucoMatchRepository.ts - Generala match repository
src/data/repositories/generalaMatchRepository.ts - Player repository
src/data/repositories/playerRepository.ts - IndexedDB store
src/data/db.ts
Other components
- User
Connections 21
- User → App router: uses
- App router → Home and roster: routes
- App router → Match history: routes
- App router → Player profile: routes
- App router → Truco setup: routes
- App router → Truco match: routes
- App router → Generala setup: routes
- App router → Generala match: routes
- Home and roster → Player hooks: loads roster
- Player hooks → Player repository: calls
- Player repository → IndexedDB store: reads/writes
- Truco match hooks → Truco match repository: calls
- Truco match repository → IndexedDB store: reads/writes
- Truco match repository → Truco tally rules: applies scores
- Truco match hooks → Truco tally rules: optimistic scoring
- Generala match hooks → Generala match repository: calls
- Generala match repository → IndexedDB store: reads/writes
- Generala match repository → Generala scoring: resolves winner
- Player stats hooks → Stats calculations: calculates
- Player stats hooks → Truco match hooks: loads matches
- Player stats hooks → Generala match hooks: loads matches