# kushalongit-hub/openconnect architecture

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

- Interactive diagram: https://gitdiagram.com/kushalongit-hub/openconnect
- Repository: https://github.com/kushalongit-hub/openconnect

## Overview

OpenConnect is a mobile-first remote-control dashboard for a Windows PC. A phone browser loads the dashboard from the Express server, then uses it for a live shell, keyboard shortcuts, and Sunshine availability checks. Terminal input and output pass through Socket.IO and the server’s PTY; shortcut input is relayed through the `/bridge` WebSocket to the Go helper, which injects Windows input. For desktop streaming, the dashboard offers Moonlight launch options while Sunshine handles the stream. The README documents the UI capabilities; frontend implementation details were not sampled.

Main entry points: [`mobile-term/public/index.html`](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/public/index.html) (Dashboard UI), [`mobile-term/server.js`](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/server.js) (Socket.IO), [`mobile-term/native-bridge/main.go`](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/native-bridge/main.go) (Native bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Mobile dashboard"]
  node_dashboard_ui["Dashboard UI<br/>[index.html]"]
  node_express["Express server<br/>[server.js]"]
end

subgraph group_terminal["Terminal"]
  node_terminal_socket["Socket.IO<br/>[server.js]"]
  node_pty["PTY shell<br/>[server.js]"]
end

subgraph group_input["Remote input"]
  node_shortcuts["Shortcut controls<br/>[index.html]"]
  node_bridge_ws["Bridge WebSocket<br/>[server.js]"]
  node_native_bridge["Native bridge<br/>[main.go]"]
  node_sendinput["Windows SendInput<br/>[main.go]"]
end

subgraph group_streaming["GUI streaming"]
  node_sunshine_check["Sunshine status<br/>[server.js]"]
  node_sunshine["Sunshine"]
  node_moonlight_options["Moonlight options<br/>[index.html]"]
  node_desktop_stream["Hardware-accelerated stream"]
end

node_phone(("Phone browser"))
node_windows_shell["Windows shell"]
node_moonlight_app["Moonlight app"]
node_moonlight_web["Moonlight web player"]

node_phone -->|"opens"| node_dashboard_ui
node_dashboard_ui -->|"loads from"| node_express
node_dashboard_ui -->|"sends terminal I/O"| node_terminal_socket
node_terminal_socket -->|"writes and resizes"| node_pty
node_pty -->|"runs"| node_windows_shell
node_pty -->|"returns output"| node_terminal_socket
node_terminal_socket -->|"sends output"| node_dashboard_ui
node_dashboard_ui -->|"uses"| node_shortcuts
node_shortcuts -->|"sends shortcut input"| node_terminal_socket
node_terminal_socket -->|"relays input"| node_bridge_ws
node_bridge_ws -->|"sends messages"| node_native_bridge
node_native_bridge -->|"injects input"| node_sendinput
node_dashboard_ui -->|"checks status"| node_sunshine_check
node_sunshine_check -->|"probes port"| node_sunshine
node_sunshine_check -->|"returns status"| node_dashboard_ui
node_dashboard_ui -->|"selects playback"| node_moonlight_options
node_moonlight_options -->|"launches app"| node_moonlight_app
node_moonlight_options -->|"opens player"| node_moonlight_web
node_moonlight_app -.->|"streams from"| node_sunshine
node_moonlight_web -.->|"streams from"| node_sunshine
node_sunshine -->|"captures and streams"| node_desktop_stream

click node_dashboard_ui "https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/public/index.html"
click node_express "https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/server.js"
click node_terminal_socket "https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/server.js"
click node_pty "https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/server.js"
click node_shortcuts "https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/public/index.html"
click node_bridge_ws "https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/server.js"
click node_native_bridge "https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/native-bridge/main.go"
click node_sendinput "https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/native-bridge/main.go"
click node_sunshine_check "https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/server.js"
click node_moonlight_options "https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/public/index.html"

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_dashboard_ui,node_express,node_phone toneBlue
class node_terminal_socket,node_pty toneAmber
class node_shortcuts,node_bridge_ws,node_native_bridge,node_sendinput toneMint
class node_sunshine_check,node_sunshine,node_moonlight_options,node_desktop_stream toneRose
class node_windows_shell,node_moonlight_app,node_moonlight_web toneIndigo
```

## Components

### Mobile dashboard

- [Dashboard UI](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/public/index.html): `mobile-term/public/index.html`
- [Express server](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/server.js): `mobile-term/server.js`

### Terminal

- [Socket.IO](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/server.js): `mobile-term/server.js`
- [PTY shell](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/server.js): `mobile-term/server.js`

### Remote input

- [Shortcut controls](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/public/index.html): `mobile-term/public/index.html`
- [Bridge WebSocket](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/server.js): `mobile-term/server.js`
- [Native bridge](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/native-bridge/main.go): `mobile-term/native-bridge/main.go`
- [Windows SendInput](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/native-bridge/main.go): `mobile-term/native-bridge/main.go`

### GUI streaming

- [Sunshine status](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/server.js): `mobile-term/server.js`
- **Sunshine**
- [Moonlight options](https://github.com/kushalongit-hub/openconnect/blob/main/mobile-term/public/index.html): `mobile-term/public/index.html`
- **Hardware-accelerated stream**

### Other components

- **Phone browser**
- **Windows shell**
- **Moonlight app**
- **Moonlight web player**

## Connections

- Phone browser → Dashboard UI: opens
- Dashboard UI → Express server: loads from
- Dashboard UI → Socket.IO: sends terminal I/O
- Socket.IO → PTY shell: writes and resizes
- PTY shell → Windows shell: runs
- PTY shell → Socket.IO: returns output
- Socket.IO → Dashboard UI: sends output
- Dashboard UI → Shortcut controls: uses
- Shortcut controls → Socket.IO: sends shortcut input
- Socket.IO → Bridge WebSocket: relays input
- Bridge WebSocket → Native bridge: sends messages
- Native bridge → Windows SendInput: injects input
- Dashboard UI → Sunshine status: checks status
- Sunshine status → Sunshine: probes port
- Sunshine status → Dashboard UI: returns status
- Dashboard UI → Moonlight options: selects playback
- Moonlight options → Moonlight app: launches app
- Moonlight options → Moonlight web player: opens player
- Moonlight app → Sunshine: streams from
- Moonlight web player → Sunshine: streams from
- Sunshine → Hardware-accelerated stream: captures and streams
