How jeevithar3/nexflow works
NexFlow is a synthetic-traffic forecasting and digital-twin prototype. Users request a SUMO prediction, inspect current and forecast congestion, then evaluate or search for signal-timing interventions; candidate plans are simulated and memory-retrieved plans are re-verified before recommendation. The dashboard also exposes network routing estimates, experience search, benchmarks, and model evaluation. Relationships are based on the README and shown excerpts; several internal modules and page implementations were not sampled, so their detailed call paths are not asserted.
Main entry points: routes.py REST endpoints · decision.py Intervention search · memory.py Experience retrieval · inference.py GNN inference
Components 22
Dashboard
- Dashboard pages
frontend/src/pages - Page router
frontend/src/App.tsx - API client
frontend/src/api/client.ts
API and orchestration
- REST endpoints
backend/app/api/v1/routes.py - Decision services
backend/app/services - Background jobs
backend/app/services/jobs.py
Forecast and twin
- Road network model
backend/app/digital_twin/network.py - Digital twin state
backend/app/digital_twin/twin.py - Congestion metrics
backend/app/digital_twin/congestion.py - GNN inference
backend/app/ml/inference.py - Training and data
backend/app/ml
Simulation and decisions
- SUMO runner
backend/app/sumo/runner.py - Traffic collector
backend/app/sumo/collector.py - Intervention search
backend/app/services/decision.py - Plan scoring
backend/app/interventions/objective.py - Route estimates
backend/app/services/routing.py
Experience memory
- Experience retrieval
backend/app/experience_memory/memory.py - FAISS index
backend/app/experience_memory/faiss_store.py - Persistent records
backend/app/models/db.py
Other components
- Dashboard user
- SUMO / TraCI
- HTTP API
Connections 22
- Dashboard user → Dashboard pages: uses
- Page router → Dashboard pages: routes to
frontend/src/App.tsx - Dashboard pages → API client: requests
- API client → HTTP API: sends requests
frontend/src/api/client.ts - HTTP API → REST endpoints: serves
- REST endpoints → Digital twin state: reads snapshot
backend/app/api/v1/routes.py - REST endpoints → Intervention search: starts decision
backend/app/api/v1/routes.py - REST endpoints → Background jobs: submits run
- Intervention search → SUMO runner: tests plans
- Intervention search → Experience retrieval: searches
- Experience retrieval → SUMO runner: verifies plan
- Intervention search → Plan scoring: scores candidates
- SUMO runner → SUMO / TraCI: runs simulation
backend/app/sumo/runner.py - SUMO runner → Traffic collector: collects measurements
backend/app/sumo/runner.py - Traffic collector → Digital twin state: syncs observations
backend/app/digital_twin/twin.py - Digital twin state → GNN inference: provides observations
- GNN inference → Congestion metrics: computes index
backend/app/ml/inference.py - GNN inference → Road network model: uses topology
backend/app/ml/inference.py - Training and data → GNN inference: trains checkpoint
backend/app/ml/inference.py - REST endpoints → Route estimates: offers estimates
- Experience retrieval → FAISS index: retrieves vectors
- Experience retrieval → Persistent records: persists experiences