How wxyz-abcd/node-haxball works
Core API Layer
• Main API object containing all exported components
• Enums (OperationType, VariableType, etc.)
• Core utility classes (Utils, EventFactory)
Room Management Layer
• Room class as the central component
• Connection handling (WebSocket/WebRTC)
• State management
• Event system
Extension System
• Plugin system
• Renderer system
• Library system
• Language system
• RoomConfig system
Implementation Layer
• Core physics engine components
• Stream handling (Reader/Writer)
• Network protocol implementation
Environment Integration
• Browser integration
• Node.js integration
• Proxy server communication
[Client Applications]
• ↑↓
[Environment Layer]
• Browser ←→ Node.js
• ↑↓
[API Interface Layer]
• Exported Components
• Enums & Constants
• ↑↓
[Core Services Layer]
• Room Management → Event System
• ↑↓ ↑↓
• State Management ←→ Physics Engine
• ↑↓
[Extension Layer]
• Plugins ←→ Libraries
• ↑↓ ↑↓
• Renderer ←→ RoomConfig
• ↑↓
[Implementation Layer]
• Network Protocol
• Stream Handling
• ↑↓
[External Services]
• WebSocket/WebRTC
• Proxy Server
Design Guidelines:
• Blue for core API components
• Green for extension systems
• Orange for implementation details
• Gray for external services
• Double lines for primary data paths
Important notes
• Version compatibility
• Environment requirements
• Key configuration options
Integration with external services
This will provide a clear understanding of:
• How different components interact
• Where custom code can be integrated
• How data flows through the system
• Where potential bottlenecks might occur
• How the system scales and extends