How nestrilabs/nestri works
Main System Components
a) Client Layer:
• Frontend applications (Qwik-based web interface)
• User interfaces for game management and streaming
• Input handling systems (keyboard, mouse, controller support)
b) Infrastructure Layer:
• Cloudflare Services (Workers, Pages)
• AWS Route53 for DNS
• Supabase for database
• Media-Over-Quic (MOQ) streaming protocol
c) Core Gaming Layer:
• CrosVM with Virtio-GPU Venus/Virgl support
• Game containers and virtualization
• GPU passthrough system
• Streaming encoders/decoders
Component Relationships
a) User Flow:
Client Browser -> Cloudflare Pages -> API Workers -> Gaming Backend
b) Streaming Flow:
Game Instance -> MOQ Protocol -> Relay Server -> Client Browser
c) Data Flow:
User Actions -> Input Handler -> Game Instance -> Video/Audio Stream -> Client
Key Architectural Elements
Specific components:
a) Frontend Services:
• Website (apps/www)
• Documentation (apps/docs)
• UI Components (packages/ui)
b) Backend Services:
• Relay Server (packages/relay)
• Master Server (packages/master)
• API Server (packages/api)
c) Core Components:
• MOQ Implementation (packages/moq)
• Input Handler (packages/input)
• Server Runtime (packages/server)
Specific Implementation Details
Technical implementations:
a) Container Architecture:
Docker Container
• CrosVM
• Game Instance
• Virtio-GPU Support
• GPU Passthrough
b) Streaming Pipeline:
Game Output -> Video Encoding -> MOQ Protocol -> Relay -> Client Decoder
Additional Elements
Features:
• Family sharing system
• Multiplayer session management
• Stream broadcasting to YouTube/Twitch
• Save state management
Integration Points
Connections:
• Game store integrations (Steam, Epic, GOG)
• Streaming platform integrations
• Authentication system
• API endpoints
This architecture should emphasize Nestri's position as a self-hosted solution while showing how it achieves its goal of providing a comprehensive cloud gaming platform with social features.