An AI-powered civic crisis reporting and resolution platform that connects citizens with municipal governments. Built with Next.js, Firebase, and Google Gemini AI.
Google for Developers Challenge Track: Community Hero - Hyperlocal Problem Solver
The Challenge: Municipalities struggle to manage, categorize, and prioritize a high volume of citizen-reported hazards (potholes, fires, leaks). Disconnected systems cause slow emergency routing, duplicate work on identical issues, and a lack of real-time communication during localized crises.
- AI-Powered Report Analysis — Gemini 2.5 Flash auto-categorizes reports, assigns severity, priority scores, and routes to the right department
- Smart Duplicate Detection — AI semantic comparison + proximity-based detection to merge duplicate reports
- Interactive Crisis Map — Full-screen Leaflet map with severity-colored pins and satellite imagery
- Role-Based Access Control — Citizen, Moderator, and Admin roles with granular permissions
- Crisis Alert Broadcasting — System-wide emergency alerts with severity levels and safety instructions
- Community Validation — Upvotes, confirmations, and comment threads on reports
- Admin Console — Verification queue, alert management, system metrics, and audit logs
- Gamified Badges — XP points and civic achievement badges to incentivize participation
- Offline Mock Mode — Full functionality without Firebase/Gemini using localStorage fallback
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router, static export) |
| UI | React 19, Tailwind CSS v4, Lucide Icons |
| AI | Google Gemini 2.5 Flash (@google/genai) |
| Database | Firebase Firestore (with localStorage mock) |
| Auth | Firebase Auth (Email/Password, Google OAuth) |
| Maps | Leaflet + react-leaflet with Google satellite tiles |
| Deploy | Firebase Hosting, Docker |
| AI Agent | Antigravity |
- Node.js 24+
- A Google Gemini API key (for AI features)
- A Firebase project (optional — runs in mock mode without it)
npm installCreate .env.local:
GEMINI_API_KEY=your_gemini_key
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
npm run dev| Role | How to Access |
|---|---|
| Admin | Email containing "admin" (e.g., [email protected]) |
| Moderator | Email containing "mod" (e.g., [email protected]) |
| Citizen | Any other email |
npm run build # Static export to /out
firebase deploy # Deploy to Firebase Hostingdocker build -t civicpulse-ai .
docker run -p 8080:8080 civicpulse-aisrc/
├── app/
│ ├── page.tsx # Landing page
│ ├── dashboard/page.tsx # Community issues dashboard
│ ├── map/page.tsx # Full-screen crisis map
│ ├── alerts/page.tsx # Emergency broadcast center
│ ├── admin/page.tsx # Admin console
│ ├── auth/page.tsx # Authentication
│ ├── profile/page.tsx # User profile & badges
│ └── report/
│ ├── page.tsx # Report detail view
│ └── new/page.tsx # Report submission wizard
├── components/
│ ├── Navbar.tsx # Navigation bar
│ ├── FullscreenMap.tsx # Full-screen map
│ ├── MapSelector.tsx # Location picker
│ └── MapViewer.tsx # Embedded map
├── context/
│ └── AuthContext.tsx # Auth state management
└── lib/
├── dbService.ts # Database CRUD operations
├── firebase.ts # Firebase client init
├── firebaseAdmin.ts # Firebase admin init
└── gemini.ts # Gemini AI integration
- Citizen submits a report — Title, description, photos, GPS location
- Gemini AI analyzes it — Generates summary, category, severity, priority, department assignment, safety instructions
- Duplicate check — AI compares against nearby reports to detect duplicates
- Admin/Moderator reviews — Verifies, marks in-progress, resolves, rejects, or merges duplicates
- Crisis alerts — Admins broadcast emergency alerts with safety instructions to all users
- Community engagement — Citizens upvote, confirm, and comment on reports
Next.js 16, React 19, Tailwind CSS v4, Google Gemini 2.5 Flash, Firebase Firestore, Firebase Auth, Leaflet Maps, Docker.
Copyright (c) 2026 Janhavi Rathod. All Rights Reserved.
This software and all associated files are proprietary and confidential. No part of this project may be used, copied, modified, distributed, or published in any form or by any means without the prior written permission of the copyright owner.