How helenc3/hackru works
Speak Your Way is a single-player Mandarin-practice browser game. The player starts or resumes a session, explores a streamed Shanghai-style city, completes three voice-or-typed NPC quests, and receives deterministic game outcomes; AI assists with dialogue and city composition. The map also includes dictionary support and speech playback. Source excerpts and the index establish several internal links; broader browser/API and product-flow links are documented in the README. Unsampled routes and integrations are shown only where the README supports them.
Main entry points: App.tsx Game interface · services.ts Service assembly · app.ts HTTP application · world-service.ts World service
Components 25
Browser game
- Game interface
apps/web/src/app/App.tsx - Session state
apps/web/src/app/use-session.ts - Session API client
apps/web/src/app/session-client.ts - World renderer
apps/web/src/world/WorldRenderer.tsx - Chunk streaming and render
apps/web/src/city/ChunkRenderer.tsx - Reply audio playback
apps/web/src/audio/AudioController.tsx
API and services
- HTTP application
apps/server/src/app.ts - Session and quest routes
apps/server/src/routes/game.ts - Audio route
apps/server/src/routes/audio.ts - Session store
apps/server/src/session-store.ts - Service assembly
apps/server/src/services.ts - Dialogue providers
apps/server/src/providers/dialogue.ts - Speech providers
apps/server/src/providers/speech.ts - Live voice relay
apps/server/src/live/relay.ts
Game rules and content
- Quest rules engine
packages/shared/src/engine/index.ts - Missions and facts
packages/shared/src/content/missions.ts - Game contracts
packages/shared/src/contracts.ts
Streamed city
- World service
apps/server/src/city/world-service.ts - AI city composer
apps/server/src/city/claude-city.ts - City planning and validation
packages/shared/src/city/fallback.ts - City manifest contracts
packages/shared/src/city/contracts.ts
Language tools
- Dictionary interface
apps/web/src/dictionary/GlossPopover.tsx - Dictionary routes and lookup
apps/server/src/dictionary/router.ts - Dictionary lookup data
apps/server/src/dictionary/dictionary.ts
Other components
- Player
Connections 28
- Player → Game interface: plays
- Game interface → Session state: manages session
apps/web/src/app/App.tsx - Session state → Session API client: requests state
apps/web/src/app/use-session.ts - Session API client → HTTP application: sends API requests
- HTTP application → Session and quest routes: routes requests
apps/server/src/app.ts - HTTP application → Audio route: mounts route
apps/server/src/app.ts - Session and quest routes → Quest rules engine: applies game rules
- Session and quest routes → Session store: reads and writes sessions
apps/server/src/routes/game.ts - Quest rules engine → Missions and facts: uses missions
packages/shared/src/engine/index.ts - Quest rules engine → Game contracts: validates state
packages/shared/src/engine/index.ts - HTTP application → Service assembly: creates services
apps/server/src/app.ts - Service assembly → Session store: creates store
apps/server/src/services.ts - Service assembly → Dialogue providers: creates provider
apps/server/src/services.ts - Service assembly → Speech providers: creates provider
apps/server/src/services.ts - Service assembly → World service: creates world service
apps/server/src/services.ts - Audio route → Speech providers: serves speech
- Game interface → World renderer: renders world
apps/web/src/app/App.tsx - World renderer → Chunk streaming and render: renders city chunks
apps/web/src/world/WorldRenderer.tsx - Chunk streaming and render → World service: requests streamed chunks
- World service → AI city composer: requests AI layouts
apps/server/src/city/world-service.ts - World service → City planning and validation: plans fallback chunks
apps/server/src/city/world-service.ts - City planning and validation → City manifest contracts: builds manifests
packages/shared/src/city/fallback.ts - Reply audio playback → Audio route: fetches reply audio
- Game interface → Reply audio playback: plays NPC replies
apps/web/src/app/App.tsx - Game interface → Dictionary interface: shows glosses
apps/web/src/app/App.tsx - Dictionary interface → Dictionary routes and lookup: looks up text
- Dictionary routes and lookup → Dictionary lookup data: segments and looks up
apps/server/src/dictionary/router.ts - Game interface → Live voice relay: supports voice chat