Empowering India's citizens to report, verify, and resolve civic issues through AI-powered intelligence and blockchain verification
VishwaGuru is a comprehensive platform for civic issue reporting and resolution, built with modern AI/ML technologies, featuring distributed verification, multi-language support, and real-time field officer coordination.
- Multi-Category Detection: 15+ civic issue detectors (potholes, garbage, vandalism, floods, infrastructure, noise, animals, parking, streetlights, fires, trees, pests, blocked roads, safety hazards, construction)
- AI-Powered Analysis: Automatic severity assessment, categorization, and priority scoring
- Spatial Deduplication: Smart detection of nearby/duplicate issues within configurable radius
- Image Analysis: Advanced YOLO-based object detection + HuggingFace CLIP for semantic understanding
- Smart Scanner: One-tap detection for multiple issue types simultaneously
- Multi-Language Support: Hindi, Bengali, Telugu, Marathi, Tamil, Gujarati, Kannada, Malayalam, Punjabi, and more
- Voice Submission: Report issues via audio in your preferred regional language
- Real-Time Transcription: Speech-to-text powered by SpeechRecognition
- Translation Engine: Automatic English β Regional Language translation
- Proof-of-Resolution Tokens: Time-limited, location-verified tokens for resolution evidence
- Geofencing Validation: GPS verification within configurable radius (default 200m)
- Blockchain Integrity: Immutable audit logs with cryptographic signatures
- Duplicate Detection: Prevents submission of identical evidence for different grievances
- Authority Sign-Off: Resolving authority confirms and verifies resolution evidence
- Daily Refinement Engine: Machine learning-based trend analysis and pattern detection
- Adaptive Weights: Dynamic scoring algorithm that learns from resolution history
- Real-Time Dashboard: Live statistics on issue distribution, resolution rates, response times
- Leaderboard: Citizen contribution rankings and impact metrics
- Civic Insights: Predictive analytics for emerging problem areas
- Check-In System: Real-time GPS tracking of field officers
- Geofencing Alerts: Automatic notifications when officers reach incident locations
- Visit History: Complete record of officer visits with timestamps and geo-coordinates
- Mobile Workflows: Offline-capable mobile forms for field operations
- MLA Locator: Find Maharashtra Legislative Assembly representatives by pincode
- Jurisdiction Mapping: Automatic routing to correct government departments
- SLA Management: Track Service Level Agreements for different issue categories
- Escalation Engine: Automatic escalation with customizable thresholds
- Grievance Tracking: End-to-end grievance status monitoring
- Google Gemini Integration: Advanced text generation for action plans
- HuggingFace Models: CLIP for image understanding, Llama for text generation
- Local ML: Optional CPU-based inference for privacy and offline capability
- Fallback Chain: Graceful degradation - Gemini β HuggingFace β Mock services
- RAG Service: Retrieval-Augmented Generation for civic policies
- Multi-Platform: Web, PWA (Progressive Web App), Telegram Bot
- Push Notifications: Real-time updates on issue status changes
- Offline Support: Service Worker + IndexedDB for offline functionality
- Dark Mode: Full dark theme support for accessibility
/api/issues β Issue CRUD, spatial queries, voting
/api/detection β ML-based issue detection endpoints
/api/grievances β Grievance lifecycle management
/api/utility β Helper endpoints (stats, geolocation)
/api/auth β User authentication & authorization
/admin β Admin dashboard & stats
/api/analysis β Data analysis & trends
/api/voice β Voice transcription & language translation
/api/field_officer β Field officer check-in & geofencing
/api/hf β Hugging Face AI text generation
/api/resolution-proof β Blockchain-based resolution verification
- Users: Role-based access control (user, official, admin)
- Issues: Civic reports with geospatial indexing
- Grievances: Escalated issues with SLA tracking
- ResolutionEvidence: Verified proof-of-resolution with audit logs
- EvidenceAuditLog: Immutable audit trail for compliance
- FieldOfficerVisits: GPS-verified officer visits
- PushSubscriptions: PWA notification registry
Upload Image
β
Validation & EXIF Stripping
β
YOLO Detection (Ultralytics)
β
CLIP Semantic Understanding (HuggingFace)
β
Priority Engine (Adaptive Weights)
β
Civic Intelligence Refinement
β
Action Plan Generation (Gemini/HF/Mock)
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React 19, React Router 7, Vite, Tailwind CSS | Modern SPA with code-splitting |
| Backend | FastAPI, SQLAlchemy, Pydantic | Async REST API with ORM |
| Database | SQLite (dev), PostgreSQL (prod) | Persistent storage with spatial indexing |
| ML/AI | Gemini, HuggingFace, YOLO, CLIP | Image/text analysis & generation |
| Voice | SpeechRecognition, Googletrans | Transcription & translation |
| Messaging | python-telegram-bot | Telegram bot integration |
| Storage | File system, optional S3 | Issue images & audio |
| Deployment | Render, Netlify, Neon | Cloud-native stack |
| PWA | vite-plugin-pwa, Service Workers | Offline-first functionality |
- Python 3.10+
- Node.js 18+
- Git
# Clone repository
git clone https://github.com/RohanExploit/VishwaGuru.git
cd VishwaGuru
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
# or: venv\Scripts\activate # Windows
# Install backend dependencies
pip install -r backend/requirements.txt
# Configure environment
cp .env.example .env
# Edit .env with your API keys
# Start backend
uvicorn backend.main:app --reload --host 127.0.0.1 --port 8000cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
# Opens at http://localhost:5173# API Keys
TELEGRAM_BOT_TOKEN=your_bot_token
GEMINI_API_KEY=your_gemini_key
HF_TOKEN=your_huggingface_token
# Database (defaults to SQLite for local dev)
DATABASE_URL=sqlite:///./data/issues.db
# Frontend
FRONTEND_URL=http://localhost:5173
# Optional: Production Database
# DATABASE_URL=postgresql://user:pass@host/dbname
# Optional: Hugging Face Text Generation
HF_TEXT_API_URL=https://router.huggingface.co/featherless-ai/v1/completions
HF_TEXT_MODEL=meta-llama/Meta-Llama-3-8B-Instruct
# Optional: Local ML Configuration
USE_LOCAL_ML=true
LOCAL_ML_DEVICE=cpu
LOCAL_ML_QUANTIZE=false# Backend
curl http://127.0.0.1:8000/health
# Frontend
http://localhost:5173POST /api/issues- Create new issueGET /api/issues/{id}- Get issue detailsGET /api/issues/nearby- Find nearby issuesPOST /api/issues/{id}/vote- Upvote issuePOST /api/issues/{id}/status- Update status
POST /api/detect-pothole- Detect potholesPOST /api/detect-garbage- Detect garbagePOST /api/detect-vandalism- Detect vandalismPOST /api/detect-flooding- Detect floodsPOST /api/detect-infrastructure- Detect infrastructure issuesPOST /api/detect-traffic-sign- Detect traffic signs- ... and 30+ more detection endpoints
POST /api/voice/transcribe- Convert audio to textPOST /api/voice/issue/create- Create issue via voicePOST /api/voice/translate- Translate text
POST /api/resolution-proof/token/generate- Generate proof tokenPOST /api/resolution-proof/evidence/submit- Submit resolution evidenceGET /api/resolution-proof/audit/{grievance_id}- Get audit trail
POST /api/field_officer/checkin- Officer check-inGET /api/field_officer/visits/{officer_id}- Get visit historyPOST /api/field_officer/geofence/validate- Validate geofence
GET /admin/users- List usersGET /admin/stats- System statistics
GET /api/analysis/civic-intelligence- Get civic insightsGET /api/analysis/trends- Get trend analysis
- ARCHITECTURE.md - Detailed system design and data flow
- DEPLOYMENT_GUIDE.md - Production deployment steps
- BACKEND_DEPLOYMENT_CHECKLIST.md - Backend-specific deployment
- CIVIC_INTELLIGENCE.md - Civic intelligence engine details
- VOICE_LANGUAGE_FEATURE.md - Voice & language feature guide
- FIELD_OFFICER_CHECKIN_FEATURE.md - Field officer workflows
- CONTRIBUTING.md - Contribution guidelines
# Backend tests
python -m pytest backend/tests/ -v
# Frontend tests
npm run test
# Build frontend
npm run build
# Type checking
npm run type-check# Database migrations are applied automatically on startup
# For manual migration:
python -c "from backend.init_db import migrate_db; migrate_db()"- Check
.envconfiguration - Verify API keys are valid
- Try SQLite:
DATABASE_URL=sqlite:///./data/issues.db - Check logs:
tail -f backend.log
- Clear node_modules:
rm -rf node_modules && npm install - Clear cache:
npm cache clean --force - Check Node version:
node -v(should be 18+)
- For SQLite (dev):
rm -f data/issues.dbto reset - For PostgreSQL: Verify connection string and database exists
- Run migrations:
python backend/init_db.py
# Reinstall dependencies
pip install -r backend/requirements.txt --upgrade
npm ci # Use lock file for exact versions- API Response Time: < 200ms (p95) for detection endpoints
- Database Queries: Indexed spatial queries in < 50ms
- Image Processing: < 2s for YOLO + CLIP pipeline
- Frontend Bundle: 816KB (minified, before gzip)
- Lighthouse Score: 92+ (performance), 98 (accessibility)
- β Role-based access control (RBAC)
- β JWT token authentication
- β HTTPS-ready (production deployment)
- β EXIF data stripping from images
- β Input validation on all endpoints
- β Rate limiting on API endpoints
- β Blockchain-based resolution verification
- β Audit logging for compliance
- Backend β Render
git push # Automatically deploys on push- Frontend β Netlify
npm run build
# Connect GitHub repo to Netlify for auto-deploy- Database β Neon PostgreSQL
DATABASE_URL=postgresql://user:pass@...neon.tech/...See DEPLOYMENT_GUIDE.md for detailed steps.
Contributions welcome! Please:
- Fork the repository
- Create feature branch:
git checkout -b feature/your-feature - Commit changes:
git commit -m "Add your feature" - Push branch:
git push origin feature/your-feature - Open Pull Request
See CONTRIBUTING.md for detailed guidelines.
GNU Affero General Public License v3.0 (AGPL-3.0)
This ensures all modifications to the platform are shared back with the community.
Made with β€οΈ to empower civic engagement across India
π Website β’ π Docs β’ π¬ Issues β’ π€ Contribute