Skip to content
Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

42 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 Climate Shield

AI-driven real-time climate risk analysis platform for detecting flood and heatwave threats using live weather intelligence.

Python Flask License Status


πŸš€ Live Demo

🌐 https://climate-shield.onrender.com


πŸ“Œ Overview

Climate Shield is a lightweight climate intelligence platform that combines:

  • 🌦 Real-time weather monitoring
  • ⚠ Flood and heatwave risk analysis
  • πŸ€– AI-powered climate awareness chatbot
  • πŸ“Š Modern analytics dashboard
  • 🌍 Location-based weather insights

Users can enter:

  • City
  • State
  • Country

and instantly receive:

  • Live weather data
  • Flood risk score
  • Heatwave risk score
  • Climate alerts
  • Safety guidance

✨ Features

🌦 Real-Time Weather Monitoring

Climate Shield fetches live weather data using the OpenWeatherMap API and displays:

  • Temperature
  • Humidity
  • Rainfall
  • Wind Speed

⚠ Climate Risk Analysis

The backend computes:

Flood Risk

Based on:

  • Rainfall
  • Humidity
  • Wind speed

Heatwave Risk

Based on:

  • Temperature
  • Humidity

🚨 Smart Alert System

The platform automatically generates alerts such as:

  • ⚠ Flood Risk Detected
  • β˜€ Heatwave Risk Detected
  • βœ… No major climate risks detected

πŸ€– ClimateBot AI Assistant

Climate Shield includes an integrated AI chatbot that provides:

  • Flood awareness
  • Heatwave precautions
  • Cyclone safety guidance
  • Climate change information
  • Disaster preparedness suggestions

The chatbot is lightweight and rule-based.


πŸ–₯ Frontend

Built using:

  • HTML5
  • CSS3
  • Vanilla JavaScript

Frontend features:

  • Glassmorphism UI
  • Responsive design
  • Animated result cards
  • Interactive chatbot widget
  • Live climate analysis

βš™ Backend

Powered by:

  • Python
  • Flask
  • Flask-CORS

Backend responsibilities:

  • Weather API communication
  • Risk calculations
  • Climate alert generation
  • Chatbot API responses
  • Frontend serving

🧠 Tech Stack

Technology Purpose
Python Backend logic
Flask API server
Flask-CORS Cross-origin support
HTML/CSS/JS Frontend
OpenWeatherMap API Live weather data
Render Deployment

πŸ“‚ Project Structure

Climate-Shield/
β”œβ”€β”€ AI-chatbot/
β”‚   └── chatbot.py
β”‚
β”œβ”€β”€ backend/
β”‚   └── alertsystem.py
β”‚
β”œβ”€β”€ Frontend/
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ chatbot.js
β”‚   β”œβ”€β”€ script.js
β”‚   β”œβ”€β”€ style.css
β”‚   β”‚
β”‚   └── Analysis/
β”‚       β”œβ”€β”€ analysis.html
β”‚       β”œβ”€β”€ analysis.css
β”‚       └── analysis.js
β”‚
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
└── requirements.txt

πŸ›  Installation Guide

⭐ Star the Repository

1️⃣ Clone Repository

git clone https://github.com/thetechguardians/Climate-Shield.git

cd Climate-Shield

2️⃣ Create Virtual Environment

Windows

python -m venv venv

venv\Scripts\activate

Linux / macOS

python3 -m venv venv

source venv/bin/activate

3️⃣ Install Dependencies

pip install -r requirements.txt

4️⃣ Configure Environment Variables

Create a .env file in the root directory:

OPENWEATHER_API_KEY=your_api_key_here

Get your free API key from:

https://openweathermap.org/api


5️⃣ Run Backend

python backend/alertsystem.py

Backend runs on:

http://127.0.0.1:5000

6️⃣ Open Frontend

Open:

Frontend/index.html

OR serve locally:

cd Frontend

python -m http.server 8000

🌐 API Endpoints

Weather Analysis

POST /weather

Request

{
  "city": "Guwahati",
  "state": "Assam",
  "country": "India"
}

Response

{
  "success": true,
  "weather": {
    "temperature": 29,
    "humidity": 83,
    "rainfall": 5,
    "wind_speed": 12
  },
  "risks": {
    "flood_risk": 0.62,
    "heat_risk": 0.41
  },
  "alerts": [
    "⚠ Flood Risk Detected"
  ]
}

Chatbot API

POST /chatbot

Request

{
  "message": "What precautions should I take during floods?"
}

Response

{
  "success": true,
  "response": "You should avoid low-lying areas during floods."
}

πŸš€ Deployment on Render

Build Command

pip install -r requirements.txt

Start Command

gunicorn backend.alertsystem:app

πŸ” Environment Variables

Variable Description
OPENWEATHER_API_KEY OpenWeatherMap API Key

πŸ“ˆ Future Improvements

  • 🌧 Rain prediction forecasting
  • πŸ“ Interactive GIS climate maps
  • πŸ“² SMS / Email emergency alerts
  • πŸ›° Satellite weather integration
  • 🧠 Machine learning risk prediction
  • 🌎 Multi-language support

🀝 Contributing

Contributions are welcome.

Please read:

CONTRIBUTING.md

before submitting pull requests.


πŸ›‘ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Authors

Developed by Team Climate Shield.


πŸ“ž Support & Community

πŸ†˜ Need Help?

🌟 Stay Connected


🌍 Vision

Climate Shield aims to make climate risk awareness:

  • Fast
  • Accessible
  • Intelligent
  • Easy to understand

for communities, students, researchers, and emergency responders.


⭐ Show Your Support

If this project helped you, please consider:

  • ⭐ Starring this repository
  • 🍴 Forking it to contribute
  • πŸ“’ Sharing it with others
  • πŸ’– Following for more amazing projects
  • πŸ›  Contribute improvements


About

AI-driven real-time flood and heat risk alert system with crisis mapping and human validation.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages