How taratipt/songguessr works
SongGuessr is a browser-based music-guessing game with solo, real-time room, and 1v1 SongDraft modes. Players choose a category, hear a song preview, answer by choice or text, use hints, and see round and game results; faster correct answers score higher. The graph follows the app’s documented flow and sampled calls. Some UI wiring and unsampled feature internals are represented only where documented, rather than inferred from filenames.
Main entry points: App.tsx Game coordinator · itunesApi.ts Song search and matching · multiplayerService.ts Realtime room service · CategorySelectModal.tsx Category setup
Components 25
Game flow
- Game coordinator
src/App.tsx - Category setup
src/components/CategorySelectModal.tsx - Answer input
src/components/GuessBar.tsx - Multiple choice
src/components/MultipleChoiceBar.tsx - Hints
src/components/HintCards.tsx - Round results
src/components/RoundSummaryModal.tsx - Game results
src/components/GameOverModal.tsx - Score calculation
src/utils/scoreCalculator.ts
Music catalog
- Music categories
src/data/categories.ts - Artist catalog
src/data/artistsData.ts - Curated songs
src/data/curatedSongs.ts - Song search and matching
src/services/itunesApi.ts - Thai karaoke mappings
src/data/thaiKaraokeMap.ts - Song title aliases
src/data/thaiSongTitleAliases.ts - Thai artist catalog
src/data/thaiArtists.ts - Choice generation
src/services/choiceGenerator.ts
Rooms and draft
- Realtime room service
src/services/multiplayerService.ts - SongDraft arena
src/components/SongDraftArena.tsx
Player experience
- Player settings
src/services/storageService.ts - Player and audio
src/components/PlayerScreen.tsx - Sound effects
src/services/soundEffects.ts - Artist selection
src/components/GlobalArtistPickerModal.tsx
Other components
- Player
- Apple iTunes API
- MQTT WebSocket brokers
Connections 32
- Player → Game coordinator: starts game
- Player → Category setup: chooses settings
- Category setup → Game coordinator: configures play
src/App.tsx - Game coordinator → Song search and matching: fetches songs
src/App.tsx - Song search and matching → Apple iTunes API: searches catalog
- Song search and matching → Curated songs: uses fallback data
src/services/itunesApi.ts - Song search and matching → Artist catalog: uses artist metadata
src/services/itunesApi.ts - Song search and matching → Thai karaoke mappings: matches romanization
src/services/itunesApi.ts - Song search and matching → Song title aliases: matches aliases
src/services/itunesApi.ts - Game coordinator → Choice generation: generates choices
src/App.tsx - Choice generation → Song search and matching: uses song matching
src/services/choiceGenerator.ts - Game coordinator → Player and audio: presents round
src/App.tsx - Player → Answer input: submits guess
- Player → Multiple choice: selects answer
- Player → Hints: requests hint
- Answer input → Song title aliases: checks title aliases
src/components/GuessBar.tsx - Answer input → Thai karaoke mappings: checks romanization
src/components/GuessBar.tsx - Game coordinator → Round results: shows round summary
src/App.tsx - Game coordinator → Game results: shows final results
src/App.tsx - Player → Realtime room service: joins room
- Game coordinator → Realtime room service: starts host game
src/App.tsx - Realtime room service → MQTT WebSocket brokers: publishes room updates
- Realtime room service → Score calculation: calculates verified score
src/services/multiplayerService.ts - Game coordinator → Score calculation: scores solo rounds
src/App.tsx - Player → SongDraft arena: picks and bans
- SongDraft arena → Realtime room service: synchronizes draft
- Category setup → Music categories: offers categories
src/components/CategorySelectModal.tsx - Player → Artist selection: filters artists
- Artist selection → Artist catalog: browses artists
src/components/GlobalArtistPickerModal.tsx - Category setup → Player settings: persists preferences
src/components/CategorySelectModal.tsx - Player and audio → Sound effects: plays effects
src/components/PlayerScreen.tsx - Player → Thai artist catalog: browses Thai artists