Case study · World Food Programme (WFP)

Data flow for an internal project-monitoring tool

I designed the data flow behind an internal tool that programme managers use to monitor field projects. It replaced a monthly chain of spreadsheets and emailed reports with one current, traceable view of every project.

  • 1,400projects across 38 countries in one view
  • 3 daysreporting lag, down from 6 weeks
  • 92%fewer duplicate or invalid records reaching reports
  • 2,600staff hours a month of manual reconciliation removed

Challenge

  • Monitoring data came from country offices, cooperating partners and mobile survey tools, each on its own schedule and template.
  • Field connectivity was weak, so submissions arrived late, partially or more than once.
  • Managers could not trust the headline indicators (distributions completed, tonnage delivered, people reached, spend against budget) without days of manual reconciliation.

What I built

  • A single data contract for projects, sites, activities, indicators and reporting periods, agreed with programme and finance teams.
  • Connectors for mobile data-collection forms, partner file uploads and internal finance and supply-chain systems, all landing in one staging area.
  • An offline-tolerant sync model: field devices queue submissions and reconcile on reconnect, with versioned records and explicit conflict rules instead of silent overwrites.
  • Validation and deduplication at entry, plus scheduled checks that flag missing reports, outliers and spend that does not match deliveries.
  • Lineage from every dashboard figure back to the submission it came from, so any number can be traced in two clicks.
  • A role-based API with data minimisation, so country teams see their projects and personal data about the people we served stays protected.

Stack

Python, Django and Django REST Framework, PostgreSQL/PostGIS, Celery and Redis, Apache Airflow, dbt, KoBoToolbox/ODK integrations, Docker, Azure (AKS, Blob Storage, Azure AD), Power BI and Superset, OpenAPI.

System design

The design is a classic batch data flow: raw data lands unchanged, is cleaned in clear stages, and only the final, tested tables reach managers.

Raw data lands unchanged, is cleaned in clear stages, and only the final, tested tables reach managersevery 15 minutesfailed recordsField captureODK Collect, KoBoCollectKoBoToolbox APIAirflowPartners uploadspreadsheetsAzure Blob StorageFinance and supply-chainextractsnightlyRaw stagingraw schema in PostgreSQLDeduplication and versionskeyed on the instance IDReview queueValidationCelery workers, PostGISCountry officeTransformationdbt models, dbt testsIndicator tablesAnomaly checksscheduled Airflow tasksDjango REST FrameworkAPIAzure AD sign-inRead replicaSuperset and Power BI
  1. Field capture: field staff fill versioned forms in ODK Collect or KoBoCollect on phones and tablets, which store submissions offline. Each submission carries a unique instance ID from the device, and the app retries sending until the server confirms receipt.
  2. Collection: Airflow pulls new submissions from the KoBoToolbox API every 15 minutes, using the last submission time as a cursor. Partners upload spreadsheets through a small portal into Azure Blob Storage, and finance and supply-chain extracts arrive nightly.
  3. Raw staging: every payload is stored unchanged in a raw schema in PostgreSQL, with its source, form version and time received. Raw data is never edited, so any stage can be re-run from it.
  4. Deduplication and versions: records are keyed on the instance ID. A resubmitted or edited form becomes a new version, the most recent edit becomes current, and older versions stay in history. Cases the rules cannot settle go to a review queue.
  5. Validation: Celery workers check required fields, value ranges and site codes against the master list. PostGIS checks that GPS points fall inside the right country and district. Failed records go back to the country office with the reason.
  6. Transformation: dbt models turn clean records into indicator tables per project, site and reporting period. dbt tests (unique, not null, accepted values, relationships) must pass before a table is published. Each indicator row keeps the IDs of the submissions it came from, which gives the lineage.
  7. Anomaly checks: scheduled Airflow tasks flag missing reports for a period, values far from a site's history, and spend that does not match recorded deliveries.
  8. Serving: a Django REST Framework API, behind Azure AD sign-in, applies row-level permissions by country office and project. Personal data about the people served sits in a restricted schema; most roles see only aggregates. Superset and Power BI read the indicator tables from a read replica, so dashboards never slow down data loading.
  9. Platform: services run as containers on AKS, files sit in Blob Storage, and the database is backed up nightly.

Results

  • Coverage: 1,400 projects across 38 countries in one monitoring view
  • Reporting lag: from 6 weeks down to 3 days
  • Data quality: 92% fewer duplicate or invalid records reaching reports
  • Field sync: 99.7% of offline submissions reconciled automatically
  • Time saved: about 2,600 staff hours a month of manual reconciliation removed
Back to Work & Research