# bigdude129/web-remote-desktop architecture

> Architecture diagram of the GitHub repository bigdude129/web-remote-desktop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bigdude129/web-remote-desktop
- Repository: https://github.com/bigdude129/web-remote-desktop

## Overview

DeskLink is a web-based remote desktop MVP for controlling a Windows PC’s current console through a browser. A user signs in, selects an online device, and starts a time-limited session; the server coordinates the session and relays JPEG frames and input, while the Windows agent captures the screen and injects input. The product also includes device revocation, activity history, and agent-release discovery. The graph reflects README-documented capabilities and sampled source references; unsampled implementation details are not assumed.

Main entry points: [`server/app.ts`](https://github.com/bigdude129/web-remote-desktop/blob/main/server/app.ts) (HTTP API), [`agent/DeskLink.Agent/AgentClient.cs`](https://github.com/bigdude129/web-remote-desktop/blob/main/agent/DeskLink.Agent/AgentClient.cs) (Agent connection), [`server/hub.ts`](https://github.com/bigdude129/web-remote-desktop/blob/main/server/hub.ts) (Session relay), [`web/App.tsx`](https://github.com/bigdude129/web-remote-desktop/blob/main/web/App.tsx) (Account and devices)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_webapp["Account and devices<br/>[App.tsx]"]
  node_viewer["Remote viewer<br/>[Viewer.tsx]"]
  node_webapi["HTTP client<br/>[api.ts]"]
end

subgraph group_server["Server services"]
  node_app["HTTP API<br/>[app.ts]"]
  node_hub["Session relay<br/>[hub.ts]"]
  node_store[("Accounts and state<br/>[store.ts]")]
  node_config["Server configuration<br/>[config.ts]"]
  node_releases["Release discovery<br/>[releases.ts]"]
end

subgraph group_agent["Windows agent"]
  node_agentform["Agent controls<br/>[AgentForm.cs]"]
  node_agentclient["Agent connection<br/>[AgentClient.cs]"]
  node_desktop["Capture and input<br/>[NativeDesktop.cs]"]
  node_agentinfo["Agent version metadata<br/>[AgentInfo.cs]"]
end

subgraph group_shared["Shared contracts"]
  node_protocol["Input protocol<br/>[protocol.ts]"]
  node_releasecontract["Release metadata<br/>[releases.ts]"]
end

node_user(("User"))
node_browser(("Browser"))
node_github["GitHub releases"]
node_windows["Windows desktop"]

node_user -->|"uses"| node_browser
node_browser -->|"opens"| node_webapp
node_webapp -->|"calls"| node_webapi
node_webapi -->|"requests"| node_app
node_webapp -->|"opens session"| node_viewer
node_viewer -->|"exchanges frames and input"| node_hub
node_app -->|"reads and writes"| node_store
node_app -->|"delegates sessions"| node_hub
node_app -->|"uses settings"| node_config
node_app -->|"uses release service"| node_releases
node_hub -->|"reads and updates"| node_store
node_hub -->|"validates input"| node_protocol
node_releases -->|"uses metadata"| node_releasecontract
node_releases -->|"checks releases"| node_github
node_agentform -->|"controls connection"| node_agentclient
node_agentclient -->|"reads version"| node_agentinfo
node_agentclient -->|"captures screen"| node_desktop
node_desktop -->|"captures and injects input"| node_windows
node_agentclient -->|"connects and relays"| node_hub
node_agentclient -->|"exchanges input messages"| node_protocol
node_webapp -->|"offers agent download"| node_releases

click node_webapp "https://github.com/bigdude129/web-remote-desktop/blob/main/web/App.tsx"
click node_viewer "https://github.com/bigdude129/web-remote-desktop/blob/main/web/Viewer.tsx"
click node_webapi "https://github.com/bigdude129/web-remote-desktop/blob/main/web/api.ts"
click node_app "https://github.com/bigdude129/web-remote-desktop/blob/main/server/app.ts"
click node_hub "https://github.com/bigdude129/web-remote-desktop/blob/main/server/hub.ts"
click node_store "https://github.com/bigdude129/web-remote-desktop/blob/main/server/store.ts"
click node_config "https://github.com/bigdude129/web-remote-desktop/blob/main/server/config.ts"
click node_releases "https://github.com/bigdude129/web-remote-desktop/blob/main/server/releases.ts"
click node_agentform "https://github.com/bigdude129/web-remote-desktop/blob/main/agent/DeskLink.Agent/AgentForm.cs"
click node_agentclient "https://github.com/bigdude129/web-remote-desktop/blob/main/agent/DeskLink.Agent/AgentClient.cs"
click node_desktop "https://github.com/bigdude129/web-remote-desktop/blob/main/agent/DeskLink.Agent/NativeDesktop.cs"
click node_agentinfo "https://github.com/bigdude129/web-remote-desktop/blob/main/agent/DeskLink.Agent/AgentInfo.cs"
click node_protocol "https://github.com/bigdude129/web-remote-desktop/blob/main/shared/protocol.ts"
click node_releasecontract "https://github.com/bigdude129/web-remote-desktop/blob/main/shared/releases.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_viewer,node_webapi,node_user,node_browser toneBlue
class node_app,node_hub,node_store,node_config,node_releases toneAmber
class node_agentform,node_agentclient,node_desktop,node_agentinfo toneMint
class node_protocol,node_releasecontract toneRose
class node_github,node_windows toneIndigo
```

## Components

### Web client

- [Account and devices](https://github.com/bigdude129/web-remote-desktop/blob/main/web/App.tsx): `web/App.tsx`
- [Remote viewer](https://github.com/bigdude129/web-remote-desktop/blob/main/web/Viewer.tsx): `web/Viewer.tsx`
- [HTTP client](https://github.com/bigdude129/web-remote-desktop/blob/main/web/api.ts): `web/api.ts`

### Server services

- [HTTP API](https://github.com/bigdude129/web-remote-desktop/blob/main/server/app.ts): `server/app.ts`
- [Session relay](https://github.com/bigdude129/web-remote-desktop/blob/main/server/hub.ts): `server/hub.ts`
- [Accounts and state](https://github.com/bigdude129/web-remote-desktop/blob/main/server/store.ts): `server/store.ts`
- [Server configuration](https://github.com/bigdude129/web-remote-desktop/blob/main/server/config.ts): `server/config.ts`
- [Release discovery](https://github.com/bigdude129/web-remote-desktop/blob/main/server/releases.ts): `server/releases.ts`

### Windows agent

- [Agent controls](https://github.com/bigdude129/web-remote-desktop/blob/main/agent/DeskLink.Agent/AgentForm.cs): `agent/DeskLink.Agent/AgentForm.cs`
- [Agent connection](https://github.com/bigdude129/web-remote-desktop/blob/main/agent/DeskLink.Agent/AgentClient.cs): `agent/DeskLink.Agent/AgentClient.cs`
- [Capture and input](https://github.com/bigdude129/web-remote-desktop/blob/main/agent/DeskLink.Agent/NativeDesktop.cs): `agent/DeskLink.Agent/NativeDesktop.cs`
- [Agent version metadata](https://github.com/bigdude129/web-remote-desktop/blob/main/agent/DeskLink.Agent/AgentInfo.cs): `agent/DeskLink.Agent/AgentInfo.cs`

### Shared contracts

- [Input protocol](https://github.com/bigdude129/web-remote-desktop/blob/main/shared/protocol.ts): `shared/protocol.ts`
- [Release metadata](https://github.com/bigdude129/web-remote-desktop/blob/main/shared/releases.ts): `shared/releases.ts`

### Other components

- **User**
- **Browser**
- **GitHub releases**
- **Windows desktop**

## Connections

- User → Browser: uses (evidence: `README.md`)
- Browser → Account and devices: opens (evidence: `README.md`)
- Account and devices → HTTP client: calls (evidence: `web/App.tsx`)
- HTTP client → HTTP API: requests (evidence: `README.md`)
- Account and devices → Remote viewer: opens session (evidence: `README.md`)
- Remote viewer → Session relay: exchanges frames and input (evidence: `README.md`)
- HTTP API → Accounts and state: reads and writes (evidence: `server/app.ts`)
- HTTP API → Session relay: delegates sessions (evidence: `server/app.ts`)
- HTTP API → Server configuration: uses settings (evidence: `server/app.ts`)
- HTTP API → Release discovery: uses release service (evidence: `server/app.ts`)
- Session relay → Accounts and state: reads and updates (evidence: `server/hub.ts`)
- Session relay → Input protocol: validates input (evidence: `server/hub.ts`)
- Release discovery → Release metadata: uses metadata (evidence: `server/releases.ts`)
- Release discovery → GitHub releases: checks releases (evidence: `README.md`)
- Agent controls → Agent connection: controls connection (evidence: `agent/DeskLink.Agent/AgentForm.cs`)
- Agent connection → Agent version metadata: reads version (evidence: `agent/DeskLink.Agent/AgentClient.cs`)
- Agent connection → Capture and input: captures screen (evidence: `agent/DeskLink.Agent/AgentClient.cs`)
- Capture and input → Windows desktop: captures and injects input (evidence: `agent/DeskLink.Agent/NativeDesktop.cs`)
- Agent connection → Session relay: connects and relays (evidence: `README.md`)
- Agent connection → Input protocol: exchanges input messages (evidence: `README.md`)
- Account and devices → Release discovery: offers agent download (evidence: `README.md`)
