How jtschneider/phcremotecontrol works
PHC Remote contains two independent control clients: a native SwiftUI app that connects directly to STM v3, and a Go bridge that serves a browser UI over HTTP/SSE. In each, users browse parsed installation devices and issue device-specific commands; AMD state polling is supported, while many other controls only acknowledge dispatch. The diagram preserves project loading, caching, live control, and browser serving. Some bridge internals are unsampled, so their documented relationships use README evidence rather than implying uninspected call details.
Main entry points: HomeStore.swift Home state · main.go Bridge service · controller.go Control and polling · server.go HTTP and SSE
Components 23
Native iOS client
- App entry
Sources/PHCRemoteControlApp.swift - SwiftUI views
Sources/Views/HomeView.swift - Device controls
Sources/Views/DeviceCard.swift - Home state
Sources/Store/HomeStore.swift - Project cache
Sources/Store/ProjectCache.swift - Project model
Sources/Models/PHCProject.swift - Device model
Sources/Models/Device.swift - Project parser
Sources/Client/PHCProjectParser.swift - Client interface
Sources/Client/PHCClient.swift - STM client
Sources/Client/STMv3Client.swift - Demo client
Sources/Client/MockPHCClient.swift
Go bridge
- Bridge service
bridge/cmd/phc-bridge/main.go - Project download
bridge/internal/project/download.go - Project parser
bridge/internal/project/parser.go - Project domain
bridge/internal/domain/model.go - Control and polling
bridge/internal/controller/controller.go - STM transport
bridge/internal/stm/client.go - Parsed project cache
bridge/internal/cache/cache.go - HTTP and SSE
bridge/internal/web/server.go - Browser pages
bridge/internal/web/pages.go
PHC hardware
- STM v3
Other components
- iPhone/iPad user
- LAN browser user
Connections 26
- iPhone/iPad user → SwiftUI views: uses
README.md - App entry → Home state: installs
Sources/PHCRemoteControlApp.swift - SwiftUI views → Home state: sends intents
README.md - SwiftUI views → Device controls: renders
Sources/Views/HomeView.swift - Device controls → Home state: dispatches actions
Sources/Views/DeviceCard.swift - Home state → Client interface: uses
Sources/Store/HomeStore.swift - Home state → Project cache: loads and saves
Sources/Store/HomeStore.swift - Home state → Project model: holds project
Sources/Store/HomeStore.swift - Project parser → Project model: builds
Sources/Client/PHCProjectParser.swift - Project model → Device model: contains devices
Sources/Models/PHCProject.swift - STM client → Project parser: parses download
Sources/Client/STMv3Client.swift - STM client → STM v3: calls XML-RPC
Sources/Client/STMv3Client.swift - Demo client → Client interface: implements
Sources/Client/MockPHCClient.swift - iPhone/iPad user → App entry: starts
README.md - Bridge service → HTTP and SSE: serves
bridge/cmd/phc-bridge/main.go - Bridge service → Control and polling: composes
bridge/cmd/phc-bridge/main.go - Bridge service → Project download: loads project
bridge/cmd/phc-bridge/main.go - Bridge service → Parsed project cache: configures cache
bridge/cmd/phc-bridge/main.go - Project download → STM transport: reads project
bridge/internal/project/download.go - Project parser → Project domain: builds model
bridge/internal/project/parser.go - Control and polling → STM transport: sends commands
README.md - Control and polling → Project domain: manages state
README.md - HTTP and SSE → Control and polling: routes actions
README.md - HTTP and SSE → Browser pages: serves pages
bridge/internal/web/server.go - LAN browser user → HTTP and SSE: HTTP and SSE
README.md - STM transport → STM v3: uses XML-RPC
README.md