Skip to content

SWAG-DSS

Securing Water in Agriculture Decision Support System.

SWAG-DSS is a Flask web application with a JSON API and an interactive dashboard for sub-watershed water-balance analysis across community-managed water systems. It compares water use against crop water requirements in space and time, and surfaces opportunities for water reallocation and on-farm storage, with crop and intervention recommendations and PDF report export.

The served dataset covers 116 WRUAs and 1,782 sub-watersheds, about 18,200 km², in the Central Highlands Ecoregions Foodscape (CHEF) in central Kenya.

All hydrological computation happens offline in the data-preparation scripts. The application reads pre-computed CSV and GeoJSON files committed under app/data/, loads them into memory at startup, and slices and aggregates them at request time. There is no database.

Sections

User Guide

Page Contents
Dashboard walkthrough The three-column dashboard layout, filters, map layers, and detail panel
Comparison view The three scenarios side by side for a single WRUA
Exporting data CSV and PDF export endpoints and their columns
Data management The admin screen: roles, taking a copy of the data, and the source file formats

Architecture

Page Contents
Process documentation The end-to-end method, from study area through to the feedback loop
Data pipeline What the model computes and how supply and demand are reconciled
Modelling unit Why sub-watersheds are the unit of analysis
Reallocation rules How water is moved between sub-watersheds

Reference

Page Contents
API reference Every /api/ endpoint: parameters, access level and response

Operations

Page Contents
Deployment and operations Environment variables, boot behaviour, resource expectations, health checks