A comprehensive, public-facing platform for visualizing 20+ years of flood and rainfall data in SΓ£o Paulo, Brazil.
This project transforms raw climate data from the CGE (Centro de Gerenciamento de EmergΓͺncias) into interactive, accessible visualizations that serve multiple audiences:
- ποΈ Citizens: Plan routes and avoid flood-prone areas
- π¬ Researchers: Access historical climate data for studies
- ποΈ Urban Planners: Identify infrastructure priorities
- π¨ Emergency Services: Optimize response based on patterns
- Historical Trends - "How has flooding changed over time?"
- Rainfall Correlation - "Does more rain mean more floods?" (with Pearson coefficient)
- Hourly Patterns - "When should I worry about floods?" (24x7 heatmap)
- Seasonal Analysis - "Which months are riskiest?" (Radar chart)
- Duration Statistics - "How long do floods last?"
- Regional Comparison - "Which neighborhoods get more rain?"
- Calendar Heatmap - "What were the rainiest days?" (365-day view)
- β Modern UI/UX: Glassmorphism, smooth animations, gradient backgrounds
- β Fully Accessible: WCAG AA compliant, ARIA labels, keyboard navigation
- β Responsive Design: Mobile-first, 320px to 1920px
- β Performance Optimized: Lazy loading, caching, code splitting
- β Bilingual Support: Portuguese and English
- β Open Data: Public API, downloadable datasets
- β Real-time Updates: Daily data refresh from CGE
- 20,030+ flood events (2004-present)
- 203,376 rainfall measurements
- 44 subprefectures monitored
- 20+ years of historical data
- Framework: React 18.3 + TypeScript 5.5
- Build Tool: Vite 5.4
- Styling: Tailwind CSS 3.4
- Charts: Recharts, Chart.js
- Maps: Leaflet + React-Leaflet
- Animations: Framer Motion
- API: FastAPI (Python)
- Database: SQLite
- Data Collection: Automated daily scraping
- Hosting: Render
- Cache: In-memory with TTL
- Node.js 18+
- npm or yarn
# Clone the repository
git clone https://github.com/yourusername/climate-data-web-page.git
cd climate-data-web-page
# Install dependencies
npm install
# Run development server
npm run devnpm run build
npm run previewclimate-data-web-page/
βββ src/
β βββ components/ # React components
β β βββ Dashboard.tsx # Main dashboard layout
β β βββ ProjectOverview.tsx
β β βββ HistoricalFloodsCard.tsx
β β βββ RainfallFloodCorrelationCard.tsx
β β βββ FloodHourlyHeatmapCard.tsx
β β βββ SeasonalPatternsCard.tsx
β β βββ FloodDurationDistributionCard.tsx
β β βββ SubprefectureRainfallComparisonCard.tsx
β β βββ RainfallCalendarHeatmap.tsx
β βββ pages/ # Page components
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions
β β βββ apiClient.ts # API wrapper
β β βββ chartConfig.ts # Chart theming
β β βββ performance.ts # Performance utilities
β βββ hooks/ # Custom React hooks
β βββ index.css # Global styles
βββ public/ # Static assets
βββ TESTING.md # Testing guide
βββ DEPLOYMENT.md # Deployment guide
βββ README.md
Base URL: https://web-scrapper-cge.onrender.com/api
GET /floods/this-month- Current month flood countGET /floods/time-series- Historical trends (yearly/monthly)GET /floods/hourly-patterns- Time-of-day patternsGET /floods/seasonal-patterns- Monthly averagesGET /floods/duration-stats- Flood duration distributionGET /floods/by-subprefecture- Counts by regionGET /floods/all- Full dataset export
GET /rainfall/daily-totals?year=2024- Daily rainfall dataGET /rainfall/by-subprefecture-monthly?year=2024- Regional comparison
GET /analytics/rainfall-flood-correlation?start_date=2024-01-01&end_date=2024-12-31
- Primary: Green (#10B981) - Climate/nature theme
- Accent: Emerald gradients
- Danger: Red (#EF4444) - High flood alerts
- Warning: Amber (#FBBF24)
- Info: Blue (#3B82F6)
- Font: System UI stack
- Scale: Display, h1, h2, h3, body-lg, body
- β WCAG AA compliant
- β Keyboard navigable
- β Screen reader optimized
- β High contrast ratios
- β Focus indicators
- β ARIA labels throughout
- Lighthouse Score: 90+ (target)
- Bundle Size: < 1MB gzipped
- Load Time: < 3 seconds
- TTI: < 5 seconds
- Caching: 5-minute client cache, 24-hour backend cache
See TESTING.md for comprehensive testing guide.
# Run linter
npm run lint
# Build and test
npm run build
npm run previewSee DEPLOYMENT.md for deployment instructions.
npm run deployContributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
All data is collected from the CGE (Centro de Gerenciamento de EmergΓͺncias) website. Data is automatically scraped daily and stored in a SQLite database.
- Not all floods may be recorded
- Rainfall aggregated by subprefecture
- 24-hour update delay
- Dependent on CGE data accuracy
This project is licensed under the MIT License - see the LICENSE file for details.
Fabricio Neri
- CGE (Centro de Gerenciamento de EmergΓͺncias) for public data
- Open source community for amazing tools
- Contributors and testers
For questions, issues, or feature requests:
- Open an issue on GitHub
- Contact via LinkedIn
- Email: fabricionl@al.insper.edu.br
Made with β€οΈ for a better SΓ£o Paulo