Minimal but production-style reference project centered on realtime telemetry delivery, websocket architecture, Redis Pub/Sub fanout, and efficient frontend rendering.
frontend: React, TypeScript, Vite, Tailwind, Zustand, React Leafletbackend: Node.js, TypeScript, Express, Socket.IO, Redis Pub/Subdocs: architecture, websocket flow, and scaling notes
Start Redis:
docker compose up redisInstall dependencies:
cd backend && npm install
cd frontend && npm installRun backend:
cd backend
npm run devRun frontend:
cd frontend
npm run devThe backend simulator can be controlled through simple API endpoints:
curl http://localhost:4000/api/simulator
curl -X POST http://localhost:4000/api/simulator/start
curl -X POST http://localhost:4000/api/simulator/stop
curl -X POST http://localhost:4000/api/simulator/tickUseful for testing:
- set
SIMULATOR_AUTOSTART=falseif you want manual control - call
/api/simulator/tickto publish one telemetry cycle through Redis and websocket fanout - call
/api/simulator/startto resume scheduled movement everyTELEMETRY_TICK_MS
- simulator emits telemetry changes every 2 seconds
- backend publishes field-level patches through Redis
- websocket layer batches short bursts and fans out only to subscribed drone rooms
- frontend hydrates from one snapshot, then merges incremental updates into Zustand
- dashboard renders only selected drones and animates marker movement between updates