Know Before You Go โ Not After You're Stuck.
A hyperlocal waterlogging and commute advisory for Mumbai, built for the Gen AI Academy โ APAC Edition hackathon. Every monsoon, commuters find out a street is flooded only after they're stuck on it โ Rasta Radar tells you before you leave.
โญ If you find this useful or you're a fellow hackathon builder, consider starring the repo โ it helps it get seen. โญ
- Vision
- Key Features
- Tech Stack
- Architecture Diagram
- Risk Scoring Formula
- Getting Started
- Project Structure
- Known Limitations
- Roadmap
- Contributing
- License
City-wide flood alerts tell you it's raining somewhere in Mumbai. They don't tell you whether your junction, on your route, is actually a problem right now.
Rasta Radar closes that gap โ combining live rainfall data, a curated database of historically known Mumbai flood spots, and tide timing into a transparent, explainable risk score. No black-box predictions: every score can be traced back to the exact rainfall, severity, and tide numbers that produced it.
- ๐บ๏ธ Live Risk Dashboard โ A color-coded map of known flood spots across Mumbai, ranked by current risk, with a "leave by" time for the ones that matter right now.
- ๐ฌ Ask in Plain Language โ "Will Andheri Subway flood by 6pm?" โ answered by the Gemini API, grounded strictly in real risk data. It never invents a spot that isn't in the dataset.
- โฑ๏ธ Forecast Slider โ Scrub forward through the next few hours of forecast rainfall to watch risk build across the evening, not just see a single snapshot.
- ๐ Route Comparison โ Pick two named routes and see which one passes fewer high-risk spots, with a plain-language recommendation.
- โ Community Confirm/Deny โ Anyone nearby can mark a spot "still flooded" or "clear now," keeping the data grounded in what's actually happening on the ground.
- ๐ Transparent by Design โ The risk formula is shown in the open, not hidden behind an opaque model. See Risk Scoring Formula.
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React + Vite | Fast, component-based UI |
| Mapping | Leaflet.js | Interactive risk map rendering |
| Backend | FastAPI (Python) | Risk scoring engine, REST API |
| Database | Google Cloud BigQuery | Persistent storage for community reports & flood logs |
| Weather Data | Open-Meteo API | Live + forecast rainfall for Mumbai |
| AI | Gemini API | Grounded natural-language ask bar |
| Hosting | Vercel | Unified frontend & backend deployment |
graph TD
Client([Commuter Browser])
UI["React + Vite Frontend<br/>Dashboard ยท Spot Detail ยท Route Compare"]
API["FastAPI Backend<br/>/api/spots /api/forecast /api/routes /api/ask"]
Risk["Risk Scoring Module<br/>rainfall + severity + tide"]
Meteo["Open-Meteo API<br/>(live rainfall)"]
Spots["flood_spots.json<br/>(35 known spots)"]
Tide["Tide Schedule<br/>(approximated)"]
Gemini["Gemini API<br/>(NL ask bar)"]
BigQuery["Google Cloud Platform<br/>(BigQuery DB for Community Reports)"]
Client -->|Interacts with| UI
UI -->|REST/JSON| API
API --> Risk
Risk --> Meteo
Risk --> Spots
Risk --> Tide
API --> Gemini
API -->|Read/Write Reports| BigQuery
classDef ui fill:#1C7293,stroke:#fff,stroke-width:2px,color:#fff;
classDef server fill:#5C7080,stroke:#fff,stroke-width:2px,color:#fff;
classDef data fill:#F2F2F2,stroke:#212121,stroke-width:1px,color:#212121;
class UI ui;
class API,Risk server;
class Meteo,Spots,Tide,Gemini,BigQuery data;
risk_score = (rainfall_last_3h_mm ร 0.6)
+ (historical_severity ร 0.3 ร 20)
+ (tide_proximity_bonus ร 0.1 ร 100)
- Normalized to a 0โ100 scale
- Low < 33 ยท Moderate 33โ66 ยท High > 66
tide_proximity_bonus= 1 if within ยฑ2 hours of Mumbai high tide, else 0
- Python 3.9+
- Node.js 18+
- A Gemini API key (optional โ enables the ask bar)
- GCP Credentials (optional โ enables BigQuery community report persistence)
git clone https://github.com/M0izz/Rasta-Radar.git
cd Rasta-Radar/backend
pip install -r requirements.txt
# Optional: enables BigQuery persistence & Gemini ask bar
copy .env.example .env
# then edit .env and add your keysuvicorn main:app --reloadBackend runs at http://localhost:8000
cd ../frontend
npm install
npm run devFrontend runs at http://localhost:5173
Rasta-Radar/
โโโ backend/
โ โโโ main.py # FastAPI app, route definitions
โ โโโ risk_scoring.py # Risk formula + leave-by logic
โ โโโ gemini_service.py # Gemini NL ask bar integration
โ โโโ flood_spots.json # 35 known Mumbai flood spots
โ โโโ requirements.txt
โ โโโ .env.example
โโโ frontend/
โ โโโ src/
โ โโโ components/ # Map, RiskCard, AskBar, AlertBanner, ForecastSlider
โ โโโ pages/ # Dashboard, SpotDetail, RouteCompare
โ โโโ api/ # Fetch wrappers to the backend
โโโ vercel.json
Being upfront about what this is โ and isn't โ matters more to us than looking polished:
- Not a calibrated prediction model. The risk score is a transparent heuristic, not trained against historical flood outcomes.
- Tide schedule is approximated from a reference date and a fixed ~12h25m period โ not synced with official IMD tide tables.
- Route comparison uses labeled associations (which known spots a route passes near), not real turn-by-turn routing.
- Persistent storage for community confirm/deny votes (integrated with GCP BigQuery)
- Real turn-by-turn routing (OSRM / Google Directions)
- Sync tide schedule with official IMD data
- Calibrate the risk model against historical flood outcomes as ground-truth data becomes available
Rasta Radar is open to contributions from the community!
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'feat: add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License โ see LICENSE for details.
Built for the Gen AI Academy โ APAC Edition hackathon.