How kim-seokjin/sos works
SOS is a timed competitive puzzle web app: a player signs in, loads a puzzle, solves it under a 60-second limit (with a one-use hint), submits a result, and views global rankings or personal history. The React client communicates with FastAPI; the README documents PostgreSQL, Redis ranking, and S3 puzzle assets, while backend endpoint internals beyond sign-in were not sampled. Edges for those capabilities are therefore limited to documented relationships; unsampled implementation details are not inferred.
Main entry points: Play.tsx Puzzle play · AppRoutes.tsx App routes · api.py API router · HallOfFame.tsx Global rankings
Components 26
Player experience
- App routes
src/routes/AppRoutes.tsx - Sign-in
src/pages/SignIn.tsx - Puzzle play
src/pages/Play.tsx - Puzzle interface
src/components/PuzzleGrid.tsx - Game timer
src/components/TimerDisplay.tsx - Hint dialog
src/components/HintDialog.tsx - Win and secret message
src/components/SuccessDialog.tsx - Global rankings
src/pages/HallOfFame.tsx - Personal records
src/pages/MyRecords.tsx
Client services
- Auth state
src/lib/store/useAuthStore.ts - Sign-in client
src/lib/auth.ts - Game client
src/lib/game.ts - Ranking client
src/lib/ranking.ts - Realtime client
src/lib/socket.ts - HTTP client
src/lib/api.ts
API and game services
- FastAPI app
backend/app/main.py - API router
backend/app/api/v1/api.py - Authentication
backend/app/api/v1/endpoints/auth.py - Game records
backend/app/api/v1/endpoints/games.py - Puzzle service
backend/app/api/v1/endpoints/puzzles.py - Ranking service
backend/app/api/v1/endpoints/ranks.py - Socket.IO server
backend/app/core/socket.py
Persistence and assets
- SQL database
backend/app/db/session.py - Redis rankings
backend/app/core/redis.py - Puzzle image assets
backend/app/core/s3.py
Other components
- Player
Connections 32
- Player → App routes: opens app
- App routes → Sign-in: routes to
src/routes/AppRoutes.tsx - App routes → Puzzle play: routes to
src/routes/AppRoutes.tsx - App routes → Global rankings: routes to
src/routes/AppRoutes.tsx - App routes → Personal records: routes to
src/routes/AppRoutes.tsx - Sign-in → Sign-in client: calls
src/lib/auth.ts - Sign-in client → HTTP client: posts sign-in
src/lib/auth.ts - Sign-in → Auth state: sets session
src/lib/store/useAuthStore.ts - Puzzle play → Game client: loads and submits
src/pages/Play.tsx - Puzzle play → Puzzle interface: renders
src/pages/Play.tsx - Puzzle play → Game timer: renders
src/pages/Play.tsx - Puzzle play → Hint dialog: renders
src/pages/Play.tsx - Puzzle play → Win and secret message: renders
src/pages/Play.tsx - Puzzle play → Auth state: checks session
src/pages/Play.tsx - Game client → HTTP client: uses HTTP
src/lib/game.ts - Global rankings → Ranking client: loads rankings
src/lib/ranking.ts - Global rankings → Realtime client: connects realtime
src/pages/HallOfFame.tsx - Personal records → Game client: loads history
src/pages/MyRecords.tsx - HTTP client → FastAPI app: sends API requests
- FastAPI app → API router: mounts router
backend/app/main.py - FastAPI app → Socket.IO server: mounts Socket.IO
backend/app/main.py - API router → Authentication: registers routes
backend/app/api/v1/api.py - API router → Game records: registers routes
backend/app/api/v1/api.py - API router → Puzzle service: registers routes
backend/app/api/v1/api.py - API router → Ranking service: registers routes
backend/app/api/v1/api.py - Authentication → SQL database: reads and writes
backend/app/api/v1/endpoints/auth.py - Authentication → Player: issues token
backend/app/api/v1/endpoints/auth.py - Game records → SQL database: stores history
- Puzzle service → Puzzle image assets: serves puzzle assets
- Ranking service → Redis rankings: updates rankings
- Ranking service → SQL database: reads records
- Socket.IO server → Global rankings: publishes live updates