Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸ’§ WaterAI

A web-based AI assistant for analyzing water quality data using Google Gemini.
Designed to support SDG 6: Clean Water and Sanitation

Python Flask Gemini API License Status


πŸ“Œ Overview

WaterAI is a lightweight web application that uses the Gemini AI API to analyze water quality parameters based on WHO standards. With a modern UI and intelligent backend, it delivers:

  • Overall water quality assessment
  • Risk level estimation
  • Recommendations and solutions
  • SDG 6 alignment

All of this β€” through a single-page interface and a Flask backend.


🧠 Features

  • πŸ“Š Real-time water data input and visualization
  • πŸ§ͺ AI-driven water quality analysis
  • ⚠️ Detection of key issues and health risks
  • πŸ’‘ Actionable short/long-term solutions
  • 🎯 SDG 6 (Clean Water and Sanitation) alignment
  • πŸŒ— Fully responsive dark/light theme switcher

πŸ›  Tech Stack

Layer Technology
🧠 AI Engine Google Gemini
βš™οΈ Backend Flask + Python 3.11
🌐 Frontend HTML5, CSS3, Vanilla JS
🌍 Hosting Render / Localhost

πŸ“ Project Structure


WaterAI/
β”œβ”€β”€ app.py                 # Flask backend + Gemini integration
β”œβ”€β”€ templates/
β”‚   └── index.html         # Frontend form UI
β”œβ”€β”€ .env                   # API key (not committed)
β”œβ”€β”€ requirements.txt       # Python dependencies
└── README.md              # You're reading it


βš™οΈ Setup Instructions

πŸ” Prerequisites


πŸ§ͺ Local Installation

# 1. Clone the repository
git clone https://github.com/Ishan0121/WaterAI.git
cd WaterAI

# 2. Create virtual environment
python -m venv .venv
source .venv/bin/activate  # For Windows: .venv\Scripts\activate.ps1

# 3. Install dependencies
pip install -r requirements.txt

# 4. Create .env file and add your Gemini API key
echo "GEMINI_API_KEY=your_google_gemini_api_key" > .env

# 5. Run the application
python app.py

Visit http://localhost:5000 in your browser.


πŸš€ Deployment

🌐 Deploy to Render

  1. Push this repo to GitHub
  2. Create a Render Web Service
  3. Add your GEMINI_API_KEY as an environment variable
  4. Set build command: pip install -r requirements.txt
  5. Set start command: python app.py

πŸ“Š Demo Preview


🧠 AI Prompt Logic

The backend sends structured water quality data to Gemini using a prompt that:

  • Analyzes parameters against WHO standards
  • Expects structured JSON in return
  • Extracts key insights: quality, risks, solutions, SDG alignment

The Gemini response is parsed and visualized in a well-designed UI.


βœ… Sample Output

{
  "quality_assessment": "Fair",
  "risk_level": "Medium",
  "key_issues": ["High turbidity", "Low pH level"],
  "short_term_solutions": ["Install local filtration units"],
  "long_term_solutions": ["Build community water treatment plant"],
  ...
}

πŸ“‘ Environment Variables

Create a .env file in the root directory:

GEMINI_API_KEY=your_google_gemini_api_key

🀝 Contributing

Pull requests are welcome. If you'd like to add a feature, create an issue first.


🌍 SDG Alignment

WaterAI is built to support:

  • 6.1 – Safe and affordable drinking water
  • 6.3 – Improve water quality, reduce pollution
  • 6.B – Community participation in water management

🧬 Future Plans

  • Support for CSV batch analysis
  • Multilingual support
  • Mobile PWA support
  • LLM fallback using Ollama or GPT-4

Built with Code by Me | 2025

About

**WaterAI** is a lightweight web application that uses the **Gemini AI API** to analyze water quality parameters based on WHO standards. With a modern UI and intelligent backend.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages