Inspiration
Every rainy season, streets in Ribeirão Preto flood and local businesses take the hit. We wanted a way to see flood risk at street level before it happens, and to help people choose where it is safe to invest.
What it does
AquaCities 3D is a cyberpunk-style 3D dashboard of Ribeirão Preto. A flood-level slider (0–50 m) fills the city map with water so you can watch which areas go under first. Clicking any point fetches real elevation and rainfall data and calculates a flood-risk score. The GeoMarketing module adds a commercial-viability heatmap and a location score for retail spots, weighing flood risk against pedestrian flow.
How we built it
- Frontend: React 18 + Vite + Tailwind CSS, with Mapbox GL JS (dark style, 3D building extrusion, Terrain-RGB).
- Backend: Python + FastAPI, with endpoints for flood risk, elevation, precipitation, viability and commercial hubs.
- Data: Open-Meteo for real rainfall and Mapbox Terrain-RGB for elevation.
- Risk model: Risk = (Precipitation × Imperviousness coefficient) / Altitude, plus Haversine distance for location analysis.
Challenges we ran into
Turning raw Terrain-RGB tiles into usable elevation values, keeping the 3D map smooth while the flood layer redraws, and making the app still work in demo mode without a Mapbox token by falling back to local topographic estimates.
Accomplishments that we're proud of
A working 3D flood simulation of a real city running on real, free weather data, a clean API with interactive docs, and a visual identity that makes risk data easy to read at a glance.
What we learned
How to combine geospatial data, weather APIs and 3D rendering in one product, how to design a simple but meaningful risk formula, and how to split a React frontend and a FastAPI backend cleanly.
What's next for agua-fogo
Swap the simulated heatmap points for official data from INMET and ANA, add rainfall forecasts and alerts, expand to other cities, and give the public sector and real-estate businesses a planning tool.
Built With
- fastapi
- javascript
- mapbox
- mapbox-gl-js
- open-meteo
- pydantic
- python
- react
- tailwindcss
- uvicorn
- vite