# guygodin/virtualdesktop architecture

> Architecture diagram of the GitHub repository guygodin/virtualdesktop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/guygodin/virtualdesktop
- Repository: https://github.com/guygodin/virtualdesktop

## Overview

##### Main Components
- Desktop Streaming Server: This component runs on the computer. It handles capturing the game/audio/video output, compressing/encoding the stream, and managing the low-latency connection. It is responsible for integrating with SteamVR and handling peripheral inputs (Bluetooth mice, keyboards, gamepads).
- Client on Oculus Quest: The client application installed on the Oculus Quest receives the video/audio stream, decodes it, and presents it within the VR environment. It also handles inputs (gamepad emulation, Bluetooth connectivity) and if applicable, microphone passthrough.
- Networking Layer: A reliable network module (either over local Wi-Fi or Internet) that ensures minimal latency and synchronizes communication between the server and client.
- Peripheral Integration: While not a “standalone” component, the handling of multiple input devices (gamepad emulation, keyboard/mouse) should be clearly indicated as part of the communication between the streaming server and the client.

##### Relationships and Interactions
- The Desktop Streaming Server captures the output from SteamVR (including game visuals and audio) and encodes it into a stream.
- The network layer carries the encoded data from the server to the Oculus Quest client.
- The Oculus Quest client decodes the video/audio stream for display and sends back input data (touch events, Bluetooth input events) to the server.
- There is bidirectional communication ensuring that inputs on the Quest affect the game running on the PC, and any peripheral control or status messages are handled appropriately.

##### Architectural Patterns or Design Principles
- Client-Server Architecture: Emphasize the clear separation between the streaming server (desktop) and the client (mobile VR device).
- Peripheral Abstraction: The streaming server abstracts multiple peripherals and handles their inputs seamlessly. Indicate this layer as supporting diverse input devices and possibly a middleware layer for device emulation.

##### Relevant Technologies and Frameworks
- Although specific technologies aren’t mentioned in the README, you could annotate potential frameworks or libraries typically used for such streaming services (video encoding/decoding libraries, network streaming protocols, and Bluetooth stacks).
- Integration points with SteamVR and other OS-level services that might be involved in capturing the screen and device inputs.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Server Side"
        DSS["Desktop Streaming Server"]:::server
        PI["Peripheral Integration"]:::peripheral
        DSS -->|"handles_peripherals"| PI
    end

    NL["Networking Layer"]:::network

    subgraph "Client Side"
        OQC["Oculus Quest Client"]:::client
    end

    DSS -->|"streams_video/audio"| NL
    NL -->|"delivers_stream"| OQC
    OQC -->|"sends_input"| NL
    NL -->|"delivers_input"| DSS

    click DSS "https://github.com/guygodin/virtualdesktop/blob/master/README.md"
    click PI "https://github.com/guygodin/virtualdesktop/blob/master/README.md"
    click NL "https://github.com/guygodin/virtualdesktop/blob/master/README.md"
    click OQC "https://github.com/guygodin/virtualdesktop/blob/master/README.md"

    classDef server fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef peripheral fill:#FFD700,stroke:#000,stroke-width:2px;
    classDef network fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef client fill:#F08080,stroke:#000,stroke-width:2px;
```
