How tjholm/multiboy works
Main Components
a. Client-Side (Browser):
• Astro Pages (host.astro, guest.astro, index.astro)
• Game Components (Controls.tsx, Countdown.tsx)
• State Management (stores folder - countdown, game, strategy, you)
• WebRTC Components (lib/spoke.ts, lib/hub.ts)
• GameBoy Emulator
b. Backend Services:
• Asset Management API
• WebSocket Signaling Server
• Database Resources (src/backend/resources/db.ts)
c. Cloud Infrastructure:
• AWS specific components defined in nitric.aws.yaml
• Database (DynamoDB or similar as indicated by db.ts)
• WebSocket API Gateway
• REST API Gateway
Connection Flows
a. WebRTC Peer-to-Peer Connections:
• Direct lines between clients for game state sharing
• That this is the primary game data channel
b. Signaling Flow:
• Lines from clients to WebSocket API for connection negotiation
• This is only for initial connection setup
c. Asset Management:
• RESTful communication between clients and backend API
Game Mode Representation
A small section showing the three game modes:
• Chaos Mode
• Shuffle Mode
• Hotseat Mode
Specific Implementation Details
Notes for:
• WebRTC peer connections (no TURN servers)
• State management flow using stores
• Game input handling system
[Client Layer]
• ↕
[WebRTC P2P Layer]
• ↕
[Backend Services Layer]
• ↕
[Cloud Infrastructure Layer]
Important Considerations:
How the emulator integrates with the input management system
• All component types
• Connection types (WebRTC, WebSocket, REST)
• Game mode indicators
• State flow markers
• How game inputs are shared between players
• How the signaling server facilitates connections
• How different game modes affect input handling
• The role of each store in state management
This architecture should clearly demonstrate the distributed nature of the application while highlighting the minimal backend requirements due to the P2P approach.