How xriku/react-queens-blood works
Client-Side Architecture
• React Components Layer (showing key components like Board, Card, Hand)
• State Management Layer (Zustand stores)
• Socket Client Layer
• Assets Management (sounds)
Server-Side Architecture
• Socket.io Server
• Game Logic Handler
• Room Management System
Communication Layer
• Socket.io WebSocket connection between client and server
• Real-time event flow for game actions
┌─────────────────────────────────────────────┐
• Client (React Application) │
• ┌─────────────┐ ┌─────────────┐ │
• UI Layer │ │State Layer │ │
• (Zustand) │ │
• ┘ └─────────────┘ │
• ┌─────────────┐ ┌─────────────┐ │
• Socket Client│ │ Assets │ │
• ┘ └─────────────┘ │
• ┘
• ↕ WebSocket Connection
┌─────────────────────────────────────────────┐
• Server (Socket.io) │
• ┌─────────────┐ ┌─────────────┐ │
• Room Manager │ │ Game Logic │ │
• ┘ └─────────────┘ │
• ┘
Client-Side Components
• Relationship between pages (Home, CreateGame, WaitingRoom, Game)
• How components interact with stores
• Sound asset management system
State Management
• Detail all Zustand stores (BoardStore, CardStore, GameStore, etc.)
• Their relationships and data flow
Socket Communication
• Real-time event flow
• Room management system
• Game state synchronization
Game Logic
• Card placement system
• Turn management
• Scoring system
Additional Recommendations:
• Data flow between components
• Socket event communication
• State updates
• Game state machine
• Card placement logic
• Score calculation system