1. Cloudflare bucket
WRANGLER="npm exec --yes --ignore-scripts --package wrangler@4.107.0 -- wrangler"
$WRANGLER login
$WRANGLER r2 bucket create alltraxx-diagnostics
AllTraxx
Private beta diagnostics
The field inbox for Darren's module data: phone bundles upload to R2, Discord pings the team, and every zip stays downloadable for firmware, BLE, GPS, battery, and OTA analysis.
What this is
The app stays local-first. This cloud path exists for the private beta cohort so free test devices can send engineering evidence while the riders are away from us. The upload receiver is small, private, and replaceable.
Data flow
The Heltec sends PXTRX/PXTRX2 diagnostics over BLE: GNSS, battery, CPU, heap, counters, boot reason, and command ACKs.
SQLite stores app boots, BLE sessions, module samples, GPS source switches, OTA attempts, and recording quality events.
On Wi-Fi, at most every six hours, Settings auto-send creates a standalone diagnostics bundle for the last seven days.
Cloudflare R2 receives the zip and a JSON sidecar before the Discord alert is queued, so notification failure never loses data.
Setup
These commands create the private bucket, store the Discord webhook as a Worker secret, and deploy the upload endpoint the app points at.
Paste the webhook only into Wrangler's secret prompt. It should never appear in repo files, shell history, or public env vars.
WRANGLER="npm exec --yes --ignore-scripts --package wrangler@4.107.0 -- wrangler"
$WRANGLER login
$WRANGLER r2 bucket create alltraxx-diagnostics
WRANGLER="npm exec --yes --ignore-scripts --package wrangler@4.107.0 -- wrangler"
cd scripts/diagnostics-worker
$WRANGLER secret put DISCORD_WEBHOOK_URL
WRANGLER="npm exec --yes --ignore-scripts --package wrangler@4.107.0 -- wrangler"
cd scripts/diagnostics-worker
$WRANGLER deploy
EXPO_PUBLIC_ALLTRAXX_DIAGNOSTICS_UPLOAD_URL=https://alltraxx-diagnostics.codingfoxcorp.workers.dev/upload
After Discord pings
The Discord embed includes the object key and a ready-to-run command. Store downloads outside the repo when doing ad hoc triage.
mkdir -p downloads
npm exec --yes --ignore-scripts --package wrangler@4.107.0 -- wrangler r2 object get alltraxx-diagnostics/<key-from-discord> --file downloads/<bundle-name>.zip --remote
unzip -l downloads/<bundle-name>.zip
unzip -p downloads/<bundle-name>.zip manifest.json | jq .
unzip -p downloads/<bundle-name>.zip telemetry/events.json | jq '.[-20:]'
First-pass triage
module-samples.json
kind: "BOOT", reset, wake, boot count
module-samples.json
GNSS sats, HDOP, fix, hAcc/vAcc merge
ble-sessions.json
status, RSSI samples, parse errors
events.json
gps/source_switch
ota-attempts.json
status, blocked reason, bytes sent
manifest.json
telemetry queue depth and drop counters
Beta defaults
Auto-send is on by default for the private beta, Wi-Fi only by default, and manual share appears when auto-send is turned off. Route sharing is also opt-in controlled in Settings.
Preorder inbox
The public preorder form posts to /api/preorder.
It writes to the AllTraxx Supabase project, then sends a Discord
alert so new interest does not disappear into a quiet table.
Never expose the service-role key in static HTML or client-side JavaScript. The browser calls our Vercel function; the function calls Supabase.
Project: AllTraxx
Ref: gqtlwaktiexgnblnybss
Migration: admin-site/supabase/migrations/20260702204000_preorder_intents.sql
Installed in coding-fox-corp/alltraxx-admin production:
ALLTRAXX_SUPABASE_URL
ALLTRAXX_SUPABASE_SERVICE_ROLE_KEY
ALLTRAXX_PREORDER_DISCORD_WEBHOOK_URL
/usr/bin/curl -sS https://alltraxx.codingfox.ai/api/preorder \
-H 'content-type: application/json' \
--data '{"name":"Smoke Test","email":"smoke@example.com","quantity":"1"}' | jq .
Admin site
This site is static and deploys from admin-site/.
Vercel owns hosting; GoDaddy only needs the subdomain DNS record.
cd admin-site
npx vercel --prod
The detailed runbooks live in docs/:
telemetry flight recorder, field checklist, R2 pipeline, and
diagnostics ingestion.