How piipi-inc/santa_project works
Santa game-app lets users authenticate, create or join a lobby, see its participants, start or restart a randomized gift exchange, and retrieve their assigned recipient’s preferences. The React/MobX frontend selects screens and manages user and lobby state through an API client; the FastAPI backend handles authentication and game operations backed by PostgreSQL, with lobby WebSocket broadcasts. The graph includes documented event and user API branches, though their endpoint implementations were not sampled; frontend-to-backend links are shown as unverified because the excerpts do not establish their wiring.
Main entry points: index.tsx Screen router · __init__.py Versioned router · Lobbies/index.ts Lobby state · store/index.ts Root store
Components 27
Frontend experience
- App shell
frontend/src/App.tsx - Screen router
frontend/src/components/ScreenSwitch/index.tsx - Authentication UI
frontend/src/components/Authenticate/index.tsx - Lobby view
frontend/src/components/Lobby/index.tsx - Lobby browsing
frontend/src/components/Main/index.tsx - Storytelling
frontend/src/components/StoryTelling/index.tsx - Preferences
frontend/src/components/Preferences/index.tsx
Client state and API
- Root store
frontend/src/store/index.ts - User state
frontend/src/store/User/index.ts - Lobby state
frontend/src/store/Lobbies/index.ts - Screen state
frontend/src/store/screen/index.ts - API client
frontend/src/api/index.ts - API data types
frontend/src/api/types/types.ts - API mocks
frontend/src/api/mocks.ts
Backend API
- FastAPI application
backend/src/main.py - Versioned router
backend/src/api/v1/__init__.py - Auth endpoints
backend/src/api/v1/endpoints/auth.py - Lobby endpoints
backend/src/api/v1/endpoints/lobbies.py - Event endpoints
backend/src/api/v1/endpoints/events.py - User endpoints
backend/src/api/v1/endpoints/users.py
Game domain and storage
- Auth manager
backend/src/services/auth_manager_service.py - Lobby participants
backend/src/models/participant.py - User model
backend/src/models/user.py - Event model
backend/src/models/event.py - Database sessions
backend/src/core/database.py
Other components
- Player
- PostgreSQL
Connections 36
- Player → App shell: uses
- App shell → Screen router: renders
frontend/src/App.tsx - App shell → Root store: initializes
frontend/src/App.tsx - Screen router → Authentication UI: selects
- Screen router → Lobby view: selects
- Screen router → Lobby browsing: selects
- Screen router → Storytelling: selects
- Screen router → Preferences: selects
- Authentication UI → User state: uses
frontend/src/components/Authenticate/index.tsx - Lobby view → Lobby state: uses
frontend/src/components/Lobby/index.tsx - Lobby browsing → Lobby state: renders
frontend/src/components/Main/index.tsx - Preferences → Root store: uses
- Root store → User state: initializes
frontend/src/store/index.ts - Root store → Lobby state: initializes
frontend/src/store/index.ts - Root store → Screen state: changes
frontend/src/store/index.ts - Lobby state → Screen state: changes
frontend/src/store/Lobbies/index.ts - User state → API client: calls
frontend/src/store/User/index.ts - Lobby state → API client: calls
frontend/src/store/Lobbies/index.ts - Lobby view → Lobby state: starts exchange
frontend/src/components/Lobby/index.tsx - API client → API data types: uses
frontend/src/api/index.ts - API client → API mocks: uses
frontend/src/api/index.ts - API client → Versioned router: requests
- FastAPI application → Versioned router: mounts
backend/src/main.py - Versioned router → Auth endpoints: registers
backend/src/api/v1/__init__.py - Versioned router → Lobby endpoints: registers
backend/src/api/v1/__init__.py - Versioned router → Event endpoints: registers
backend/src/api/v1/__init__.py - Versioned router → User endpoints: registers
backend/src/api/v1/__init__.py - Auth endpoints → Auth manager: calls
backend/src/api/v1/endpoints/auth.py - Auth endpoints → Database sessions: depends on
backend/src/api/v1/endpoints/auth.py - Lobby endpoints → Database sessions: queries
backend/src/api/v1/endpoints/lobbies.py - Lobby endpoints → Auth manager: authenticates
backend/src/api/v1/endpoints/lobbies.py - Lobby endpoints → Lobby participants: updates
backend/src/api/v1/endpoints/lobbies.py - Auth manager → Database sessions: queries
backend/src/services/auth_manager_service.py - Auth manager → User model: creates
backend/src/services/auth_manager_service.py - Database sessions → PostgreSQL: connects
backend/src/core/database.py - Event endpoints → Event model: uses