Files
PilotVault/Web App
tajniak81andClaude Opus 4.8 33595c99e8 Add a Drones fleet section that fills itself in on connect
The fleet lived as a tab inside the Logbook, which buried it, and every
drone had to be typed in by hand — model, serial and firmware copied off
an airframe the app was already talking to.

Promote it to its own nav section above Logbook, and let a connecting
drone register itself. The Fly App already forwarded model, serial and
firmware upstream; the hub was keeping only the model. It now carries the
identity through to DeviceState, and the Web App offers it to a new
POST /api/drones/auto, which upserts keyed by serial. The auto path only
writes what the aircraft is authoritative about (model, both firmware
versions) and never touches what the pilot curates.

Serial and the firmware versions resolve on their own schedules after
connect — the serial in seconds, the aircraft firmware sometimes a minute
later — so nothing along the path treats an absent value as a cleared one,
and a later event filling firmware in still reaches the server. The auto
call rides every telemetry frame, so the client remembers the identity
tuple it last sent and only a change goes out; a 4xx is the server's
settled answer and is not retried, or one drone connected for an hour
would mean one request per frame for an hour.

New fields on drones: firmware, controller_firmware, and registration for
the FAA/CAA aircraft number — distinct from operator_number, which stays
the EU operator ID. Controller firmware is the remote controller's own
version, read from its component; the flight controller's version is a
different quantity and stays off this field (see 002e484). name becomes
optional and is now the pilot's custom name: auto-added drones arrive
unnamed, so the API serves a computed displayName (name, else model +
serial) for the fleet table, the flight picker and the CSV export. A
unique index on serial is what keeps the find-then-create path from
forking a drone's history across two records.

The schema is applied to the remote PocketBase; the migration is here for
fresh deployments, which the remote does not read.

Verified against a simulated device over the real socket with identity
resolving late: one record from four events, both firmware versions
filled, curated fields intact across re-registration, and a drone deleted
while connected coming back on the next frame.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 17:04:12 +02:00
..

Web App (Control Panel)

The PilotVault control-panel BFF. It serves the embedded Vue single-page app and proxies /bff/* to the API Server, so the browser only ever talks to this server (same-origin). The API Server is the gateway to PocketBase and to the live Fly App data; the browser never contacts either directly.

Layout

server/          # Go BFF (package main) — proxies /bff/* and serves the SPA
  dist/          # built web assets (go:embed target — produced by the web build)
  .env.example   # configuration template
  go.mod
  main.go        # entrypoint, routing, static serving
  bff.go         # /bff/* proxy handlers
web/             # Vue 3 + Tailwind source, built by Vite into ../server/dist

Configuration

See server/.env.example. Key variables:

  • ADDR — address the BFF listens on (default :8090).
  • API_BASE — default API Server the BFF proxies to (default http://localhost:8080). Users can override this per-session at login.

Develop

# 1. Build the web app into server/dist (embedded by the Go binary)
cd web && npm install && npm run build && cd ..

# 2. Run the BFF
cd server && go run .

For a live UI with hot-reload, run npm run dev in web/ (it proxies /bff to a locally running BFF on :8090).

Build

cd server && go build -o web-app .

Or build the container image (multi-stage; builds the web app then the binary):

docker build -t pilotvault-web-app .