A lightweight web application that pulls real satellite-based rainfall data from the NASA POWER API and transforms it into actionable, farmer-friendly insights. The tool visualizes monthly rainfall patterns, identifies optimal planting windows, highlights drought risk periods, and detects secondary rainy seasons for selected African regions.
# Day 22 — Rainfall Data Visualizer & Smart Planting Assistant
A lightweight web application that pulls real satellite-based rainfall data from the NASA POWER API and transforms it into actionable, farmer-friendly insights. The tool visualizes monthly rainfall patterns, identifies optimal planting windows, highlights drought risk periods, and detects secondary rainy seasons for selected African regions.
---
## Features
- Live monthly rainfall data from NASA POWER (MERRA-2 satellite dataset)
- Automatic conversion from mm/day to mm/month
- Interactive bar chart built with the Canvas API
- Smart planting month recommendations
- Drought risk period detection
- Secondary rainy season identification
- Multi-country support (Africa-focused demo regions)
- Zero dependencies, pure HTML, CSS, and JavaScript
---
## Resources
- Demo:
- Medium article:
## Tech Stack
- HTML
- CSS
- Vanilla JavaScript
- Canvas API
- NASA POWER Open API
---
## Setup
Start a local development server (required for API requests due to CORS policies):
```bash
python -m http.server
npx serve
```
Open the app in your browser:
```bash
localhost
```
---
## Data Source
This project uses the NASA POWER Project API with the MERRA-2 satellite climate dataset. Monthly corrected precipitation values are retrieved using geographic coordinates and converted into monthly rainfall averages suitable for agricultural analysis.
---
## Developer Notes
The NASA API requires both start and end year parameters. Missing these will return HTTP 422 errors.
Rainfall values are returned in mm/day and must be converted to mm/month for meaningful interpretation.
The dataset includes a month 13 value, which represents annual averages and should be ignored during monthly analysis.
Coordinates currently reference capital cities for demonstration accuracy.
---
## License
MIT License — Free to use, modify, and distribute for educational, NGO, and commercial applications.