Local prototype for the DAAS agriculture architecture described in context/architecture.md and context/sim.md.
The app demonstrates:
- Cloud Backend: Express layered backend with mission and dashboard APIs.
- MQTT Communication: embedded Aedes broker with TCP/WebSocket endpoints, documented topics, QoS settings, and persistent client identity.
- Mobile Base Station: React MVVM-style ViewModel with IndexedDB offline cache and batch replay.
- Drone Swarm: simulated P2P/Event-Bus swarm modules with heartbeat, failure detection, leader election, obstacle-aware path planning, fixed-priority safety scheduling, and task redistribution.
The collision-avoidance path uses a simplified parallel-computing model: normal mission planning runs on a mission-thread lane, background telemetry/image work is treated as background-thread work, and collision replanning runs on a maximum-priority safety-thread lane. This is a deterministic simulation of the architecture tactic, not a real operating-system thread scheduler.
- Node.js 20 or newer.
- npm, using the lockfile committed with this workspace.
npm install
npm run devOpen:
http://localhost:5173
Backend:
http://localhost:4000/api/health
http://localhost:4000/api/missions
http://localhost:4000/api/telemetry?limit=25
http://localhost:4000/api/alerts?limit=25
http://localhost:4000/api/sync-batches?limit=25
ws://localhost:4000/mqtt
mqtt://localhost:1883
Default ports can be changed with environment variables.
PowerShell:
$env:DAAS_HTTP_PORT=4000
$env:DAAS_MQTT_TCP_PORT=1883
$env:DAAS_MQTT_WS_PATH="/mqtt"Bash:
DAAS_HTTP_PORT=4000
DAAS_MQTT_TCP_PORT=1883
DAAS_MQTT_WS_PATH=/mqttnpm run typecheck
npm test
npm run build- Click
Normal Missionor theStartbutton to show Cloud mission creation, MQTT command delivery, Base Station MVVM reception, swarm sectoring, and telemetry persistence. - Click
Obstacle Scenario, or clickPlaceand then a field cell, to showOBSTACLE_DETECTED,COLLISION_ALERT,SCHEDULER_PREEMPTED,TRAJECTORY_CHANGE, andMOTOR_ADJUSTED. The architecture panel should show collision replanning on thesafety-threadlane before normal image/spray events continue. - Click
Drone Failure, or one of theD1-D4failure buttons, to show heartbeat timeout,DRONE_FAILURE, highest-battery leader election, critical alert persistence, and sector redistribution. - Click
Energy Offloadingto lower one drone battery and show non-safety computation offloaded to the Base Station while safety-critical path replanning stays onboard. - Click
Network Outageto disconnect the Base Station MQTT client, keep the mission running locally, queue telemetry in IndexedDB, then replay events in batches after reconnect. - Click
Full Stress Demoto combine obstacle detection, outage, drone failure, sync replay, and mission completion.
The Reset button clears browser queue state and calls POST /api/demo/reset so the Cloud Backend dashboard is clean for the next run.
daas/swarm/telemetry
daas/swarm/images
daas/mission/commands
daas/alerts/critical
daas/swarm/events
daas/base/sync-status
apps/client React + Phaser Mobile Base Station and simulator
apps/server Express Cloud Backend + Aedes MQTT broker + SQLite persistence
packages/shared Shared event, mission, drone, and topic contracts
The backend stores data in apps/server/data/daas.sqlite. Delete that directory before a presentation if you want a clean dashboard history.
MQTT durability note: the prototype uses a stable Base Station client id and clean: false, while IndexedDB remains the authoritative offline queue for field outages. The embedded Aedes broker is intentionally local and process-lifetime only; production broker persistence is out of scope for this demo.