# epicgamesext/pixelstreaminginfrastructure architecture

> Architecture diagram of the GitHub repository epicgamesext/pixelstreaminginfrastructure, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/epicgamesext/pixelstreaminginfrastructure
- Repository: https://github.com/epicgamesext/pixelstreaminginfrastructure

## Overview

##### Main Components

a) Core Services:
- Signalling Web Server (Cirrus)
- SFU (Selective Forwarding Unit)
- Frontend Applications
- Unreal Engine Instance (external component)

b) Libraries:
- Common Library
- Frontend Library
- UI Library
- Signalling Library

##### Component Relationships

**[Unreal Engine Instance] <--WebRTC--> [SFU] <--WebRTC--> [Frontend Client]**
- ^

- [Signalling Server]
- ^

- [Frontend Libraries + UI]

##### Detailed Component Breakdown

Frontend Section:
**[Frontend Implementation]**
- TypeScript Implementation
- React Implementation
- Angular Implementation

- Frontend Library
- Input Controllers
- Video Players
- WebRTC Controllers

- UI Library
- Overlays
- Controls
- Settings Panel

Signalling Section:
**[Signalling Server]**
- WebSocket Handlers
- Player Registry
- Streamer Registry
- Connection Management

SFU Section:
**[SFU]**
- MediaSoup Integration
- SDP Bridge
- Stream Management

##### Additional Elements

Include:
- Protocol indicators (WebRTC, WebSocket)
- Port numbers for services
- Container boundaries for dockerized components
- NPM package relationships

##### Deployment Context

How components can be:
- Containerized (Docker)
- Deployed separately
- Scaled independently

- The modular nature of the system
- Clear separation of concerns
- The central role of the signalling server
- The relationship between libraries and runtime components

Remember to:
- Version compatibility notes
- Security boundaries
- Scalable components
- Document external dependencies

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph External
        UE[Unreal Engine Instance]:::external
    end

    subgraph Core["Core Services"]
        direction TB
        SIG["Signalling Web Server"]:::core
        SFU["Selective Forwarding Unit"]:::core
        
        subgraph SignallingServer["Signalling Server Components"]
            direction TB
            WS["WebSocket Handlers"]:::component
            PR["Player Registry"]:::component
            SR["Streamer Registry"]:::component
            CM["Connection Management"]:::component
        end

        subgraph SFUComponents["SFU Components"]
            direction TB
            MS["MediaSoup Integration"]:::component
            SB["SDP Bridge"]:::component
            SM["Stream Management"]:::component
        end
    end

    subgraph Frontend["Frontend Layer"]
        direction TB
        subgraph Implementations["Frontend Implementations"]
            direction TB
            TS["TypeScript Implementation"]:::frontend
            RI["React Implementation"]:::frontend
            AI["Angular Implementation"]:::frontend
        end

        subgraph FLib["Frontend Library"]
            direction TB
            IC["Input Controllers"]:::library
            VP["Video Players"]:::library
            WC["WebRTC Controllers"]:::library
        end

        subgraph UILib["UI Library"]
            direction TB
            OV["Overlays"]:::library
            CT["Controls"]:::library
            SP["Settings Panel"]:::library
        end
    end

    subgraph SharedLibs["Shared Libraries"]
        direction TB
        CL["Common Library"]:::library
        SL["Signalling Library"]:::library
    end

    %% Relationships
    UE <--> |WebRTC| SFU
    SFU <--> |WebRTC| Frontend
    SIG <--> |WebSocket| Frontend
    SIG --- SignallingServer
    SFU --- SFUComponents
    Frontend --- SharedLibs
    Frontend --- FLib
    Frontend --- UILib

    %% Click Events
    click SIG "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/tree/master/SignallingWebServer"
    click SFU "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/tree/master/SFU"
    click TS "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/tree/master/Frontend/implementations/typescript"
    click RI "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/tree/master/Frontend/implementations/react"
    click AI "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/tree/master/Frontend/implementations/angular"
    click IC "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/tree/master/Frontend/library/src/Inputs"
    click VP "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/tree/master/Frontend/library/src/WebRtcPlayer"
    click OV "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/tree/master/Frontend/ui-library/src/Overlay"
    click CT "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/tree/master/Frontend/ui-library/src/UI"
    click CL "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/tree/master/Common"
    click SL "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/tree/master/Signalling"
    click PR "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/master/Signalling/src/PlayerRegistry.ts"
    click SR "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/master/Signalling/src/StreamerRegistry.ts"
    click SB "https://github.com/EpicGamesExt/PixelStreamingInfrastructure/tree/master/SFU/mediasoup-sdp-bridge"

    %% Styling
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef frontend fill:#2ecc71,stroke:#27ae60,color:white
    classDef library fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef component fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        direction TB
        L1[Core Services]:::core
        L2[Frontend Components]:::frontend
        L3[Libraries]:::library
        L4[External Systems]:::external
        L5[Internal Components]:::component
    end
```
