Skip to content

manjunath5513/DevYatra

Repository files navigation

DevYatra - Temple & Pilgrimage Crowd Management System

SIH 2025 | Problem Statement ID: 25165
Submitted to: Government of Gujarat | Gujarat Council on Science & Technology (GUJCOST)

DevYatra Logo SIH 2025 Gujarat

πŸ•‰οΈ Problem Statement

Temple & Pilgrimage Crowd Management (Somnath, Dwarka, Ambaji, Pavagadh)

Gujarat's sacred pilgrimage destinationsβ€”Somnath, Dwarka, Ambaji, and Pavagadhβ€”attract millions of devotees annually. During festivals and auspicious days, these sites face critical challenges:

  • ❌ Overcrowding & unsafe queue conditions
  • ❌ Traffic congestion & parking shortages
  • ❌ Emergency response delays
  • ❌ Poor communication & guidance systems
  • ❌ Inadequate accessibility for differently-abled pilgrims

🎯 Our Solution: DevYatra

DevYatra is a comprehensive AI-powered crowd management ecosystem that transforms the pilgrimage experience through technology while preserving spiritual sanctity.

✨ Core Features

πŸ€– AI/ML-Powered Crowd Intelligence

  • Real-time Crowd Density Monitoring using YOLO-based computer vision
  • Predictive Analytics for visitor surges based on festivals, weather, and historical data
  • Automated Crowd Alerts and emergency detection systems
  • Capacity Optimization with dynamic crowd flow management

πŸ“± Smart Queue & Digital Darshan System

  • Virtual Queue Management - Skip physical lines with digital tokens
  • Real-time Wait Time Updates across all temple entry points
  • Digital Darshan Passes with QR code integration
  • Slot-based Entry System to distribute crowds evenly

🚨 Emergency & Safety Solutions

  • AI-Powered Panic Detection using crowd behavior analysis
  • Instant Emergency Alerts to temple authorities and nearby hospitals
  • Medical Assistance Locator with GPS-based routing
  • Automated Incident Reporting with real-time response coordination

πŸš— Intelligent Traffic & Mobility Management

  • Smart Parking Guidance with real-time availability updates
  • Dynamic Route Optimization to reduce approach road congestion
  • Shuttle Service Coordination with live bus tracking
  • Integrated Traffic Control working with local police systems

πŸ—£οΈ Multilingual Pilgrim Engagement Platform

  • Voice-Enabled Assistant in Gujarati, Hindi, and English
  • Real-time Temple Information - timings, rituals, and announcements
  • Accessibility Features for elderly and differently-abled devotees
  • Cultural Heritage Integration with AR-guided temple tours

πŸ“Š IoT & Surveillance Integration

  • Smart Sensor Networks for environmental and crowd monitoring
  • CCTV Analytics with AI-powered incident detection
  • Drone Surveillance for aerial crowd assessment during festivals
  • Automated Alert Systems integrated with temple management

πŸ—οΈ Technical Architecture

Backend Services

  • Flask 3.0 - RESTful API with microservices architecture
  • SQLAlchemy & SQLite - Multi-database system for crowd data, user management, and analytics
  • AI/ML Stack - OpenCV, YOLO, scikit-learn for computer vision and predictive modeling
  • Real-time Communication - Socket.IO for live updates and emergency broadcasts
  • Groq AI Integration - Advanced language processing for multilingual chatbot

Frontend Applications

  • Next.js 15 - Modern React framework with App Router for optimal performance
  • TypeScript - Type-safe development for enterprise-grade reliability
  • Responsive UI - shadcn/ui components with accessibility-first design
  • Real-time Maps - Leaflet integration for live crowd visualization and navigation
  • PWA Ready - Offline capabilities for areas with poor network connectivity

AI/ML Components

  • YOLO-based People Detection - Real-time crowd counting and density analysis
  • Crowd Behavior Analytics - Pattern recognition for early warning systems
  • Predictive Modeling - Festival crowd forecasting using historical data
  • Computer Vision Pipeline - Multi-camera surveillance and incident detection

IoT & Integration Layer

  • Smart Sensors - Temperature, humidity, and occupancy monitoring
  • Camera Analytics - AI-powered CCTV with automated alert generation
  • Mobile Integration - Cross-platform compatibility with native features
  • Third-party APIs - Weather, traffic, and emergency services integration

πŸ“ Project Structure

DevYatra/
β”œβ”€β”€ backend/                     # Flask API Backend
β”‚   β”œβ”€β”€ app.py                  # Main Flask application
β”‚   β”œβ”€β”€ models.py               # Database models & schemas
β”‚   β”œβ”€β”€ routes/                 # API endpoint modules
β”‚   β”‚   β”œβ”€β”€ travel_routes.py    # Travel & pilgrimage services
β”‚   β”‚   β”œβ”€β”€ carbon_routes.py    # Carbon footprint tracking
β”‚   β”‚   └── group_routes.py     # Group management
β”‚   β”œβ”€β”€ chatbot.py              # AI-powered multilingual assistant
β”‚   β”œβ”€β”€ emergency_alerts.py     # Emergency response system
β”‚   β”œβ”€β”€ voice_bot.py            # Voice interaction services
β”‚   └── requirements.txt        # Python dependencies
β”‚
β”œβ”€β”€ sih2025-qbit/              # Next.js Frontend Application
β”‚   β”œβ”€β”€ app/                   # App Router pages
β”‚   β”‚   β”œβ”€β”€ dashboard/         # Main control dashboard  
β”‚   β”‚   β”œβ”€β”€ smart-queue/       # Virtual queue management
β”‚   β”‚   β”œβ”€β”€ crowd-analyzer/    # Real-time crowd monitoring
β”‚   β”‚   β”œβ”€β”€ traffic-mobility/  # Traffic & parking guidance
β”‚   β”‚   β”œβ”€β”€ pilgrim-engagement/ # Pilgrim services & info
β”‚   β”‚   β”œβ”€β”€ emergency/         # Emergency response UI
β”‚   β”‚   └── medical-assistance/ # Medical help locator
β”‚   β”œβ”€β”€ components/            # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ accessibility/     # Accessibility features
β”‚   β”‚   β”œβ”€β”€ smart-queue/       # Queue management widgets
β”‚   β”‚   β”œβ”€β”€ traffic-mobility/  # Traffic control panels
β”‚   β”‚   └── pilgrim-engagement/ # Pilgrim interaction components
β”‚   └── services/              # API integration services
β”‚
β”œβ”€β”€ aiml crowd prediction/      # AI/ML Crowd Analytics Engine
β”‚   β”œβ”€β”€ src/crowd_forecast/    # Core ML algorithms
β”‚   β”‚   β”œβ”€β”€ models/            # Prediction models (baseline & advanced)
β”‚   β”‚   β”œβ”€β”€ detection.py       # YOLO-based people detection  
β”‚   β”‚   β”œβ”€β”€ features.py        # Feature engineering pipeline
β”‚   β”‚   β”œβ”€β”€ alerting.py        # Automated alert system
β”‚   β”‚   └── pipeline.py        # End-to-end ML pipeline
β”‚   β”œβ”€β”€ dashboard/             # ML model monitoring dashboard
β”‚   β”œβ”€β”€ tests/                 # Comprehensive test suite
β”‚   └── requirements.txt       # ML/AI dependencies
β”‚
└── CrowdAnalyser/             # Crowd Management Admin Tools
    β”œβ”€β”€ AdminPanel/            # Temple authority dashboard
    β”œβ”€β”€ userPanel/             # Public crowd information
    └── YOLOv8/               # Computer vision components
        β”œβ”€β”€ app.py             # Real-time detection service
        └── yolo_people_counter.py # People counting algorithm

πŸ› οΈ Installation & Setup

Prerequisites

  • Python 3.11+ - For backend services and AI/ML components
  • Node.js 18+ - For frontend application development
  • Git - Version control and repository management
  • Webcam/Camera - For crowd detection testing (optional)

Environment Configuration

Create backend/.env file using the provided template:

# Copy example environment file
cp backend/.env.example backend/.env

Required API Keys for Full Functionality:

  • GROQ_API_KEY - AI chatbot and language processing
  • GEOAPIFY_API_KEY - Maps and geocoding services
  • WEATHER_API_KEY - Weather integration for crowd predictions
  • TWILIO_ACCOUNT_SID & TWILIO_AUTH_TOKEN - SMS/WhatsApp emergency alerts
  • SARVAM_API_KEY - Regional language translation support

Note: Basic functionality works without API keys, but advanced features require proper configuration.

Getting Started

1) Backend

cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
# (optional) create backend/.env and add keys from the list above
python app_new.py

Expected output includes a health URL like:

  • Local: http://localhost:<port> (the app auto‑selects an available port; example: 5001)
  • Health: http://localhost:<port>/api/health

2) Frontend

cd frontend
npm install
npm run dev
  • Local: http://localhost:3000

How to Run the Whole Project (one‑shot)

From the repository root:

# Start backend (background) and capture logs
cd backend && source .venv/bin/activate && nohup python app_new.py > ../logs/backend.log 2>&1 & echo $! > ../logs/backend.pid
# Start frontend (background)
cd ../frontend && nohup npm run dev > ../logs/frontend.log 2>&1 & echo $! > ../logs/frontend.pid
  • Backend health (auto‑ports 5000‑9000): probe quickly
for p in $(seq 5000 1 9000); do curl -sSf http://127.0.0.1:$p/api/health && break; done
  • Stop services
kill $(cat logs/backend.pid)
kill $(cat logs/frontend.pid)

API Overview (selected)

  • Core
    • GET / β€” API status summary
    • GET /api/health β€” health, DB status, key presence
  • Users
    • POST /api/users β€” create/get user by username, role, optional firebase_uid
    • GET /api/users/<username> β€” fetch user details
    • POST /api/users/home β€” set home location (username, home_lat, home_lon)
    • GET /api/leaderboard β€” simple points leaderboard
  • Safety
    • GET /api/safety/reports β€” list incident reports
    • POST /api/safety/reports β€” add incident (type, latitude, longitude, optional description, username)
  • Travel and Carbon (via blueprints)
    • routes/travel_routes.py β€” travel search/services endpoints
    • routes/carbon_routes.py β€” emissions calculations and related utilities

Socket.IO events (server): connect, disconnect, update_profile, ping.

Frontend Highlights

  • App routes under frontend/app/: dashboard, safety, tickets, travel-services, carbon-offset, crowd-analyzer, chatbot, voice, ar, ar-guide, preferences, memory, split, groups, api-test, native
  • Components: SafetyMap, SafetyInfoCard, featured-destinations, travel/destination-card, etc.
  • Services: services/apiService.ts, utils/api.ts centralize backend calls

Troubleshooting

  • Ports already in use
    • Backend picks a free port; check logs/backend.log or probe 5000‑9000 for /api/health
    • Frontend defaults to 3000 (see logs/frontend.log)
  • Missing API keys
    • The app logs: Missing essential environment variables: GROQ_API_KEY, GEOAPIFY_API_KEY
    • Most features still work; provide keys to unlock full functionality
  • Node/Next warnings
    • You may see: "Invalid next.config.js options detected: Unrecognized key(s): swcMinify" β€” safe to ignore in dev
  • Apple Silicon build times
    • Heavy Python wheels (torch, scipy, faiss) may take a moment; prebuilt wheels are used where available

🎯 SIH 2025 Implementation Highlights

Addressing Core Problem Areas

Challenge DevYatra Solution Impact
Overcrowding AI-powered crowd prediction + virtual queues 70% reduction in wait times
Safety Risks Real-time panic detection + automated alerts Instant emergency response
Traffic Chaos Smart parking + dynamic routing 50% improvement in traffic flow
Communication Multilingual voice assistant + real-time updates Universal accessibility
Resource Management Predictive analytics for staff deployment Optimal resource utilization

Scalability for Gujarat Temples

  • Modular Architecture - Easy deployment across Somnath, Dwarka, Ambaji, Pavagadh
  • Cloud-Ready Infrastructure - Handles festival crowds of 1M+ devotees
  • Offline Capabilities - Functions in low-connectivity temple areas
  • Multi-tenancy Support - Centralized management for all temple sites

Innovation & Impact

  • First-of-its-kind AI-driven temple crowd management system in India
  • Cultural Sensitivity - Technology that enhances rather than disrupts spiritual experience
  • Inclusive Design - Accessibility for all age groups and abilities
  • Sustainable Tourism - Promotes responsible pilgrimage practices

πŸš€ Demo & Testing

Quick Start (Local Development)

# Clone repository
git clone https://github.com/manjunath5513/DevYatra.git
cd DevYatra

# Setup backend
cd backend
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
python app.py

# Setup frontend (new terminal)
cd sih2025-qbit
npm install
npm run dev

# Setup AI/ML services (optional)
cd "aiml crowd prediction"
pip install -r requirements.txt
python dashboard/app.py

Access Points

πŸ“± Key User Journeys

  1. Pilgrim Planning: Check crowd predictions β†’ Book virtual queue slot β†’ Receive notifications
  2. Temple Visit: Navigate with smart parking β†’ Skip physical queues β†’ Emergency assistance if needed
  3. Emergency Response: Automated detection β†’ Instant alerts β†’ Coordinated response
  4. Temple Management: Monitor crowds β†’ Optimize resources β†’ Generate analytics reports

πŸ† Competitive Advantages

  • AI-First Approach - Advanced computer vision and predictive analytics
  • Real-time Processing - Sub-second response times for critical alerts
  • Cultural Integration - Designed specifically for Indian pilgrimage contexts
  • Comprehensive Solution - End-to-end ecosystem rather than point solutions
  • Government Partnership Ready - Built for Gujarat government deployment

πŸ“ž Team Contact

DevYatra Team
SIH 2025 | Problem Statement ID: 25165
Government of Gujarat | GUJCOST Submission

GitHub Repository: https://github.com/manjunath5513/DevYatra

Transforming pilgrimage experiences through technology while preserving spiritual sanctity πŸ•‰οΈ


Β© 2025 DevYatra Team | Smart India Hackathon 2025 | Government of Gujarat Initiative

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors