Zambia Reservoir Monitor. A map of all reservoirs in Zambia powered by Global Water Watch satellite data, showing surface area changes over time from 1986 to present.
# Zambia Reservoir Monitor
A web app that maps all reservoirs in Zambia and shows surface water area time series (1985–present) sourced from Global Water Watch satellite data.
## Use cases
- **Drought early warning** — fill level and 12-month trend shows which reservoirs are critically low ahead of a dry season
## Features
- Interactive map of ~470 Zambian reservoirs
- Click any reservoir to view its surface water area history
- Stats panel showing current area, historical max, fill level, and 12-month trend
- Data filtered to Zambia's actual borders (not a rectangular bounding box)
## Stack
- **Backend**: Node.js + Express + TypeScript
- **Frontend**: React + Vite + MapLibre GL JS (`@vis.gl/react-maplibre`) + Recharts + Tailwind CSS v4
- **CMS**: Re:Earth CMS — stores reservoir name, GWW ID, and GeoJSON Point location
- **Data source**: Global Water Watch API
## Setup
### 1. Install dependencies
```bash
npm install
```
### 2. Configure environment variables
Copy `.env.example` to `.env` and fill in your values:
```bash
cp .env.example .env
```
```
PORT=3000
CMS_BASE_URL=
api.cms.reearth.io
CMS_WORKSPACE_ID=
CMS_PROJECT_ID=
CMS_MODEL_ID=
CMS_INTEGRATION_TOKEN=
CMS_WORKSPACE_ALIAS=
CMS_PROJECT_ALIAS=
```
### 3. Run in development
Two terminals:
```bash
npm run dev:server # Express API on
localhost
npm run dev:client # Vite dev server on
localhost
```
The Vite dev server proxies `/api` requests to the Express server.
### 4. Build for production
```bash
npm run build # Vite build → public/, tsc → dist/
npm start # Express serves everything on
localhost
```
## CMS setup
This project uses Re:Earth CMS to store and serve reservoir data. See the CMS User Manual for full documentation.
### 1. Create a model
In your Re:Earth CMS project, create a new model and add the following fields:
| Field key | Type | Description |
|-----------|-----------------|------------ …