Inspiration
- Disasters demand fast, practical coordination. We wanted a planner that works under poor connectivity, lets locals contribute ground truth, and stays simple enough to deploy anywhere.
- The goal: actionable plans in minutes, not hours — with privacy by default and an open, inspectable data model (plain JSON).
What it does
- Main app: Select an incident on a map, fill in scenario details, and add crowd updates. Generate a clear, concise response plan instantly.
- Crowd updates: Each item is labeled Open/Resolved; only open items influence plan generation. Badges stay in sync between pages/tabs.
- Authority Console: Curate the canonical incident set (add/edit incidents; add/resolve/delete updates). In production, edits persist via a tiny JSON API; offline, it can write to a local folder.
- Optional AI: A Cloudflare Worker calls Groq (GPT‑OSS 20B/120B) to produce plans; if unreachable, the client uses a deterministic template.
How we built it
- Frontend: Static HTML/CSS + lightweight vanilla JS (
index.html,app.js,styles.css). Leaflet + OSM tiles for maps; simple clustering; geolocation with IP fallback. - Authority:
authority.html+authority.jsfor dataset management. Real‑time parity to the main page viaBroadcastChannel. - Backend: Cloudflare Worker (
api/plan-worker.js).- KV namespaces:
DATA_KV(incidents),PLAN_KV(plan cache),RATE_KV(rate limit bucket). - Endpoints: plan generation, incident reads/writes, plan cache reads.
- Security: write endpoints require
Authorization: Bearer <AUTH_TOKEN>; recommend gatingauthority.htmlwith Cloudflare Access.
- KV namespaces:
- Offline:
sw.jsfor best‑effort offline; app remains usable without the Worker.
Challenges we ran into
- Persistence from the browser: balanced an offline file‑based flow (File System Access API) with a production Worker + KV API for permanent storage.
- Cross‑origin deployment without a custom domain: added
window.__PLAN_API__andwindow.__DATA_BASE__so the app targets the workers.dev origin cleanly, with CORS headers on the Worker. - Robust model JSON: added defensive extraction and a deterministic local fallback when upstream responses are malformed or slow.
- UX parity: ensuring Open/Resolved status is visible and synchronized in real‑time across pages/tabs.
Accomplishments that we're proud of
- Static‑first app that still feels “live”: real‑time label sync, instant plan generation, and graceful offline behavior.
- Clean data model (plain JSON per incident) with a tiny, auditable API layer and KV storage.
- Safety‑conscious plan generator prompt and guardrails, plus cached plans keyed by updates.
What we learned
- Keep secrets off the client; a minimal Worker and KV go a long way while preserving the “JSON files” mental model.
- Favor stateless, cacheable routes and small surface area. Simple toggles (
__PLAN_API__,__DATA_BASE__) make deployment flexible. - Clear UI signals (badges, aria‑busy, empty states) reduce confusion during time‑critical usage.
What's next for RescueMind
- Wire Authority writes to the Worker API by default in production (we already implemented the API; front‑end toggle is straightforward).
- Add Cloudflare Access enforcement example for
authority.html(JWT check in Worker instead of static bearer token). - Versioned audit trail (KV → R2 snapshots or GitHub PR bot), plus rollback.
- Multi‑user real‑time (WebSocket) and SMS/voice update ingestion for low‑connectivity regions.
- Localization and accessibility audits for broader reach.
Built With
- broadcastchannel
- cloudflare
- css
- fetch-api
- file-system-access-api
- geolocation-api
- gpt
- html
- javascript
- leaflet.js
- openstreetmap-tiles
- plan-kv-for-plan-cache
Log in or sign up for Devpost to join the conversation.