🌍 Inspiration

Walking past the same pothole for months. Watching a burst pipe flood the street while neighbors shrugged — "someone will report it." That someone never came. Community Hero was born from a simple frustration: civic reporting is broken. Calling helplines takes 20 minutes. Nothing gets tracked. Nothing gets fixed. Citizens feel powerless. We asked: What if AI could turn any citizen's phone into a civic agent?

🤖 What We Built

Community Hero is a multi-agent AI platform where citizens upload a photo of any community issue — pothole, water leak, broken streetlight, garbage overflow — and Google Gemini 2.5 Flash instantly:

  • 🔍 Detects the issue category from the image
  • ⚠️ Assesses severity and priority automatically
  • 📝 Generates a human-readable summary
  • 📍 Geocodes the GPS location to ward/zone name All issue data is stored in AWS DynamoDB for real-time scalability, with the frontend deployed on Vercel for global performance.

🛠️ How We Built It

Frontend: Vanilla HTML/CSS/JavaScript with ES6 modules — lightweight, fast, no framework overhead AI Layer: Google Gemini 2.5 Flash via secure Vercel serverless proxy — key never exposed to browser Database: AWS DynamoDB — NoSQL key-value store perfect for issue reports at scale Auth: Firebase Authentication — role-based citizen and admin access Maps: Leaflet.js with heatmap overlay — visualize problem density across neighborhoods Media: Cloudinary — image/video upload and CDN delivery Deploy: Vercel (frontend + serverless functions) + Firebase Hosting

Architecture

Citizen uploads photo

Vercel Edge Function

Google Gemini 2.5 Flash (AI Analysis)

AWS DynamoDB (Issue Storage)

Firebase Firestore (Real-time sync)

Leaflet Map + Dashboard (Visualization)

📚 What We Learned

  • Gemini Vision API is remarkably accurate at detecting real-world civic issues from photos — even low-quality mobile images
  • DynamoDB single-table design patterns for flexible issue schema
  • CORS handling between multiple cloud providers (Vercel + Firebase + AWS)
  • Canvas pixel sampling as an offline AI fallback — analyzing image colors to guess category when API is rate-limited
  • Gamification dramatically increases civic participation — people report more when they earn points

🚧 Challenges We Faced

1. AI Categorization Accuracy Early versions returned "Other" for everything. Root cause: image base64 was being analyzed before the canvas finished loading (async timing bug). Fixed with proper img.onload Promise wrapper. 2. CORS Between Cloud Providers Firebase Hosting calling Vercel API functions was blocked by CORS policy. Solved by adding proper Access-Control-Allow-Origin headers to all serverless functions. 3. Gemini Rate Limits Free tier quota exhausted during testing. Built a 3-layer fallback: Vercel proxy → direct API call → canvas pixel sampling → keyword matching. Zero downtime even when API is unavailable. 4. DynamoDB + Vercel Integration AWS SDK v3 with Vercel serverless functions required specific bundling configuration. Solved using @aws-sdk/client-dynamodb with tree-shaking for minimal cold start times. 5. Real-time Map Performance Rendering 100+ markers caused browser lag. Implemented Leaflet.markerCluster for grouping and Leaflet.heat for density visualization — smooth performance even with 1000+ issues.

🏆 Impact

Metric Before After
Reporting time 20 minutes 60 seconds
Manual steps 7 1 (just upload photo)
Issue tracking None Real-time
Citizen engagement Individual Community-verified
Municipal response Reactive Predictive AI alerts

🚀 What's Next

  • WhatsApp Bot — report issues via WhatsApp message
  • Ward Admin Dashboard — dedicated municipal authority portal
  • SLA Tracking — automatic escalation if issues aren't resolved in time
  • Multi-city Support — one platform, every city globally
  • Offline Mode — PWA with service worker for zero-connectivity reporting

Built With

Share this project:

Updates