Event material recovery operations platform. A Next.js operations dashboard plus a Flutter field-worker app that turn post-event waste into traceable, recoverable material batches.
src/ Next.js 14 web app (ops dashboard + mobile web views)
app/ Routes (dashboard, batches, crews, dispatch, impact, zones, ...)
components/ UI, layout, dashboard, batches, assistant components
lib/ Mock data, types, formatters, agents, assistant logic
store/ Zustand store (useMaterialOpsStore)
mobile_flutter/ Flutter field-worker app (scan, tasks, recovery plans)
lib/ models, state (provider/AppState), screens, widgets, cv
ml/ CV model training script (build_material_model.py)
Stack: Next.js 14 (App Router), TypeScript, Tailwind CSS, Zustand, Recharts.
npm install
npm run dev # http://localhost:3000
npm run build # production build (type-checked)- Ops dashboard — data-driven recovery board with zone filtering and priority/weight/value sorting; live top-strip metrics derived from batch and task data (recovered tonnage, reuse rate, active pickups, batch count).
- Batch detail & material passport — per-batch passport, grouped item breakdown, chain of custody, and priority reasoning, all driven by the batch record.
- AI agents (
src/lib/agents.ts) — five deterministic agents (Material, Reuse, Repair, Logistics, Donation) that emit a sharedAgentDecisionschema (summary, suggested path, confidence, signals, recommendations). Surfaced on the batch detail page viaAgentDecisions. - Assistant (
src/lib/assistant.ts+AssistantPanel) — a rule-based chat assistant available on every page that answers questions about batches, zones, recovery paths, crews, and overall impact using the in-app data. No external LLM required; works offline.
The field-worker app lets crews scan material, confirm/correct AI detections, group items into batches (creating material passports), and follow generated recovery plans.
MaterialPassport,MaterialBatchSummary,RecoveryPlanmodels with JSON serialization.AppState(provider) persists passports to disk (passports.jsonviapath_provider) and derives batch summaries and recovery plans.- Scan screen: confirm/correct detections, assign to an existing or new batch, add a worker note, and view grouped batches.
- Task detail: per-batch recovery plan card with step progress.
Requires the Flutter SDK (not bundled). Install from https://docs.flutter.dev/get-started/install, then:
cd mobile_flutter
flutter create . # generate platform folders (first run only)
flutter pub get
flutter analyze
flutter runThe app runs in mock detection mode until a TFLite model is present at
mobile_flutter/assets/models/material_classifier.tflite. See ml/ for the
training script.
ml/build_material_model.py trains a MobileNetV2-based classifier (6 classes,
224×224) and exports a .tflite model into the Flutter assets folder. Requires
TensorFlow (pip install tensorflow).
- The web app uses mock data in
src/lib/mockData.ts; there is no backend. - Agents and the assistant are deterministic prototypes designed to be replaced by live services later.