How webdevcody/survive-the-night-sim works
Main Components
a) Frontend Layer:
• Next.js Application (app directory structure)
• UI Components (components directory)
• Game Renderer (renderer directory)
• Game Simulator (simulator directory)
b) Backend Layer:
• Convex Backend (convex directory)
• Authentication Services
• AI Model Integration (models directory)
c) External Services:
• Various AI Models (GPT-4, Claude, Gemini, Mistral, Perplexity)
• OAuth Providers (GitHub, Google)
• Analytics (Plausible)
Client Tier
• Next.js Frontend
• Game UI Components
• Renderer Engine
• Simulator Engine
Service Tier
• Convex Backend
• Authentication
• Game Logic
• Multiplayer Management
• AI Model Integration
External Services Tier
• AI Models
• OAuth Providers
• Analytics
Key Relationships to Highlight
a) Data Flow:
• User interactions → Frontend → Convex Backend
• Backend → AI Models → Game Logic
• Real-time updates for multiplayer games
• Authentication flow with OAuth providers
b) Component Interactions:
• Renderer ↔ Simulator
• Game State ↔ AI Models
• User Authentication ↔ OAuth Providers
Technical Details
• Next.js 13+ App Router architecture
• Convex real-time database and backend
• WebGL/Canvas rendering system
• AI model integration points
• Authentication flow
• Analytics integration
Implementation Notes
• Version numbers for major components
• Environment configuration notes
Critical Paths to Highlight
• User authentication flow
• Game state management
• AI model selection and execution
• Multiplayer synchronization
• Score and leaderboard updates
Remember to include:
• Rate limiting mechanisms
• Error handling paths
• Scaling considerations
• Security boundaries
• Data persistence flows
This will provide a complete picture of how the system handles both single-player and multiplayer scenarios while managing multiple AI model integrations in a secure and scalable way.