How lukasjakobi/nearby-dice works
Nearby Dice is a local-multiplayer Yatzy-style game for Android and iOS. Players host or join a coded round, play through a host-authoritative session, and see shared results; training supports solo play. The graph preserves documented game modes, reconnect/resume, history, settings, permissions, and feedback capabilities. Several links are documented by the README; source excerpts show the host’s engine and transport responsibilities and the game screen’s session commands. Other feature internals were not sampled, so their detailed calls are omitted.
Main entry points: HostSession.ts Host session · useGameScreen.ts Game screen · engine.ts Game engine · net Nearby transport
Components 20
Entry and setup
- Home and resume
src/features/home - Host setup
src/features/host-setup - Host lobby
src/features/host-lobby - Join flow
src/features/join - Permission gate
src/shared/permissions
Sessions and gameplay
- Host session
src/session/HostSession.ts - Guest session
src/session/GuestSession.ts - Training session
src/session/TrainingSession.ts - Game engine
src/domain/engine.ts - Rules and scoring
src/domain/scoring.ts - Automatic scoring
src/domain/autopick.ts - Game screen
src/features/game/hooks/useGameScreen.ts
Connectivity and persistence
- Round scanner
src/session/RoundScanner.ts - Nearby transport
src/net - Native connections
modules/nearby-connections
Results and experience
- Results and history
src/features/results - Local stores
src/store - Settings and feedback
src/shared/audio.ts - Settings screen
src/features/settings
Other components
- Players
Connections 25
- Players → Home and resume: open app
- Home and resume → Host setup: choose host
- Host setup → Host lobby: open round
- Players → Join flow: enter code
- Join flow → Round scanner: find rounds
- Permission gate → Nearby transport: authorize access
src/shared/permissions/usePermissionGate.ts - Round scanner → Nearby transport: scan nearby
src/session/RoundScanner.ts - Nearby transport → Native connections: use native links
- Host lobby → Host session: start session
- Host session → Nearby transport: advertise and send
src/session/HostSession.ts - Host session → Game engine: reduce moves
- Host session → Guest session: broadcast shared state
- Guest session → Host session: request moves
- Training session → Game engine: run solo game
- Game engine → Rules and scoring: score and validate
src/domain/engine.ts - Game engine → Automatic scoring: choose automatic score
src/domain/engine.ts - Game screen → Host session: send player actions
src/features/game/hooks/useGameScreen.ts - Game screen → Guest session: send player actions
- Game screen → Training session: control training
- Game screen → Results and history: navigate when finished
src/features/game/hooks/useGameScreen.ts - Results and history → Local stores: record game history
src/features/results/hooks/useResults.ts - Home and resume → Local stores: load resume and stats
src/features/home/hooks/useHome.ts - Settings screen → Local stores: read settings
- Game screen → Settings and feedback: play configured feedback
src/features/game/hooks/useGameScreen.ts - Settings and feedback → Local stores: read sound switches
src/shared/hooks/useFeedback.ts