mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-07-02 01:21:35 +00: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 shellworker/index.ts- Cloudflare Worker entrypointworker/stats.ts- D1 queries, payload validation, and aggregation helperspublic/.assetsignore- keeps Astro's private_worker.jsbundle out of public asset uploadsschema.sql- D1 schema
Setup
- Install dependencies with
bun install. - Create a D1 database with
bunx wrangler d1 create meshcore_sar_rx_stats. - Apply the schema with
bunx wrangler d1 execute meshcore_sar_rx_stats --remote --file=./schema.sql. - Add the real D1 binding id to
wrangler.tomlwhen deploying. - Build the dashboard with
bun run build. - Run checks with
bun run check,bun run test, andbun run typecheck.
Routes
GET /- static Astro dashboardGET /api/dashboard?window=24h|7d|30d- aggregated dashboard JSONPOST /api/ingest- anonymous RX stats ingest