How thevidhipandey/what-the-word works
WhatTheWord is a client-side word-guessing game: players choose word length and difficulty, make guesses, receive per-letter feedback, and either win or see the answer before replaying. Game state, keyboard input, evaluation, and presentation live together in the home route; word lists and reveal meanings are supplied by a separate data module. The app also has a TanStack routing shell and server-side error handling. The game excerpt is partial, so internal transitions not shown there are represented as game responsibilities rather than inferred module calls.
Main entry points: index.tsx Game screen · routeTree.gen.ts Route tree · server.ts Server entry · __root.tsx Root shell
Components 14
Word game
- Game screen
src/routes/index.tsx - Word data
src/lib/word-data.ts - Game interface
src/routes/index.tsx
App routing
- Router setup
src/router.tsx - Route tree
src/routeTree.gen.ts - Root shell
src/routes/__root.tsx - UI components
src/components/ui - Mobile detection
src/hooks/use-mobile.tsx - Sidebar
src/components/ui/sidebar.tsx
Error handling
- Server entry
src/server.ts - Error capture
src/lib/error-capture.ts - Error page
src/lib/error-page.ts - Error reporting
src/lib/lovable-error-reporting.ts
Other components
- Player
Connections 10
- Player → Game screen: plays
- Game screen → Word data: reads lists and meanings
src/routes/index.tsx - Game screen → Game interface: renders
src/routes/index.tsx - Router setup → Route tree: configures
src/router.tsx - Route tree → Root shell: registers
src/routeTree.gen.ts - Route tree → Game screen: registers
src/routeTree.gen.ts - Root shell → Error reporting: reports errors
src/routes/__root.tsx - Sidebar → Mobile detection: checks viewport
src/components/ui/sidebar.tsx - Server entry → Error capture: consumes captured errors
src/server.ts - Server entry → Error page: renders fallback
src/server.ts