# xx-139/watch-remote architecture

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

- Interactive diagram: https://gitdiagram.com/xx-139/watch-remote
- Repository: https://github.com/xx-139/watch-remote

## Overview

WatchRemoteP0 is a watchOS remote-viewing and input-control app. The main flow displays periodically fetched remote-screen frames and translates watch gestures into HTTP input requests; users can open extension settings to adjust display, quality, touch, and privacy preferences. The app also starts audio keep-alive and network/HTTP diagnostics. Settings values are modeled separately, and sampled code only visibly applies dimensions to coordinate mapping. The TCP frame receiver is present but no sampled caller connects it to the UI. No README product overview was provided.

Main entry points: [`WatchRemoteP0 Watch App/ContentView.swift`](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/ContentView.swift) (Remote screen), [`WatchRemoteP0 Watch App/WatchRemoteP0App.swift`](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/WatchRemoteP0App.swift) (App lifecycle), [`WatchRemoteP0 Watch App/ExtensionView.swift`](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/ExtensionView.swift) (Feature menu), [`WatchRemoteP0 Watch App/SettingsView.swift`](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/SettingsView.swift) (Settings controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_watch_ui["Watch interface"]
  node_screen["Remote screen<br/>[ContentView.swift]"]
  node_extension["Feature menu"]
end

subgraph group_remote_io["Remote communication"]
  node_frame_service["Frame endpoint"]
  node_input_service["Input endpoint"]
  node_tcp_receiver["TCP frame receiver"]
end

subgraph group_preferences["Settings"]
  node_settings_ui["Settings controls<br/>[SettingsView.swift]"]
  node_settings_state["Remote preferences"]
end

subgraph group_runtime_support["Runtime support"]
  node_app["App lifecycle"]
  node_audio_keepalive["Audio keep-alive"]
  node_network_debug["Network diagnostics<br/>[NetworkDebug.swift]"]
  node_http_test["HTTP probe<br/>[HTTPTest.swift]"]
end

node_user(("Watch user"))

node_user -->|"views and gestures"| node_screen
node_app -->|"shows"| node_screen
node_screen -->|"polls frames"| node_frame_service
node_screen -->|"sends touch events"| node_input_service
node_screen -->|"opens menu"| node_extension
node_extension -->|"routes to"| node_settings_ui
node_screen -->|"reads dimensions"| node_settings_state
node_settings_ui -->|"edits preferences"| node_settings_state
node_app -->|"starts"| node_audio_keepalive
node_app -->|"starts"| node_network_debug
node_app -->|"starts"| node_http_test
node_http_test -.->|"probes HTTP"| node_frame_service

click node_app "https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/WatchRemoteP0App.swift"
click node_screen "https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/ContentView.swift"
click node_extension "https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/ExtensionView.swift"
click node_settings_ui "https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/SettingsView.swift"
click node_settings_state "https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/RemoteSettings.swift"
click node_tcp_receiver "https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/TCPFrameReceiver.swift"
click node_audio_keepalive "https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/AudioKeepAlive.swift"
click node_network_debug "https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/NetworkDebug.swift"
click node_http_test "https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/HTTPTest.swift"

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_screen,node_extension,node_user toneBlue
class node_frame_service,node_input_service,node_tcp_receiver toneAmber
class node_settings_ui,node_settings_state toneMint
class node_app,node_audio_keepalive,node_network_debug,node_http_test toneRose
```

## Components

### Watch interface

- [Remote screen](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/ContentView.swift): `WatchRemoteP0 Watch App/ContentView.swift`
- [Feature menu](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/ExtensionView.swift): `WatchRemoteP0 Watch App/ExtensionView.swift`

### Remote communication

- **Frame endpoint**
- **Input endpoint**
- [TCP frame receiver](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/TCPFrameReceiver.swift): `WatchRemoteP0 Watch App/TCPFrameReceiver.swift`

### Settings

- [Settings controls](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/SettingsView.swift): `WatchRemoteP0 Watch App/SettingsView.swift`
- [Remote preferences](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/RemoteSettings.swift): `WatchRemoteP0 Watch App/RemoteSettings.swift`

### Runtime support

- [App lifecycle](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/WatchRemoteP0App.swift): `WatchRemoteP0 Watch App/WatchRemoteP0App.swift`
- [Audio keep-alive](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/AudioKeepAlive.swift): `WatchRemoteP0 Watch App/AudioKeepAlive.swift`
- [Network diagnostics](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/NetworkDebug.swift): `WatchRemoteP0 Watch App/NetworkDebug.swift`
- [HTTP probe](https://github.com/xx-139/watch-remote/blob/main/WatchRemoteP0%20Watch%20App/HTTPTest.swift): `WatchRemoteP0 Watch App/HTTPTest.swift`

### Other components

- **Watch user**

## Connections

- Watch user → Remote screen: views and gestures (evidence: `WatchRemoteP0 Watch App/ContentView.swift`)
- App lifecycle → Remote screen: shows (evidence: `WatchRemoteP0 Watch App/WatchRemoteP0App.swift`)
- Remote screen → Frame endpoint: polls frames (evidence: `WatchRemoteP0 Watch App/ContentView.swift`)
- Remote screen → Input endpoint: sends touch events (evidence: `WatchRemoteP0 Watch App/ContentView.swift`)
- Remote screen → Feature menu: opens menu (evidence: `WatchRemoteP0 Watch App/ContentView.swift`)
- Feature menu → Settings controls: routes to (evidence: `WatchRemoteP0 Watch App/ExtensionView.swift`)
- Remote screen → Remote preferences: reads dimensions (evidence: `WatchRemoteP0 Watch App/ContentView.swift`)
- Settings controls → Remote preferences: edits preferences (evidence: `WatchRemoteP0 Watch App/SettingsView.swift`)
- App lifecycle → Audio keep-alive: starts (evidence: `WatchRemoteP0 Watch App/WatchRemoteP0App.swift`)
- App lifecycle → Network diagnostics: starts (evidence: `WatchRemoteP0 Watch App/WatchRemoteP0App.swift`)
- App lifecycle → HTTP probe: starts (evidence: `WatchRemoteP0 Watch App/WatchRemoteP0App.swift`)
- HTTP probe → Frame endpoint: probes HTTP (evidence: `WatchRemoteP0 Watch App/HTTPTest.swift`)
