Logo Lanfrica

toggle-corp/malawi-risk-watch-backend

Domain:

peace and security

Record type:

software
Creator:
tog
Host:
# Malawi Risk Watch — Backend Django backend for the Malawi Red Cross Society (MRCS) Disaster Risk Management pipeline. Ingests JBA flood forecasts and ARC parametric rainfall data, processes them against Malawi administrative boundaries, and drives an email notification workflow for MRCS staff. See `docs/data-pipeline.md` for a full description of how JBA and ARC data is ingested, transformed, and stored — and how it drives the trigger event and notification workflow. See `docs/ifrc-go-queries.md` for the GraphQL queries the IFRC Go platform should use to fetch map layers (HDX, JBA flood risk, ARC events) and admin area boundaries. ## Requirements - Docker & Docker Compose ## Getting started ```bash # Start the dev environment docker compose up # Apply migrations docker compose exec web python manage.py migrate # Create a superuser docker compose exec web python manage.py createsuperuser ``` ## Management commands ### `sync_geo` — Sync administrative boundaries from IFRC GO Upserts Malawi admin areas (country, regions, districts) from the IFRC GO API. Safe to re-run. ```bash # Run the sync docker compose exec web python manage.py sync_geo # Preview what would be synced without writing to the database docker compose exec web python manage.py sync_geo --dry-run ``` ### `load_hdx_data` — Load HDX risk assessment datasets Fetches 6 HDX CSV datasets (demographics, vulnerability, flood exposure, etc.) from HEIGiT public storage and stores them in the database. Safe to re-run — existing records are updated in place. ```bash docker compose exec web python manage.py load_hdx_data # Specify which user to set as loaded_by docker compose exec web python manage.py load_hdx_data --user admin@example.com ``` Requires a superuser to exist (or pass `--user`). Run `sync_geo` first so admin area boundaries are in place. ## Dummy data Seeds users, JBA forecasts, ARC observations, trigger events, notification recipients, and logs for local development. Safe to re-r …

Licenses