How hubs-foundation/hubs works
Main Components
a. Client-Side Core Components:
• React UI Layer (/src/react-components)
• A-Frame/Three.js 3D Engine Integration
• WebXR System (/src/systems/userinput)
• Networking Layer (/src/network-schemas.ts)
• Media Systems (/src/systems)
• Authentication System (/src/react-components/auth)
b. External Services Integration:
• Reticulum Backend Connection
• Media Storage/CDN
• Authentication Services
• WebRTC Services
Key Architectural Patterns to Highlight
a. Component Architecture:
• Relationship between React components and A-Frame entities
• ECS (Entity Component System) pattern used with bit-components and bit-systems
• Event system architecture
b. Network Architecture:
• WebRTC peer connections
• Phoenix Channels integration
• Network schema synchronization
┌─────────────────────────────────────────────┐
• User Interface │
• ┌─────────┐ ┌─────────┐ ┌─────────┐ │
• React │ │ HUD │ │ Menus │ │
• ┘ └─────────┘ └─────────┘ │
• ┤
• 3D Engine Layer │
• ┌─────────┐ ┌─────────┐ ┌─────────┐ │
• A-Frame │ │Three.js │ │ Physics │ │
• ┘ └─────────┘ └─────────┘ │
• ┤
• Systems Layer │
• ┌─────────┐ ┌─────────┐ ┌─────────┐ │
• Input │ │ Network │ │ Media │ │
• ┘ └─────────┘ └─────────┘ │
• ┤
• Service Integration │
• ┌─────────┐ ┌─────────┐ ┌─────────┐ │
• Reticulum│ │ WebRTC │ │ Auth │ │
• ┘ └─────────┘ └─────────┘ │
• ┘
Important Relationships
• Data flow between React UI and A-Frame components
• WebRTC peer connections between clients
• Media loading and streaming pathways
• Authentication flow
• Scene graph hierarchy
• Network state synchronization