Files
meshcore-sar_android/worker
Janez Troha 7924803351 chore: Initial commit
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XPovRHpejR4zRxuhjY4Qs3
2026-09-04 16:53:52 +02:00
..
2026-09-04 16:53:52 +02:00
2026-09-04 16:53:52 +02:00
2026-09-04 16:53:52 +02:00
2026-09-04 16:53:52 +02:00
2026-09-04 16:53:52 +02:00
2026-09-04 16:53:52 +02:00
2026-09-04 16:53:52 +02:00
2026-09-04 16:53:52 +02:00
2026-09-04 16:53:52 +02:00
2026-09-04 16:53:52 +02:00
2026-09-04 16:53:52 +02:00

MeshCore SAR Stats Worker

This worker follows the same split as /Users/dz0ny/site-vendorvigilance:

  • Astro builds the dashboard UI into dist
  • a small Cloudflare Worker handles /api/* before assets are served

Layout

  • src/pages/index.astro - dashboard shell
  • worker/index.ts - Cloudflare Worker entrypoint
  • worker/stats.ts - D1 queries, payload validation, and aggregation helpers
  • public/.assetsignore - keeps Astro's private _worker.js bundle out of public asset uploads
  • schema.sql - D1 schema

Setup

  1. Install dependencies with bun install.
  2. Create a D1 database with bunx wrangler d1 create meshcore_sar_rx_stats.
  3. Apply the schema with bunx wrangler d1 execute meshcore_sar_rx_stats --remote --file=./schema.sql.
  4. Add the real D1 binding id to wrangler.toml when deploying.
  5. Build the dashboard with bun run build.
  6. Run checks with bun run check, bun run test, and bun run typecheck.

Routes

  • GET / - static Astro dashboard
  • GET /api/dashboard?window=24h|7d|30d - aggregated dashboard JSON
  • POST /api/ingest - anonymous RX stats ingest