How hiveboardgame/hive works
Main Components Identification
a) Frontend Layer (Leptos-based):
• Subcomponents for:
• Pages (/apis/src/pages)
• Components (atoms, molecules, organisms)
• Providers (websocket, game state, etc.)
b) Backend Services:
• WebSocket Server
• Client Handlers
• Server Handlers
• Connection Management
• Game Engine (/engine)
• Database Layer (/db)
c) External Systems:
• PostgreSQL Database
• Static Assets (tiles, sounds)
Component Relationships
a) Client-Server Communication:
Frontend <---> WebSocket Server (bidirectional)
Frontend ----> HTTP Endpoints (one-directional for static resources)
b) Internal Services:
WebSocket Server <---> Game Engine
WebSocket Server <---> Database Layer
Detailed Component Breakdown
Frontend (Leptos):
• Frontend |
• Pages |
• Components |
• Providers |
• WebSocket Client |
Backend:
• WebSocket Server |
• Connection Manager |
• Game Handlers |
• Tournament Handlers |
• Chat Handlers |
Game Engine:
• Game Engine |
• Board Logic |
• Game Rules |
• State Management |
• Move Validation |
Deployment Context
Containerization:
• Docker container boundaries
• Fly.io deployment configuration
• Development vs Production environments
This architecture emphasizes the real-time nature of the game server while showing how it handles multiple concerns like game state, user management, and tournament organization in a scalable way.