Table of Contents
drAIn is an AI/machine learning - powered platform for flood resilience. It is designed to help engineers, planners, and local governments predict, simulate, and strengthen urban drainage systems.
The project moves beyond simple hazard mapping by integrating SWMM-based (Storm Water Management Model) hydraulic simulations with AI-driven analytics and community participation. It transforms complex flood data into actionable insights to support proactive maintenance, infrastructure upgrades, and data-driven resilience planning.
Urban flooding is a critical problem, often caused by heavy rainfall and poor drainage maintenance. While many existing tools focus on flood hazard mapping or risk assessment, they often remain theoretical. They typically lack real-time data integration, community participation, and operational decision support.
- 🧠 Machine learning - Driven Vulnerability Ranking: Assesses each drainage component using metrics like flooding volume and overflow duration. It then applies machine learning (K-Means clustering) to classify and rank structural vulnerabilities.
- 🌊 Interactive Simulation: Provides interactive "what-if" scenario testing, allowing users to simulate the impact of rainfall or structural changes in real time.
- 👥 Community Participation: Incorporates citizen reporting, allowing communities to contribute real-world drainage data for model validation and maintenance tracking.
- 📊 Actionable Intelligence: Converts complex simulation data into clear, actionable intelligence for engineers and planners to make informed decisions.
Comprehensive documentation is available in the docs/ folder:
- Architecture - System design, tech stack, and data flow
- API Documentation - Supabase and SWMM API reference
- Component Guides - Component usage and examples
- Feature Guides - Step-by-step feature tutorials
- Features - Detailed feature documentation
- Development - Developer resources
Quick links:
Follow these steps to set up and run drAIn locally.
git clone https://github.com/eliseoalcaraz/drAIn.git
cd drAInpnpm installcp .env.example .envEdit the .env file with your configuration (API keys, database URL, etc.)
pnpm run devIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
drAIn/
├── app/ # Next.js App Router pages
│ ├── (auth)/ # Authentication routes
│ ├── map/ # Interactive map interface
│ ├── dashboard/ # Analytics dashboard
│ ├── simulation/ # SWMM simulation
│ └── reports/ # Flood reporting
├── components/ # React components
│ ├── ui/ # Base UI components (shadcn/ui)
│ ├── control-panel/ # Control panel feature
│ ├── dashboard/ # Dashboard components
│ └── context/ # Context providers
├── lib/ # Utilities and libraries
│ ├── map/ # Map configuration
│ ├── supabase/ # Database operations
│ ├── simulation-api/ # SWMM API client
│ └── dashboard/ # Dashboard queries
├── hooks/ # Custom React hooks
├── public/ # Static assets
│ ├── drainage/ # GeoJSON data
│ └── images/ # Images and icons
├── docs/ # Documentation
│ ├── architecture/ # System design docs
│ ├── api/ # API reference
│ ├── components/ # Component guides
│ ├── guides/ # Feature tutorials
│ └── features/ # Feature documentation
└── scripts/ # Build and utility scripts
For a detailed architecture overview, see System Architecture Documentation.
This project is licensed under the GNU General Public License v2.0 (GPL-2.0). You may redistribute and/or modify it under the terms of the GNU GPL, as published by the Free Software Foundation. - see the LICENSE file for details.