Offline-first disaster logistics prototype for the HackFusion 2026 Digital Delta challenge.
Per the HackFusion rules, this project uses open-source frameworks, libraries, and AI-assisted pair-programming support during development.
- Expo / React Native / Expo Router
- React + Vite + Leaflet / React Leaflet
- Go standard library plus gRPC / Protobuf tooling
react-native-wifi-p2preact-native-ble-plx@noble/curves,@noble/hashes@stablelib/aes,@stablelib/gcm- Buf /
protoccode generation tooling
- AI pair-programming assistance was used during development and refactoring, including OpenAI Codex / ChatGPT-style assistance.
- All generated code and architectural decisions were reviewed and adapted inside this repository.
- Expo app shell is in place for command, deliveries, and network views.
- Go scenario loader and routing preview are working.
- Protobuf contracts exist for sync, routing, and delivery flows.
- Chaos simulator is integrated under
services/chaos/. - The restored problem statement makes
M1andM2stricter than our earlier shorthand summary, especially real device-to-device sync forM2.4.
C2Linux CI vegeta run24307971168:100000requests at10000.05 req/s,9999.84 req/sthroughput,100%success, mean latency190.01 µsC3memory snapshot: Java heap46.36 MB, native remaining size7,062,487 bytes(~6.74 MB) during Android profiling- Workflow:
.github/workflows/c2-vegeta-loadtest.yml - APK workflows:
.github/workflows/android-apk-build.yml.github/workflows/generate-react-native-cicd.yml- Android workflow also publishes the built APK to GitHub Releases
Android profiling capture:
- Bootstrap Expo, Go, and protobuf project structure
- Add first-pass architecture notes and diagrams
- Add shared Sylhet scenario data
- Add Go scenario loader and constrained routing preview
- Integrate Python chaos simulator into repo structure
- Bridge chaos API output into the Go routing preview
- Expose routing through a lightweight Go HTTP API
- Replace the command and network views with live backend fetches
- Generate Go and TypeScript code from
.protofiles - Generate Go gRPC service stubs and add a first gRPC server
- Add a real gRPC
ComputeRoutesmoke path and client - Implement offline TOTP/HOTP auth flow with expiry/regeneration demo
- Implement per-device key provisioning
- Add tamper-evident auth logs with corruption detection demo
- Enforce the exact RBAC roles from the restored statement
- Add inventory CRDT and vector-clock merge foundation in Go
- Implement CRDT inventory entries with vector clocks and conflict UI
- Scaffold Expo dev-client and native BLE discovery for transport readiness
- Add a Leaflet route dashboard for M4.4 with offline OSM tile caching
- Upgrade the Go route engine with weighted multi-modal edges and recomputation endpoints
- Add multimodal handoff mission planning and the first in-app route graph
- Add offline proof-of-delivery QR signing, countersigning, replay protection, and receipt-chain sync
- Add autonomous triage prediction and preemption across the route dashboard and app
- Add predictive route decay with trained ML artifacts, penalized rerouting, and risk overlays
- Add hybrid fleet orchestration with drone-required zones, rendezvous logic, live mobile handoff execution, and telemetry-driven mesh throttling
- Add
DEMO.mdand model-card source docs
The restored Module 1 and Module 2 page changes the plan in one important way:
- simulated sync is no longer enough for full credit on
M2.4 - auth is no longer generic offline login; it needs offline
TOTP/HOTP, per-device keys, exact RBAC roles, and tamper-evident auth logs
The repo architecture still stands, but the implementation priority changes:
- real on-device sync transport moves up
- auth and audit logging move up
- “simulated later” assumptions for
M2are no longer valid if we want full marks
apps/mobile Expo client
services/core Go routing and system logic
services/chaos Python chaos simulator
proto Shared protobuf contracts
data Scenario fixtures
docs Architecture and supporting docs
ml Training and model artifacts
cd apps/mobile
bun install
bun run start
bun run web
bunx tsc --noEmit
eas build -p android --profile development
eas build -p ios --profile developmentIf the app is running on a physical phone, set the backend host explicitly:
cd apps/mobile
$env:EXPO_PUBLIC_API_BASE_URL="http://YOUR_COMPUTER_LAN_IP:8080"
bun run startQuick check Wi-Fi IP:
(Get-NetIPAddress -InterfaceAlias Wi-Fi -AddressFamily IPv4).IPAddressFor native BLE testing in a dev build:
cd apps/mobile
$env:EXPO_PUBLIC_API_BASE_URL="http://YOUR_COMPUTER_LAN_IP:8080"
npx expo start --dev-clientcd apps/dashboard
bun install
bun run dev
bun run buildIf the dashboard is not on the same machine as the Go API, set the backend host explicitly:
cd apps/dashboard
$env:VITE_API_BASE_URL="http://YOUR_COMPUTER_LAN_IP:8080"
bun run devgo test ./services/core/...
go run ./services/core/cmd/scenario
go run ./services/core/cmd/scenario -chaos-url http://127.0.0.1:5000
go run ./services/core/cmd/api
go run ./services/core/cmd/api -chaos-url http://127.0.0.1:5000
go run ./services/core/cmd/grpcapi
go run ./services/core/cmd/grpcapi -chaos-url http://127.0.0.1:5000
go run ./services/core/cmd/grpcclient
go run ./services/core/cmd/grpcclient -vehicle speedboatTo run the HTTP and gRPC APIs with TLS 1.3:
go run ./scripts/devcert -hosts "localhost,127.0.0.1,192.168.68.110"
go run ./services/core/cmd/api -tls-cert devcerts/cert.pem -tls-key devcerts/key.pem
go run ./services/core/cmd/grpcapi -tls-cert devcerts/cert.pem -tls-key devcerts/key.pemcurl "http://127.0.0.1:8080/api/route/preview?from=N1&to=N3&vehicle=truck&payload_kg=100"
curl "http://127.0.0.1:8080/api/routes/active"
curl "http://127.0.0.1:8080/api/routes/active?failed_edge=E2&failure_status=washed_out"
curl "http://127.0.0.1:8080/api/routes/missions"
curl "http://127.0.0.1:8080/api/triage/status"
curl "http://127.0.0.1:8080/api/predictive/status"
curl "http://127.0.0.1:8080/api/fleet/orchestration/status"python ml/training/generate_route_decay_dataset.py
python ml/training/train_route_decay_model.pycurl http://127.0.0.1:8080/api/sync/inventory/state
curl -X POST "http://127.0.0.1:8080/api/sync/inventory/apply?scenario=causal"
curl -X POST "http://127.0.0.1:8080/api/sync/inventory/apply?scenario=conflict"
curl -X POST "http://127.0.0.1:8080/api/sync/inventory/resolve?choice=local"
curl -X POST "http://127.0.0.1:8080/api/sync/inventory/resolve?choice=remote"
curl -X POST http://127.0.0.1:8080/api/sync/inventory/resetJudge docs:
DEMO.mddocs/qa/M2-QA.mddocs/compliance/M2-transport-proof.mddocs/submission-checklist.mddocs/pitch-deck-outline.mddocs/architecture-diagram.md
python -m pip install -r services/chaos/requirements.txt
python services/chaos/chaos_server.pypowershell -ExecutionPolicy Bypass -File scripts/install-protoc.ps1
powershell -ExecutionPolicy Bypass -File scripts/generate-proto.ps1Direct mobile sync packets now use protobuf SyncService RPC frames over the Wi-Fi Direct native socket transport provided by react-native-wifi-p2p. JSON is retained only for local storage and the developer-facing dashboard APIs.
- Manually run
C2 Vegeta Load Test - Download the
c2-vegeta-loadtestartifact for the CI proof report
