How manjunath5513/devyatra works
1. Repository Shape and Entry Points
DevYatra is a multi-application pilgrimage crowd-management system: a primary Next.js pilgrim/operator UI, a Flask API, standalone ML forecasting, and separate crowd-analysis panels/services. Main runnable entries are backend/app_new.py (documented backend), sih2025-qbit/app/page.tsx (primary web UI), aiml crowd prediction/dashboard/app.py (ML dashboard), and CrowdAnalyser/YOLOv8/app.py (YOLO service).
2. Primary Web Experience
The principal frontend is a Next.js App Router application covering dashboards, queueing, crowd analysis, safety, travel, ticketing, traffic, voice, and accessibility. Shared layout and API boundaries are centralized rather than each page owning integrations.
• sih2025-qbit/app/layout.tsx
• sih2025-qbit/app/dashboard/page.tsx
• sih2025-qbit/services/apiService.ts
Client-side feature modules include virtual queues, traffic/parking/shuttle displays, maps, accessibility tooling, and translation. Its internal API routes handle login/session/logout and batch translation.
• sih2025-qbit/components/smart-queue/VirtualQueueManager.tsx
• sih2025-qbit/components/traffic-mobility/TrafficControlPanel.tsx
• sih2025-qbit/app/api/auth/login/route.ts
3. Flask Integration and Domain API
The Python backend is the integration boundary for user data, safety reporting, travel services, carbon features, tickets/groups, chatbot/voice, maps/routes, weather, and emergency functions. app.py, app_new.py, and a backup indicate competing or evolving application compositions; treat app_new.py as the documented launch target and verify which app is canonical before changes.
• backend/app_new.py
• backend/models.py
• backend/routes/travel_routes.py
Persistence is described as SQLAlchemy with SQLite. Runtime configuration and external-key handling are separated in:
• backend/config.py
• backend/.env.example
4. Crowd Forecasting Pipeline
The ML subsystem is a standalone Python package, not visibly embedded in the Flask app. It moves camera/stream or synthetic inputs through ingestion/capture, detection, feature construction and fusion, forecasting models, then alerting/recording. CLI scripts expose batch, real-time, training, detection, and alert execution modes.
• aiml crowd prediction/src/crowd_forecast/pipeline.py
• aiml crowd prediction/src/crowd_forecast/detection.py
• aiml crowd prediction/src/crowd_forecast/alerting.py
Forecasting is split into baseline and advanced model implementations, with a Streamlit-oriented monitoring/dashboard entry point.
• aiml crowd prediction/src/crowd_forecast/models/baseline.py
• aiml crowd prediction/src/crowd_forecast/models/advanced.py
• aiml crowd prediction/dashboard/app.py
5. Video and Crowd-Analysis Boundary
A separate YOLOv8 service performs real-time people counting, likely consuming webcam/CCTV input independently of the forecasting package. Separate Next.js admin and public panels suggest distinct authority and user-facing deployments rather than routes within the primary UI.
• CrowdAnalyser/YOLOv8/yolo_people_counter.py
• CrowdAnalyser/YOLOv8/app.py
• CrowdAnalyser/AdminPanel/src/app/page.tsx
6. End-to-End Control Flow
Operationally: cameras/sensors or streams feed YOLO detection and/or the forecast pipeline; counts and contextual features produce predictions and alerts; backend APIs expose operational functions and external-service responses; Next.js pages/services render and act on this data for pilgrims and operators. The repo tree does not establish a concrete transport contract between ML services and Flask, so this is a critical integration boundary to formalize.
7. Runtimes and External Dependencies
Material runtimes are Python 3.11+ for Flask, ML, YOLO, and Streamlit; Node.js 18+ for Next.js/TypeScript applications. Stated external integrations include Groq (chat/language), Geoapify (maps/geocoding), weather APIs, Twilio (SMS/WhatsApp alerts), Sarvam (translation), Socket.IO live events, Leaflet mapping, camera/CCTV sources, and SQLAlchemy/SQLite persistence.
Main entry points: app_new.py Documented backend · pipeline.py Forecast pipeline · app.py YOLO people counter · page.tsx Pilgrim & operator UI
Components 21
Next.js experiences
- Pilgrim & operator UI
sih2025-qbit/app/page.tsx - Shared application shell
sih2025-qbit/app/layout.tsx - Operations dashboard
sih2025-qbit/app/dashboard/page.tsx - Frontend API boundary
sih2025-qbit/services/apiService.ts - Queue & mobility tools
sih2025-qbit/components/smart-queue/VirtualQueueManager.tsx - Traffic control panel
sih2025-qbit/components/traffic-mobility/TrafficControlPanel.tsx - Session API routes
sih2025-qbit/app/api/auth/login/route.ts
Flask domain API
- Documented backend · Canonical launch target should be verified against alternate app compositions.
backend/app_new.py - Travel and domain routes
backend/routes/travel_routes.py - Domain models
backend/models.py - Operational data
Crowd forecasting
- Forecast pipeline · Runs ingestion, features, fusion, prediction, recording, and alerts.
aiml crowd prediction/src/crowd_forecast/pipeline.py - Detection & feature input
aiml crowd prediction/src/crowd_forecast/detection.py - Forecast models
aiml crowd prediction/src/crowd_forecast/models/advanced.py - Forecast alerts
aiml crowd prediction/src/crowd_forecast/alerting.py - Forecast monitoring
aiml crowd prediction/dashboard/app.py
Video analysis
- YOLO people counter · Independently counts people from webcam or CCTV feeds.
CrowdAnalyser/YOLOv8/app.py - People-counting engine
CrowdAnalyser/YOLOv8/yolo_people_counter.py - Crowd admin panel · Separate administrative crowd-analysis deployment.
CrowdAnalyser/AdminPanel/src/app/page.tsx
Other components
- Maps, weather, messaging & AI · Includes Geoapify, weather, Twilio, Groq, and Sarvam.
- Cameras & sensors
Connections 21
- Pilgrim & operator UI → Shared application shell: renders within
- Shared application shell → Operations dashboard: hosts
- Operations dashboard → Queue & mobility tools: uses
- Operations dashboard → Traffic control panel: uses
- Pilgrim & operator UI → Frontend API boundary: uses
- Pilgrim & operator UI → Session API routes: authenticates through
- Frontend API boundary → Documented backend: domain API calls
- Documented backend → Travel and domain routes: registers
- Documented backend → Domain models: uses
- Domain models → Operational data: persists to
- Documented backend → Maps, weather, messaging & AI: integrates with
- Cameras & sensors → Detection & feature input: feeds
- Detection & feature input → Forecast pipeline: counts and features
- Forecast pipeline → Forecast models: predicts with
- Forecast pipeline → Forecast alerts: triggers
- Forecast pipeline → Forecast monitoring: monitors
- Cameras & sensors → YOLO people counter: feeds
- YOLO people counter → People-counting engine: runs
- YOLO people counter → Crowd admin panel: serves counts to
- Forecast pipeline → Documented backend: operational integration to formalize · No concrete repository transport contract is established.
- YOLO people counter → Documented backend: operational integration to formalize · No concrete repository transport contract is established.