Developer-focused notes for running, testing, and deploying the SPA and worker.
Webcams UI surfaces a curated set of webcams around a user-defined reference point. The UI focuses on quick visual scanning (preview image, elevation, distance, bearing) to find the upper limit of the fog. It keeps configuration in a single YAML file so the data set can be edited without touching code.
- The SPA fetches
webcams.yml, parses/validates it with the sharedpackages/configschema, and renders webcam cards sorted by elevation. - The worker acts as a fetch/preview helper for sources that need server-side access or transformation.
- Shared logic (coordinate math, bearing, distance, compass) lives in
packages/domain.
apps/spa: Vue 3 + Vite single-page appapps/worker: Cloudflare Worker (Wrangler)packages/config: YAML config parser + schemapackages/domain: shared domain utilitieswebcams.yml: repo-root configuration consumed by the SPA
- Node.js 20 (matches CI)
- pnpm (version pinned in
package.json)
pnpm installpnpm devThis runs the worker locally via Wrangler from apps/worker.
pnpm -C apps/spa devThe SPA loads webcams.yml from the repo root through the Vite dev server.
webcams.yml is validated by the schema in packages/config. A minimal shape:
settings.user_coord_ch2056:{ e, n }settings.worker_base_url: URL stringsettings.refresh_minutes: numberwebcams[]:{ id, name, elevation_m_asl, coord_ch2056, source, ... }
id values can be numeric or string; they are coerced to strings during parsing.
Run all tests:
pnpm test:allRun specific packages:
pnpm -C apps/spa test
pnpm -C apps/worker testWatch mode (example):
pnpm -C apps/worker test:watchBuild the SPA (bundles dependencies into apps/spa/dist):
pnpm -C apps/spa buildci.yml runs on pushes to main and:
- Tests and builds the SPA, then deploys it to GitHub Pages
- Tests and deploys the worker using Wrangler
Required secrets for the worker job:
CLOUDFLARE_API_TOKENCLOUDFLARE_ACCOUNT_ID