Hackathon-ready Streamlit application addressing two critical water management challenges
- Monitor groundwater levels using Digital Water Level Recorder (DWLR) data
- Real-time analysis and prediction of groundwater trends
- Early warning system for critical water levels
- AI-powered insights for water resource management
- Site assessment and feasibility analysis
- Rainwater harvesting potential calculations
- System design and component sizing
- Cost-benefit analysis and ROI calculations
- Implementation guidelines and best practices
- Python 3.8 or higher
- pip package manager
- Clone the repository:
git clone https://github.com/your-username/jalsaarthi-water-intelligence.git
cd jalsaarthi-water-intelligence- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Run the application:
streamlit run app.py- Access the application:
Open your browser and navigate to
http://localhost:8501
jalsaarthi-water-intelligence/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── README.md # This file
├── .gitignore # Git ignore rules
├── src/ # Source code
│ ├── __init__.py
│ ├── pages/ # Streamlit pages
│ │ ├── __init__.py
│ │ ├── groundwater_evaluation.py # DWLR analysis module
│ │ └── rainwater_harvesting.py # RTRWH assessment module
│ ├── models/ # Data models and algorithms
│ │ ├── __init__.py
│ │ ├── groundwater_model.py # Groundwater analysis models
│ │ └── rainwater_model.py # Rainwater calculation models
│ ├── utils/ # Utility functions
│ │ ├── __init__.py
│ │ ├── config.py # Configuration settings
│ │ └── data_loader.py # Data loading utilities
│ └── components/ # Reusable UI components
│ └── __init__.py
├── data/ # Data storage
│ └── sample/ # Sample datasets
├── config/ # Configuration files
├── assets/ # Static assets (images, etc.)
└── tests/ # Test files
- Real-time Data Processing: Load and analyze DWLR data from multiple sources
- Trend Analysis: Identify groundwater level patterns and seasonal variations
- Predictive Modeling: Machine learning-based forecasting using Random Forest
- Spatial Analysis: Interactive maps showing monitoring station locations
- Alert System: Configurable warnings for critical water levels
- Statistical Analysis: Comprehensive data analysis and visualization
- Anomaly Detection: Identify unusual patterns in water level data
- Export Capabilities: Generate reports and export data
- Site Assessment: Comprehensive evaluation of harvesting feasibility
- Potential Calculation: Accurate rainwater harvest estimation
- System Design: Automated sizing of tanks, pumps, and filtration systems
- Cost Analysis: Detailed financial analysis with ROI calculations
- Implementation Guide: Step-by-step implementation roadmap
- Quality Management: Water quality standards and treatment recommendations
- Regulatory Compliance: Guidelines for permits and approvals
- Frontend: Streamlit (Python web framework)
- Backend: Python 3.8+
- Data Processing: Pandas, NumPy
- Machine Learning: Scikit-learn, XGBoost
- Visualization: Plotly, Matplotlib, Seaborn
- Maps: Folium, Streamlit-Folium
- Database: SQLite (with SQLAlchemy ORM)
streamlit==1.28.1 # Web framework
pandas==2.1.1 # Data manipulation
numpy==1.25.2 # Numerical computing
plotly==5.17.0 # Interactive visualizations
scikit-learn==1.3.0 # Machine learning
folium==0.14.0 # Interactive maps
streamlit-folium==0.15.0 # Folium integration- Format: CSV, Excel (XLSX/XLS)
- Required Columns:
timestamp: Date and time of measurementwater_level: Water level in meterstemperature: Water temperature (optional)ph: pH value (optional)conductivity: Electrical conductivity (optional)
- Manual Entry: Direct input of rainfall values
- Historical Data: Pre-loaded regional averages
- API Integration: Weather service integration (configurable)
- Launch Application: Run
streamlit run app.py - Select Module: Choose between Groundwater or Rainwater modules
- Input Data: Upload files or use sample data
- Analyze Results: Explore visualizations and insights
- Generate Reports: Export analysis results
-
Data Upload:
- Upload DWLR CSV/Excel files
- Or use built-in sample data
- Or connect to real-time API feeds
-
Analysis:
- View real-time metrics and trends
- Generate 7-day predictions
- Explore spatial distribution
- Configure alert thresholds
-
Insights:
- Statistical analysis
- Anomaly detection
- Water balance calculations
- Export reports
-
Site Assessment:
- Enter location and building details
- Specify rooftop dimensions
- Input rainfall data
- Assess soil and drainage conditions
-
System Design:
- Calculate harvest potential
- Design storage systems
- Size pumps and filters
- Plan distribution network
-
Financial Analysis:
- Cost estimation
- Benefit calculation
- ROI analysis
- Payback period
-
Implementation:
- Phase-wise implementation plan
- Technical specifications
- Maintenance schedules
- Regulatory requirements
Edit src/utils/config.py to customize:
- Alert thresholds and recipients
- Regional rainfall patterns
- Cost parameters
- API endpoints
- Database connections
Create a .env file for sensitive configurations:
WEATHER_API_KEY=your_api_key_here
DATABASE_URL=your_database_url
SMTP_PASSWORD=your_email_password# Install test dependencies
pip install pytest pytest-cov
# Run all tests
pytest tests/
# Run with coverage
pytest tests/ --cov=src/Sample test datasets are provided in data/sample/ directory.
- Chunking: Large datasets processed in chunks
- Caching: Streamlit caching for expensive operations
- Indexing: Database indexing for faster queries
- Progressive Loading: Lazy loading of heavy components
- State Management: Efficient session state handling
- Responsive Design: Mobile-friendly interface
streamlit run app.py --server.port 8501- Push code to GitHub repository
- Connect to Streamlit Cloud
- Deploy with one click
# Build Docker image
docker build -t jalsaarthi .
# Run container
docker run -p 8501:8501 jalsaarthi# Install Heroku CLI
# Create Procfile: web: streamlit run app.py --server.port=$PORT
heroku create your-app-name
git push heroku main- Fork the repository
- Create feature branch:
git checkout -b feature-name - Make changes and test
- Submit pull request
- Follow PEP 8 guidelines
- Use type hints where possible
- Add docstrings to functions
- Write unit tests for new features
- 🐛 Bug fixes and improvements
- 📊 New visualization features
- 🤖 ML model enhancements
- 📱 UI/UX improvements
- 📚 Documentation updates
- 🧪 Test coverage improvements
- ✅ Core groundwater analysis
- ✅ Rainwater harvesting calculations
- ✅ Basic UI and visualizations
- ✅ Sample data generation
- 🔄 Real-time API integrations
- 🔄 Advanced ML models
- 🔄 Mobile app development
- 🔄 Multi-language support
- 📅 IoT sensor integration
- 📅 Blockchain for data integrity
- 📅 AI-powered recommendations
- 📅 Community features
- Problem Significance: Addresses critical water scarcity issues
- Technical Innovation: AI/ML integration for predictions
- Practical Implementation: Ready-to-deploy solution
- Scalability: Designed for national deployment
- Impact Measurement: Built-in analytics and reporting
- Problem Introduction (2 min)
- Solution Overview (2 min)
- Live Demo - Groundwater Module (4 min)
- Live Demo - Rainwater Module (4 min)
- Impact and Scalability (3 min)
- 📧 Email: [email protected]
- 💬 Discord: JalSaarthi Community
- 📚 Documentation: Wiki Pages
This project is licensed under the MIT License - see the LICENSE file for details.
- Indian Government: Smart India Hackathon initiative
- Water Research Organizations: Domain expertise and data
- Open Source Community: Libraries and frameworks
- Beta Testers: Feedback and improvements
Built with ❤️ for Smart India Hackathon 2025
JalSaarthi - Empowering Water Intelligence for Sustainable Future