Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WeathCare

Weather that keeps you safe.

**The AI-powered weather app that doesn't just show the forecast **
it tells you what to do about it.


Live Demo


Built for India. Built for the heat, the floods, the fog, and everything in between.


🌑️ Why WeathCare?

Most weather apps stop at a number. 47Β°C? Just "Sunny β˜€οΈ".

India doesn't just have weather it has extreme weather. Heatwaves that hospitalise. Monsoons that flood streets overnight. Dense fog that shuts down highways. And every standard weather app just shows a number and calls it a day.

WeathCare is different. It uses Google Gemini AI to read your exact location and tell you what actually matters:

  • πŸ›‘οΈ Is it safe to step outside right now?
  • πŸ‘• What should you wear today?
  • 🦟 Are nearby ponds a disease risk after the rain?
  • πŸ• When is the safest time to travel?
  • 🚨 What do you do if a storm hits?

✨ Features

πŸ€– AI-Powered Hyperlocal Advice

Gemini AI receives your exact coordinates and live weather data, then generates advice specific to your city's geography mentioning real local risks like flood-prone areas, water bodies, crowded markets, and disease risks after rain.

🌦️ Immersive Weather Backgrounds

The entire UI transforms based on your current weather:

  • πŸ”΄ Extreme heat β†’ Deep red with rising glowing embers
  • 🌧️ Rain / Monsoon β†’ Dark navy with cinematic falling rain
  • ❄️ Snow / Freezing β†’ Icy blue with drifting snowflakes
  • ⚑ Storm β†’ Deep purple with lightning streaks
  • 🌫️ Fog β†’ Grey wisps drifting across the screen
  • πŸƒ Mild / Autumn β†’ Dark green with falling leaves

πŸ“Š Complete Weather Dashboard

  • Current temperature, feels like, humidity, wind speed, pressure
  • UV Index with risk bar
  • Air Quality Index (AQI)
  • Sunrise / sunset times
  • 5-day forecast with temperature trend chart

πŸ›‘οΈ Smart Safety System

  • Risk Level Low / Moderate / High / Extreme with score
  • Can I Go Out? Clear verdict with reason
  • Best Time to Go Outside specific time window
  • Travel Safety Score 0–10 rating
  • Color-coded alerts Red / Yellow / Green

πŸ“ Hyperlocal Insights

AI-generated advice specific to your city not generic tips. If it's raining in Dhanbad, it knows about local ponds and drainage. If it's 45Β°C in Delhi, it knows about outdoor laborers and street food safety.

🚨 Emergency Page

  • Emergency contacts (India: 112, 108, 101, 100)
  • Scenario-specific guides Thunderstorm, Flood, Heatwave, Cyclone, Fog
  • Interactive preparedness checklist with progress tracking

πŸ“± Fully Responsive

Works beautifully on mobile, tablet, and desktop.


πŸš€ Quick Start

1. Clone & Install

git clone https://github.com/yourusername/weathercare.git
cd weathercare
npm install

2. Get Free API Keys

🌀️ OpenWeatherMap (Free)

  1. Sign up at openweathermap.org
  2. Go to API Keys tab β†’ copy your key
  3. Free tier gives you: current weather, 5-day forecast, UV index, AQI

πŸ€– Google Gemini (Free)

  1. Go to aistudio.google.com
  2. Click "Get API Key" β†’ "Create API key in new project"
  3. Free tier: 1,500 requests/day β€” more than enough

3. Set Up Environment

cp .env.example .env

Open .env and fill in your keys:

VITE_OPENWEATHER_API_KEY=your_openweathermap_key_here
VITE_GEMINI_API_KEY=your_gemini_key_here

⚠️ Make sure each key is on a single line with no spaces or line breaks.

4. Run Locally

npm run dev

Open http://localhost:5173 β€” allow location when prompted.


πŸ—οΈ Project Structure

weathercare/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ layout/
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.tsx              # Navigation + mobile menu
β”‚   β”‚   β”‚   └── HeroSection.tsx         # Landing hero + search
β”‚   β”‚   β”œβ”€β”€ weather/
β”‚   β”‚   β”‚   β”œβ”€β”€ WeatherBackground.tsx   # Full canvas weather animations
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchBar.tsx           # City search + GPS location
β”‚   β”‚   β”‚   β”œβ”€β”€ CurrentWeatherCard.tsx  # Main weather display
β”‚   β”‚   β”‚   └── ForecastSection.tsx     # 5-day forecast + Recharts
β”‚   β”‚   └── precautions/
β”‚   β”‚       └── AIPrecautionsPanel.tsx  # AI safety advice UI
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ HomePage.tsx                # Main dashboard
β”‚   β”‚   β”œβ”€β”€ AboutPage.tsx               # About WeathCare
β”‚   β”‚   └── EmergencyPage.tsx           # Emergency contacts + guides
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ weatherService.ts           # OpenWeatherMap API
β”‚   β”‚   └── geminiService.ts            # Gemini AI + smart fallback
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   └── useWeatherData.ts           # Data orchestration hook
β”‚   └── store/
β”‚       └── weatherStore.ts             # Zustand global state

πŸ€– How the AI Engine Works

User opens app
      ↓
GPS coordinates detected (or city searched)
      ↓
OpenWeatherMap API called
β†’ Temperature, humidity, wind, UV index, AQI, visibility, 5-day forecast
      ↓
All data sent to Google Gemini AI with location context:
"Generate hyperlocal safety advice for [City], [Country]
 considering local geography, water bodies, disease risks..."
      ↓
Gemini responds with structured JSON:
{
  riskLevel, riskScore, safeToGoOut,
  precautions[], clothing[], healthAdvice[],
  travelAdvice[], localInsights[], alerts[]
}
      ↓
If Gemini fails β†’ Smart rule-based fallback
(changes per temperature + condition + city β€” never generic)
      ↓
Beautiful UI renders everything

What makes it hyperlocal?

The AI prompt includes your exact city name and coordinates, and instructs Gemini to use its knowledge of that specific area β€” local rivers, ponds, flood-prone zones, market areas, altitude, coastal or inland nature β€” to generate advice you won't find on any generic weather app.


🎨 Tech Stack

Category Technology
Framework React 18 + Vite + TypeScript
Styling Tailwind CSS + Glassmorphism
Animations Framer Motion + Canvas API
Charts Recharts
State Management Zustand (with localStorage persistence)
Data Fetching TanStack Query
Routing React Router v6
Icons Lucide React
Fonts Space Grotesk + Inter + Instrument Serif
AI Google Gemini 2.5 Flash (free tier)
Weather Data OpenWeatherMap API (free tier)
Deployment Vercel

🌐 Deploy to Vercel

# Build first
npm run build

# Push to GitHub
git add .
git commit -m "deploy WeathCare"
git push

Then on vercel.com:

  1. Import your GitHub repository
  2. Add environment variables:
    • VITE_OPENWEATHER_API_KEY
    • VITE_GEMINI_API_KEY
  3. Click Deploy β€” live in 60 seconds βœ…

Every git push auto-redeploys. Your URL stays the same.


πŸ“± Pages

Page Route Description
Home / Weather dashboard + AI advice
About /about How WeathCare works
Emergency /emergency Contacts, guides, checklist

πŸ”’ Environment Variables

Variable Description Required
VITE_OPENWEATHER_API_KEY OpenWeatherMap API key βœ… Yes
VITE_GEMINI_API_KEY Google Gemini API key βœ… Yes

Never commit your .env file. It's already in .gitignore.


πŸ™Œ Contributing

Pull requests are welcome. For major changes, open an issue first.

  1. Fork the repo
  2. Create your branch: git checkout -b feature/amazing-feature
  3. Commit: git commit -m 'add amazing feature'
  4. Push: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“„ License

MIT License β€” free to use, modify, and distribute.


Built with ❀️ for the people of India

Stay safe. Stay informed. Stay ahead of the weather.

Live App

About

Don't just check the weather β€” outsmart it. Real-time precautions, survival tips & smart alerts built for extreme heat in India. 🌑️πŸ”₯

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages