How daveyhert/dishylink works
Purpose and product boundaries
Dishylink is a local-first Starlink monitor/control suite delivered as three independent runtimes: Vite web development harness, Electron desktop app, and WXT browser extension. Each directly polls Starlink LAN APIs and maintains separate local history; optional authenticated Starlink cloud access adds account data and supported controls. Main UI starts at src/main.tsx and src/App.tsx.
Shared device protocol layer
The platform-neutral core/ layer communicates with dish and router grpc-web endpoints, decodes reflected protobuf schemas, normalizes telemetry, and issues safe configuration updates. It is the boundary between product runtimes and Starlink devices on the LAN.
• core/dishClient.ts
• core/grpcWeb.ts
• core/routerEndpoint.ts
• schema/dish.protoset
Telemetry, history, and alert domain
Telemetry unrolls the dish’s short ring buffer using its absolute sample counter; usage, energy, throughput, router-client history, and outages are derived into durable/displayable windows. The alert engine evaluates definitions and produces notifications independently of rendering.
• core/telemetry.ts
• core/throughputTracker.ts
• core/alertEngine.ts
• core/clientHistory.ts
Persistent desktop collector
The Node-based historian continuously polls and appends local records, preserving sampling gaps rather than interpolating them. Domain-specific stores support alerts, client totals/windows, energy, obstruction snapshots, thermal events, and router events. Electron runs this collector even when the app window is closed.
• collector/historian.mts
• collector/jsonLinesFile.mts
• collector/clientStore.mts
• electron/collector.ts
React dashboard and feature modules
The shared TypeScript/React frontend composes hook-driven LAN/cloud/history state into dashboard, network, settings, obstruction, satellite, usage, and alert interfaces. Hooks are the UI-to-domain integration boundary; components should not own device transport or durable history semantics.
• src/App.tsx
• src/hooks/useDishTelemetry.ts
• src/hooks/useRouterNetwork.ts
• src/components/dashboard/DashboardView.tsx
• src/components/settings/SettingsModal.tsx
Electron desktop host
Electron provides desktop lifecycle, IPC/preload isolation, tray/menu-bar or Windows throughput surfaces, preferences, notifications, auto-updates, and cloud/collector bridging. Renderer code reaches privileged services through IPC rather than Node APIs directly.
• electron/main.ts
• electron/ipc.ts
• electron/preload.ts
• electron/menuBarThroughput.ts
• electron/updater.ts
Browser extension host
The WXT extension has a background service worker plus a dashboard entrypoint. Its browser-specific transport handles LAN requests, IndexedDB-oriented history/collection, alarms-driven sampling, toolbar alert state, and cloud requests within extension permissions and host limitations.
• extension/entrypoints/background.ts
• extension/entrypoints/dashboard/main.tsx
• extension/lib/apiTransport.ts
• extension/lib/collector.ts
• extension/lib/history.ts
External infrastructure and delivery
Starlink dish/router grpc-web endpoints are the primary external device interfaces; the optional Starlink authenticated cloud API is isolated in cloud handlers/transports. Development uses a proxy to work around device CORS/referer behavior. Electron is packaged with electron-builder; extension builds use WXT; the separate Astro site is a marketing deployment, not part of app runtime.
• cloud/starlinkCloudHandler.ts
• src/lib/starlinkCloud.ts
• dev/routerProxy.ts
• electron-builder.yml
• landing/src/pages/index.astro
Main entry points: useDishTelemetry.ts Domain hooks · historian.mts Historian · dishClient.ts Device protocol client · telemetry.ts Telemetry derivation
Components 25
Shared domain
Platform-neutral device, telemetry, and alert logic.
- Device protocol client · Calls dish and router grpc-web APIs and applies safe updates.
core/dishClient.ts - gRPC-web transport
core/grpcWeb.ts - Reflected protobuf schema
schema/dish.protoset - Telemetry derivation · Unrolls ring-buffer samples into durable display windows.
core/telemetry.ts - Throughput tracker
core/throughputTracker.ts - Alert engine · Evaluates definitions independently of rendering.
core/alertEngine.ts
React UI
Shared dashboard frontend and development host.
- App shell
src/App.tsx - Domain hooks · Compose LAN, cloud, and history state for views.
src/hooks/useDishTelemetry.ts - Dashboard view
src/components/dashboard/DashboardView.tsx - Settings UI
src/components/settings/SettingsModal.tsx
Electron desktop
Privileged desktop host and persistent collection.
- Historian · Continuously polls and preserves sampling gaps.
collector/historian.mts - Local history stores · JSON-lines records and domain-specific client history.
collector/jsonLinesFile.mts - Electron main process · Owns lifecycle, tray surfaces, preferences, and notifications.
electron/main.ts - IPC and preload bridge · Renderer reaches privileged services without direct Node APIs.
electron/ipc.ts - Desktop updater
electron/updater.ts
Browser extension
WXT runtime with browser-specific collection.
- Extension background · Runs alarms, toolbar alert state, and privileged extension flows.
extension/entrypoints/background.ts - Extension dashboard
extension/entrypoints/dashboard/main.tsx - Extension collector and history · Collects under extension constraints using IndexedDB-oriented history.
extension/lib/collector.ts
External services
Device LAN and optional cloud boundaries.
- Starlink LAN APIs · Dish and router grpc-web endpoints.
- Starlink cloud API · Optional authenticated account data and supported controls.
- Cloud handler
cloud/starlinkCloudHandler.ts
Delivery
Development proxy and independent build targets.
- Development proxy · Works around device CORS and referer behavior.
dev/routerProxy.ts - Electron package
electron-builder.yml - WXT extension build
- Astro marketing site · Not part of the application runtime.
landing/src/pages/index.astro
Connections 29
- App shell → Domain hooks: uses
- App shell → Dashboard view: renders
- App shell → Settings UI: renders
- Domain hooks → Device protocol client: reads and controls
- Domain hooks → Telemetry derivation: consumes
- Domain hooks → Alert engine: consumes
- Device protocol client → gRPC-web transport: uses
- Device protocol client → Reflected protobuf schema: decodes with
- gRPC-web transport → Starlink LAN APIs: grpc-web
- Telemetry derivation → Throughput tracker: derives
- Telemetry derivation → Alert engine: supplies metrics
- Historian → Device protocol client: polls through
- Historian → Telemetry derivation: derives
- Historian → Local history stores: appends
- Historian → Alert engine: evaluates
- Electron main process → Historian: runs when window closed
- Electron main process → IPC and preload bridge: hosts
- IPC and preload bridge → App shell: privileged bridge
- Electron main process → Desktop updater: manages
- Extension dashboard → Extension background: messaging
- Extension background → Extension collector and history: schedules
- Extension collector and history → Device protocol client: uses shared protocol
- Extension collector and history → Telemetry derivation: derives
- Extension collector and history → Alert engine: evaluates
- Domain hooks → Cloud handler: optional cloud state
- Cloud handler → Starlink cloud API: authenticated requests
- Development proxy → Starlink LAN APIs: development forwarding
- Electron package → Electron main process: packages
- WXT extension build → Extension background: builds