How jakezy-kun/scrollq works
ScrollQ is a mobile-first attention-budget learning game. Players choose a curated or live feed, make read/skip/flag decisions under coin and idle-drain rules, then review an SQ score, reveal, and reflection; round history can remain local or sync for signed-in accounts. The graph preserves documented game, feed, account, and history stages. Edges are limited to router and round-state relationships supported by excerpts or README; unsampled feature and provider internals are represented without guessed call chains.
Main entry points: router.tsx Screen router · record.ts Round records · useRound.ts Round state · SupabaseRepository.ts Cloud repository
Components 25
App navigation
- App entry
src/main.tsx - Screen router
src/app/router.tsx
Play experience
- Start and setup
src/features/start/StartPage.tsx - Onboarding
src/features/onboarding/OnboardingPage.tsx - Round play
src/features/round/RoundPage.tsx - Score and reveal
src/features/summary/SummaryPage.tsx - Reflection
src/features/reflect/ReflectPage.tsx - Round history
src/features/history/HistoryPage.tsx
Game engine
- Round state
src/hooks/useRound.ts - Rules and scoring
src/engine/reducer.ts - Game configuration
src/engine/config.ts - Idle drain
src/engine/idle.ts
Feed content
- Feed selection
src/features/feed-select/FeedSelectPage.tsx - Feed providers
src/content - Live feed service
src/server/pixabay.ts
Persistence and accounts
- Authentication
src/lib/auth/AuthProvider.tsx - Profile and account
src/features/account/AccountPage.tsx - Repository selection
src/lib/repository/RepositoryProvider.tsx - Local repository
src/lib/repository/LocalRepository.ts - Round records
src/lib/rounds/record.ts - Browser storage
src/lib/storage.ts - Cloud repository
src/lib/repository/SupabaseRepository.ts - Offline sync queue
src/lib/sync/SyncQueue.ts
Other components
- Player
- Supabase service
Connections 31
- Player → App entry: opens app
src/main.tsx - App entry → Screen router: mounts
src/main.tsx - Screen router → Start and setup: routes to
src/app/router.tsx - Screen router → Onboarding: routes to
src/app/router.tsx - Screen router → Feed selection: routes to
src/app/router.tsx - Screen router → Round play: routes to
src/app/router.tsx - Screen router → Score and reveal: routes to
src/app/router.tsx - Screen router → Reflection: routes to
src/app/router.tsx - Screen router → Round history: routes to
src/app/router.tsx - Feed selection → Feed providers: selects feed
- Feed providers → Live feed service: requests videos
src/server/pixabay.ts - Feed selection → Round play: starts round
- Round play → Round state: dispatches actions
- Round state → Rules and scoring: reduces actions
src/hooks/useRound.ts - Round state → Round records: snapshots result
src/hooks/useRound.ts - Round state → Browser storage: persists session
src/hooks/useRound.ts - Rules and scoring → Game configuration: uses rules
- Rules and scoring → Idle drain: checks idle
- Round records → Rules and scoring: derives summary
src/lib/rounds/record.ts - Score and reveal → Round records: shows result
- Reflection → Round records: adds reflection
- Round history → Repository selection: loads rounds
- Authentication → Repository selection: selects account data
- Repository selection → Local repository: uses for guests
- Local repository → Browser storage: reads and writes
src/lib/repository/LocalRepository.ts - Local repository → Round records: stores records
src/lib/repository/LocalRepository.ts - Repository selection → Cloud repository: uses when signed in
- Cloud repository → Supabase service: reads and writes
src/lib/repository/SupabaseRepository.ts - Cloud repository → Offline sync queue: queues retries
src/lib/repository/SupabaseRepository.ts - Cloud repository → Round records: maps records
src/lib/repository/SupabaseRepository.ts - Player → Authentication: signs in