tutorial - https://www.youtube.com/watch?v=F5UPAlmxP3Y
Integrated Urban Intelligence Orchestrator for Ahmedabad city - Real-time analytics, AI-powered insights, and comprehensive urban management dashboard.
The Ahmedabad Smart City Platform is a comprehensive urban management solution designed to provide real-time insights into city operations, infrastructure utilization, and environmental conditions. Built specifically for Ahmedabad, Gujarat, this platform serves as a centralized hub for monitoring and analyzing critical urban metrics across multiple domains.
Key Objectives:
- Enable data-driven decision making for city administrators
- Provide transparent access to city metrics for citizens.
- Facilitate predictive analysis and scenario planning.
- Integrate multiple data sources into a unified dashboard.
- Support both real-time monitoring and historical trend analysis.
Target Users:
- Government Officials: City planners, administrators, and policy makers requiring comprehensive analytics
- Citizens: Residents seeking transparency in city operations and infrastructure status
- Researchers: Urban planning professionals and academics studying smart city implementations
- Air Quality Index (AQI): Live monitoring across 5+ city zones with PM2.5, PM10, NO2 levels
- Traffic Flow Analysis: Real-time congestion mapping, speed analytics, and peak hour identification
- Infrastructure Capacity: Hospital bed utilization, school enrollment rates, and resource allocation
- Urban Development Scoring: Multi-factor assessment of city development across transport, housing, utilities
- What-If Scenario Analysis: GPT OSS 20B model for predictive modeling and policy impact assessment
- Intelligent Forecasting: Machine learning-based predictions for traffic, pollution, and resource demand
- Natural Language Queries: Chat interface for complex data analysis and report generation
- Automated Alerts: Smart notifications for threshold breaches and anomaly detection
- TomTom Integration: High-resolution maps with real-time traffic overlays
- Multi-layer Visualization: AQI heatmaps, traffic congestion zones, and infrastructure locations
- Geospatial Analytics: Location-based insights and zone-wise comparative analysis
- Mobile-responsive: Optimized for both desktop and mobile viewing
- Citizen Portal: Read-only access to public metrics, basic forecasts, and transparency reports
- Government Dashboard: Full administrative access with advanced analytics and scenario planning
- Audit Trails: Complete logging of user actions and data access for compliance
- Secure Authentication: JWT-based authentication with role-specific permissions
- Multi-domain Insights: Healthcare, Education, Environment, Transportation, and Urban Development
- Trend Analysis: Historical data visualization with customizable time ranges
- Comparative Metrics: Zone-wise and time-based comparisons with statistical significance
- Export Capabilities: Data export in multiple formats (CSV, PDF, JSON) for further analysis
- Backend: Django 4.2 + Django REST Framework
- Database: PostgreSQL 15+
- Frontend: React 18 + TypeScript + TailwindCSS + Recharts
- Maps: TomTom Web SDK
- AI: GPT OSS 20B Model
- APIs: OpenAQ, CPCB, TomTom Traffic
- Python 3.9+
- Node.js 18+
- PostgreSQL 15+
- TomTom API key
- GPT OSS API key
# Clone and navigate
cd backend
# Create virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
# Install dependencies
pip install -r requirements.txt
# Setup database
python manage.py migrate
# Start server
python manage.py runserver# Navigate to frontend
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev# Create database
psql -U postgres
CREATE DATABASE ahmedabad_cityview;
CREATE USER cityview_user WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE ahmedabad_cityview TO cityview_user;
\q.
βββ backend/ # Django backend
β βββ cityview/ # Main Django project
β βββ api/ # API endpoints
β β βββ aqi/ # Air quality data
β β βββ traffic/ # Traffic analytics
β β βββ infrastructure/ # Healthcare/Education
β β βββ city/ # City overview
β βββ authentication/ # Auth & JWT verification
β βββ core/ # Core utilities
βββ frontend/ # React frontend
β βββ src/
β β βββ components/
β β β βββ analytics/ # Chart components
β β βββ pages/ # Dashboard, Login
β β βββ services/ # API calls
β β βββ stores/ # State management
β βββ public/
βββ README.md
Test Login Credentials:
Citizen User:
- Email:
tirthpatel1356@gmail.com - Password:
1234 - Role: Citizen (read-only access)
Government User:
- Email:
tirthpatel3129@gmail.com - Password:
1234 - Role: Government (full access)
# Database
DATABASE_URL=postgresql://cityview_user:your_password@localhost:5432/ahmedabad_cityview
# Django
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
# External APIs
GPT_OSS_API_KEY=your-gpt-oss-api-key
TOMTOM_API_KEY=your-tomtom-api-key
OPENAQ_API_KEY=your-openaq-api-key
CPCB_API_KEY=your-cpcb-api-keyVITE_DJANGO_API_URL=http://localhost:8000/api
VITE_TOMTOM_API_KEY=your-tomtom-api-keyTerminal 1 - Backend:
cd backend
venv\Scripts\activate
python manage.py runserverTerminal 2 - Frontend:
cd frontend
npm run devAccess:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000/api
- Admin Panel: http://localhost:8000/admin
- API Failures: Fallback to mock data for development
- Authentication: Clear error messages for invalid credentials
- Network Issues: Retry logic with exponential backoff
- Database Errors: Graceful degradation with cached data
- Frontend Errors: Error boundaries prevent app crashes
β No secrets committed to repository
- All API keys use environment variables
- Database credentials externalized
- JWT secrets not hardcoded
- Test credentials are non-production only
- Citizen: Dashboard analytics, map viewing, basic forecasts
- Government: Full access + What-If scenarios + advanced analytics
GET /api/city/overview- City metrics dashboardGET /api/aqi/current- Real-time air qualityGET /api/traffic/current- Traffic flow dataGET /api/infrastructure/healthcare- Hospital capacityGET /api/infrastructure/education- School enrollmentPOST /api/auth/verify- Token verification