How brandon-carlisle/stadiumguessr works
Main Components
A. Frontend Layer:
• Next.js Application (React)
• Components Structure:
• Game Components (src/components/game/*)
• UI Components (src/components/ui/*)
• Pages Structure (src/pages/*)
• State Management:
• Redux Store (src/store/*)
• Sound Context (src/store/sound-context.tsx)
B. Backend Layer:
• tRPC API (src/server/api/*)
• Authentication System (NextAuth.js)
• Routers:
• Match Router
• Stadium Router
C. Database Layer:
• Prisma ORM
• Database Schema (defined in prisma/schema.prisma)
[Client Layer] → [API Layer] → [Data Layer]
Key Flows to Highlight
A. Game Flow:
• User Authentication Flow
• Game Session Management
• Stadium Data Retrieval
• Answer Validation
• Score Tracking
B. Data Flow:
• tRPC API Communications
• Database Interactions
• State Management Updates
Important Architectural Patterns
• Next.js Pages Router Architecture
• tRPC API Structure
• Redux State Management Flow
• Authentication Flow with NextAuth.js
Integration Points
• Integration with:
• NextAuth.js for authentication
• Prisma for database operations
• Leaflet for map functionality (src/components/game/leaflet-map.tsx)
• Sound system integration
Additional Elements
Specific features in separate sections:
• Game Logic Components
• User Management
• Match History
• Admin Functions (from admin.tsx)
• Sound Management System
Specific Implementation Details
Relationship between:
• Game state management (src/store/features/game)
• API routes (src/server/api/routers)
• Database schema
• Frontend components
Remember to emphasize the real-time nature of the game mechanics and how the frontend components interact with the backend services through tRPC, while maintaining a clean separation of concerns between the game logic, user interface, and data management layers.