How durgaprasad9032/pilgrim-pulse-vision works
This repository implements a crowd-management digital twin: a dashboard displays simulated crowd movement, operational analytics and alerts, while a FastAPI backend provides persisted simulation and AI crowd predictions. The frontend simulation engine owns its internal crowd-model stages; the dashboard route assembles views, and prediction hooks support live WebSocket updates with REST fallback. Backend excerpts show a separate persisted simulator and prediction service. The README describes only the Lovable project scaffold, so product capabilities are inferred from the source tree and excerpts; unsampled backend integrations are shown only where the source index supports them.
Main entry points: engine.ts Simulation engine · index.tsx Dashboard route · prediction_service.py Prediction service · realtime_engine.py Persisted simulator
Components 29
Operations dashboard
- Dashboard route
src/routes/index.tsx - Command center
src/components/dashboard/CommandCenter.tsx - Twin map
src/components/dashboard/TwinMap.tsx - Prediction panel
src/components/dashboard/PredictionPanel.tsx - Prediction hook
src/hooks/usePredictions.ts - Socket hook
src/hooks/usePredictionSocket.ts - Prediction API client
src/services/predictionApi.ts - Socket client
src/services/predictionSocket.ts
Browser simulation
- Simulation hook
src/simulation/hooks.ts - Simulation engine
src/simulation/engine.ts - Crowd agents
src/simulation/agents.ts - Queue model
src/simulation/queue.ts - Route planning
src/simulation/routes.ts - Locations
src/simulation/locations.ts - Simulation analytics
src/simulation/analytics.ts - Scenario events
src/simulation/events.ts - Simulation intelligence
src/simulation/intelligence.ts
Backend services
- FastAPI service
backend/app/main.py - Prediction service
backend/app/services/prediction_service.py - ML model loader
backend/app/ml/model_loader.py - Feature engineering
backend/app/ml/feature_engineering.py - Route service
backend/app/services/route_service.py
Backend simulation
- Persisted simulator
backend/app/simulation/realtime_engine.py - Crowd simulator
backend/app/simulation/crowd_simulator.py
Persistence and models
- SQL database
backend/app/database/session.py - Prediction CRUD
backend/app/crud/prediction_crud.py - Simulation CRUD
backend/app/crud/simulation_crud.py - Domain models
backend/app/models/prediction.py
Other components
- Operator
Connections 32
- Operator → Dashboard route: uses
src/routes/index.tsx - Dashboard route → Command center: renders
src/routes/index.tsx - Dashboard route → Twin map: renders
src/routes/index.tsx - Dashboard route → Prediction panel: renders
src/routes/index.tsx - Dashboard route → Simulation hook: reads state
src/routes/index.tsx - Command center → Simulation hook: reads state
src/components/dashboard/CommandCenter.tsx - Twin map → Simulation hook: reads state
src/components/dashboard/TwinMap.tsx - Prediction panel → Prediction hook: uses
src/components/dashboard/PredictionPanel.tsx - Prediction hook → Socket hook: delegates
src/hooks/usePredictions.ts - Socket hook → Prediction API client: fetches fallback
src/hooks/usePredictionSocket.ts - Socket hook → Socket client: subscribes
src/hooks/usePredictionSocket.ts - Simulation hook → Simulation engine: reads snapshot
- Simulation engine → Crowd agents: creates agents
src/simulation/engine.ts - Simulation engine → Queue model: updates queues
src/simulation/engine.ts - Simulation engine → Route planning: reroutes agents
src/simulation/engine.ts - Simulation engine → Simulation analytics: builds snapshots
src/simulation/engine.ts - Simulation engine → Scenario events: resets events
src/simulation/engine.ts - Simulation engine → Simulation intelligence: resets state
src/simulation/engine.ts - Route planning → Locations: checks paths
src/simulation/routes.ts - FastAPI service → Prediction service: routes requests
- Prediction service → ML model loader: loads model
backend/app/services/prediction_service.py - Prediction service → Prediction CRUD: stores predictions
backend/app/services/prediction_service.py - Prediction service → Feature engineering: uses features
- FastAPI service → Persisted simulator: starts scheduler
backend/app/main.py - Persisted simulator → Crowd simulator: advances simulation
backend/app/simulation/realtime_engine.py - Persisted simulator → Prediction CRUD: persists forecasts
backend/app/simulation/realtime_engine.py - Persisted simulator → Simulation CRUD: persists state
backend/app/simulation/realtime_engine.py - Persisted simulator → SQL database: opens session
backend/app/simulation/realtime_engine.py - Prediction service → SQL database: opens session
backend/app/services/prediction_service.py - Prediction CRUD → Domain models: uses model
backend/app/crud/prediction_crud.py - Prediction API client → FastAPI service: requests forecasts
src/services/predictionApi.ts - Route service → SQL database: opens session
backend/app/services/route_service.py