Cloudflare Worker: public site, membership, billing, and D1 database.
- Dev:
npm ci,cp .dev.vars.example .dev.varsand fill it in (AUTH_SECRET:openssl rand -base64 32;EDGE_JWT_PRIVATE_KEY:openssl genpkey -algorithm ed25519 -outform DER | base64), thennpm run db:local && npm run dev - Test:
npm ci && npm run typecheck && npm test && npm run test:browser - Deploy:
npm run deploy(type-checks and applies D1 migrations; needs secrets fromwrangler.jsonc) - Types: TypeScript, checked by
npm run typecheck. After changingwrangler.jsoncbindings or upgrading Wrangler, runnpm run typesand commitworker-configuration.d.ts. Browser scripts instatic/stay plain JavaScript checked through JSDoc. Keepsrc/lib.tsrow types in step with migrations;test/schema.test.tscompares them. - HTML: server-only JSX via
site/src/html.ts; use HTML attribute names (class,for). Values are escaped automatically, and unknown tags or attributes fail the type check.
Go service on the LAN router: syncs fobs to door controllers, uploads swipes, serves the kiosk, and monitors printers.
- Test:
go vet ./... && go test -race ./... - Deploy: pushing to
mainpublishesghcr.io/thelab-ms/conwayedge; run it with/datamounted andCONWAYEDGE_WORKER_ISSUER/CONWAYEDGE_PUBLIC_URLset.
ESP32 door controller firmware.
- Test:
source network.env && cargo build --release(seenetwork.env.example) - Deploy:
cargo run --releaseover USB, or./build-ota.shandcurl --data-binary @firmware.bin http://<device-ip>/ota