Data-driven visibility into city systems. Predictive maintenance powered by AI. Community engagement that makes a difference.
Cities face an infrastructure crisis that's invisible until something breaks.
The Current Reality:
- π No visibility into system health across the city
- π§ Maintenance teams react to crises instead of preventing them
- π± Community reports scattered across multiple channels, easily lost
- π Data siloedβno way to identify patterns or recurring problems
β οΈ Budget decisions made without data backing- π Millions spent on avoidable emergencies
The Cost of Reactive Management: When water pipes burst, electrical systems fail, and roads deteriorate without warning, the city pays in emergency repairs, business disruptions, and reduced quality of life.
What if you could see problems forming before they became catastrophic? What if every citizen report became actionable intelligence? What if your maintenance budget was guided by data, not crisis?
CityCare transforms city infrastructure from reactive chaos into intelligent, data-driven management.
We combine real-time geospatial visualization, predictive AI analysis, and community-powered reporting to give cities complete visibility into infrastructure health and predictive insights for maintenance planning.
π± Citizens Report Issues β πΊοΈ Live Heatmap Visualization β
π Pattern Detection & Analysis β π€ AI Risk Assessment β
π― Smart Prioritization β β
Accelerated Resolution
|
|
|
|
|
|
%%{init: {'theme':'base', 'themeVariables': { 'primaryColor':'#1976d2','primaryTextColor':'#fff','primaryBorderColor':'#0d47a1','lineColor':'#424242','secondaryColor':'#388e3c','tertiaryColor':'#f57c00','noteBkgColor':'#fff9c4','noteTextColor':'#000'}}}%%
graph TB
subgraph Frontend["π₯οΈ Frontend - Vercel"]
NextJS["Next.js 14<br/>App Router + RSC"]
Leaflet["Leaflet Maps<br/>Real-time Heatmaps"]
AdminUI["Admin Dashboard<br/>Charts & Analytics"]
end
subgraph Backend["βοΈ Backend - Railway"]
Express["Express + TypeScript<br/>REST API"]
AdminModule["Admin Module<br/>User/Issue Management"]
EmailService["Nodemailer<br/>HTML Templates"]
end
subgraph Data["πΎ Data Layer"]
Firestore["Firebase Firestore<br/>GeoPoint Queries"]
FirebaseAuth["Firebase Auth<br/>JWT Tokens"]
end
subgraph AI["π€ AI Layer"]
Gemini["Gemini 1.5 Flash<br/>Natural Language Insights"]
end
NextJS --> Express
Leaflet --> NextJS
AdminUI --> AdminModule
Express --> Firestore
Express --> FirebaseAuth
Express --> Gemini
EmailService --> Express
AdminModule --> Firestore
style Frontend fill:#1976d2,stroke:#0d47a1,stroke-width:2px,color:#fff
style Backend fill:#388e3c,stroke:#2e7d32,stroke-width:2px,color:#fff
style Data fill:#7b1fa2,stroke:#6a1b9a,stroke-width:2px,color:#fff
style AI fill:#f57c00,stroke:#e65100,stroke-width:2px,color:#fff
|
Next.js 14
|
Express API
|
Firestore
|
Gemini AI
|
|
Features:
|
Features:
|
||||||
|
|||||||
| Field | Type | Description |
|---|---|---|
| issue_id | UUID | Unique identifier |
| category | Enum | Water, Electricity, WiFi, Sanitation, etc. |
| latitude | Float | Geographic latitude |
| longitude | Float | Geographic longitude |
| severity | Integer | Severity level (1-5) |
| timestamp | DateTime | Issue creation time |
| status | Enum | Open, In Progress, Resolved |
| description | Text | Issue details |
| building_id | String | Associated zone identifier (optional) |
|
v18 or higher |
Free tier cluster |
From AI Studio |
# Create Firebase project
# (console.firebase.google.com)
# Enable Firestore
# Enable Authentication
# Download service account keyGet:
π Full Guide |
cd backend
npm install
# Add .env file
MONGODB_URI='mongodb+srv://user:pass@cluster.mongodb.net'
GOOGLE_GEMINI_API_KEY='your_key'
EMAIL_USER='your@gmail.com'
EMAIL_PASS='app_password'
# Deploy to Railway
npm run buildπ Railway Guide |
cd frontend
npm install
# Add .env.local
NEXT_PUBLIC_API_URL='https://your-api.railway.app'
# Run locally
npm run dev
# Deploy to Vercel
vercel --prodπ Integration Guide |
| Service | URL | Description |
|---|---|---|
| π¨ Frontend | http://localhost:3000 | Next.js app with heatmaps |
| βοΈ Backend | http://localhost:3001 | Express API on Railway |
| π₯ Firestore | Firebase Console | Database & authentication |
| π§ Admin Panel | /admin/dashboard | User/issue management |
π€ Gemini API Key (1500 requests/day)
- Visit aistudio.google.com
- Click "Create API Key"
- Copy to
GOOGLE_GEMINI_API_KEYin .env
π₯ Firebase Config (No credit card)
- Go to Firebase Console
- Create new project
- Enable Firestore Database
- Enable Authentication (Email & Google)
- Project Settings β Service Accounts β Generate new private key
- Copy JSON to
FIREBASE_SERVICE_ACCOUNT_KEY
π§ Gmail SMTP (For email notifications)
- Enable 2FA on your Google account
- Generate App Password: myaccount.google.com/apppasswords
- Add to .env:
EMAIL_USER=your@gmail.com EMAIL_PASS=your_16_char_app_password
Backend (.env):
MONGODB_URI='mongodb+srv://user:pass@cluster.mongodb.net/citycare'
GOOGLE_GEMINI_API_KEY='AIzaSy...'
EMAIL_USER='your@gmail.com'
EMAIL_PASS='your_app_password'
PORT=3001
FRONTEND_URL='http://localhost:3000'Frontend (.env.local):
NEXT_PUBLIC_API_URL='http://localhost:3001'citycare/
βββ π README.md # You are here!
βββ π³ docker-compose.yml # Multi-service orchestration
βββ π docs/ # Comprehensive documentation
β βββ DATABASE_ARCHITECTURE.md # MongoDB schema guide
β βββ architecture/ # System design docs
β βββ api/ # API specifications
β βββ prompts/ # AI prompt templates
β
βββ βοΈ backend/ # Node.js + Express + TypeScript
β βββ src/
β β βββ config/ # MongoDB & Cloudinary setup
β β βββ modules/ # Feature modules
β β β βββ issues/ # Issue management
β β β βββ analytics/ # Data analytics
β β β βββ ai/ # Gemini integration
β β β βββ auth/ # JWT authentication
β β βββ middlewares/ # Express middleware
β β βββ types/ # TypeScript definitions
β β βββ utils/ # Helper functions
β βββ package.json # Dependencies (MongoDB, Express)
β
βββ π¨ frontend/ # Next.js 14 + TypeScript
β βββ src/
β β βββ app/ # Next.js app router
β β βββ components/ # React components
β β β βββ Map/ # Leaflet + OpenStreetMap
β β β βββ Charts/ # Data visualization
β β β βββ Dashboard/ # Admin interface
β β βββ lib/ # Utilities & API client
β β βββ styles/ # Tailwind CSS
β βββ public/ # Static assets
β
βββ π analytics/ # Analytics Scripts
β βββ bigquery/ # Data analysis queries
β
βββ ποΈ infra/ # Infrastructure as Code
βββ cloudrun.yaml # Cloud Run deployment
βββ sql/ # Database initialization
# Backend tests
cd backend
npm test
npm run test:coverage
# Frontend tests
cd frontend
npm test
# Build and deploy
cd backend
railway link
railway upAuto-configured:
|
# Build Next.js app
cd frontend
npm run build
# Deploy to Vercel
vercel --prodFeatures:
|
|
|
|
|
Extend to multiple institutions with tenant isolation |
Connect real-time sensors for automated monitoring |
Native iOS/Android apps for field staff |
Scale to public infrastructure management |
graph LR
A[π΄ Fork] --> B[πΏ Branch]
B --> C[π» Code]
C --> D[β
Test]
D --> E[π Commit]
E --> F[π Push]
F --> G[π Pull Request]
style A fill:#e3f2fd
style G fill:#c8e6c9
Quick Steps:
- π΄ Fork the repository
- πΏ Create feature branch (
git checkout -b feature/AmazingFeature) - π» Make your changes
- β Add tests
- π Commit (
git commit -m 'Add AmazingFeature') - π Push to branch (
git push origin feature/AmazingFeature) - π Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
|
Document Database Flexible schema and powerful query language |
AI Intelligence Natural language insights and automated report generation |
Interactive Maps Open source mapping with no API key required |
Open Source Maps Free, unlimited map tiles with no API key required |





