# Droughtmap Hub The Drought-map Hub is a streamlined system that automates the generation and publication of the Composite Drought Index (CDI) map for Eswatini. # Project Sheet
**Name** | Droughtmap Hub Eswatini |
**Project Scope** | The National Disaster Management Agency (NDMA) of Eswatini requires a system to monitor, evaluate, and analyse drought conditions in the country. Akvo is developing a platform that utilises output data generated by the Composite Drought Index (CDI) script, provided by the National Drought Mitigation Center (NDMC), through the GeoNode platform, which will be deployed by the NDMA. |
**Contract Link** | |
**Project Dashboard Link** | |
**Start Date** | |
**End Date** | |
**Repository Link** | [https://github.com/akvo/eswatini-droughtmap-hub/](https://github.com/akvo/eswatini-droughtmap-hub/) |
**Tech Stack** | List of technologies used to execute the technical scope of the project: - Front-end: JavaScript with React Framework - Back-end: Python with Django Framework - Testing: Django Test Framework, Jest - Coverage: Coveralls - Documentation: RTD, dbdocs - CI & CD: Github Workflows - Hosting: GKE - Database: PostgreSQL, Cloud-SQL - Storage: Cloud Storage Buckets |
**Asana Link** | [2435 - Drought Monitoring - Eng. Planning Board](https://app.asana.com/0/1208796157034791/1208847968993113) |
**Slack Channel Link** | [https://akvo.slack.com/archives/C07C0GG86BW](https://akvo.slack.com/archives/C07C0GG86BW) |
**Inkhungla** | **Initial Value** | **Reviewer 1** | **Reviewer 2** | **Reviewer X** | **Validated Value** |
---|---|---|---|---|---|
Value + rationale | Value + rationale |
Class Name | Class Notes |
Administration | Administration(id, parent\_id, code, name, admin\_level) |
SystemUser | SystemUser(id, name, email) |
CDIMap | CDIMap(id, geonode\_id, year\_month, geotiff, geojson, published\_geojson, published\_at, status, narrative, bulletin\_url) |
CDIMapValues | CDIMapValues(id, cdi\_map, administration, initial\_value, value) |
ReviewAssignment | ReviewAssignment(id, cdi\_map, due\_date, message) |
Reviewer | Reviewer(id, cdi\_map, user, status, approved\_at) |
Review | Review(id, cdi\_map, user, administration, value, comment, approved) |
Feedback | Feedback(id, user, email, name, message, tags, status, submitted\_at) |
Jobs | Jobs(id, task\_id, type, status, attempt, result, info, user, created, available) |
Task | Task(id, name, func, hook, args, kwargs, result, group, started, stopped, success, attempt\_count) |
**pos** | **column** | **null** | **dtype** | **len** | **default** |
---|---|---|---|---|---|
1 | id | No | int | system\_user\_id\_seq | |
2 | name | No | character varying | 100 | |
3 | No | character varying (unique) | 255 | ||
4 | role | No | enum(`UserRoleTypes`) | reviewer | |
5 | password | No | character varying | 128 | |
6 | email\_verified | No | boolean | false | |
7 | email\_verification\_code | Yes | uuid | ||
8 | reset\_password\_code | Yes | uuid | ||
9 | reset\_password\_code\_expiry | Yes | datetime | ||
6 | created\_at | No | timestamp | current\_datetime | |
7 | updated\_at | Yes | timestamp | ||
8 | deleted\_at | Yes | timestamp |
**pos** | **column** | **null** | **dtype** | **len** | **default** |
---|---|---|---|---|---|
1 | id | No | int | administration\_id\_seq | |
2 | code | No | character varying | 50 | |
3 | name | No | character varying | 50 | |
5 | admin\_level | Yes | int | ||
7 | created\_at | No | timestamp | current\_datetime | |
8 | updated\_at | Yes | timestamp |
**pos** | **column** | **null** | **dtype** | **len** | **default** |
---|---|---|---|---|---|
1 | id | No | int | cdi\_map\_id\_seq | |
2 | geonode\_id | No | int | ||
3 | year\_month | No | date | ||
4 | initial\_values | No | JSON | ||
5 | validated\_values | Yes | JSON | ||
6 | published\_at | Yes | timestamp | ||
7 | status | No | int | 5 | |
8 | narrative | Yes | text | ||
9 | bulletin\_url | Yes | character varying | 255 | |
10 | created\_at | No | timestamp | current\_datetime | |
11 | updated\_at | Yes | timestamp |
**pos** | **column** | **null** | **dtype** | **len** | **default** |
---|---|---|---|---|---|
1 | id | No | int | review\_assignments\_id\_seq | |
2 | cdi\_map\_id | No | int | ||
3 | due\_date | No | date | ||
4 | message | No | text | ||
5 | created\_at | No | timestamp | current\_datetime | |
6 | updated\_at | Yes | timestamp |
**pos** | **column** | **null** | **dtype** | **len** | **default** |
---|---|---|---|---|---|
1 | id | No | int | reviewers\_id\_seq | |
2 | assignment\_id | No | int | ||
3 | user\_id | No | int | ||
4 | status | No | int | ||
5 | created\_at | No | timestamp | current\_datetime | |
6 | updated\_at | Yes | timestamp | ||
7 | approved\_at | Yes | timestamp |
**pos** | **column** | **null** | **dtype** | **len** | **default** |
---|---|---|---|---|---|
1 | id | No | int | reviewers\_id\_seq | |
2 | cdi\_map\_id | No | int | ||
3 | user\_id | No | int | ||
4 | administration\_id | No | int | ||
5 | value | Yes | enum | ||
6 | comment | Yes | character varying | 255 | |
7 | approved | Yes | boolean | ||
8 | created\_at | No | timestamp | current\_datetime | |
9 | updated\_at | Yes | timestamp |
**pos** | **column** | **null** | **dtype** | **len** | **default** |
---|---|---|---|---|---|
1 | id | No | int | feedbacks\_id\_seq | |
2 | user\_id | Yes | int | ||
3 | message | No | text | ||
4 | name | No | character varying | 100 | |
5 | No | character varying | 100 | ||
6 | tags | Yes | JSON | ||
7 | status | No | ENUM - "New" - "Reviewed" - "Resolved" | New | |
8 | submitted\_at | No | timestamp | current\_datetime |
**pos** | **column** | **null** | **dtype** | **len** | **default** |
---|---|---|---|---|---|
1 | id | No | int | jobs\_id\_seq | |
2 | task\_id | No | character varying | ||
3 | user\_id | No | int | ||
4 | type | No | int | 5 | |
5 | status | No | int | 5 | |
6 | attempt | Yes | int | 5 | |
7 | result | No | JSON | ||
8 | info | Yes | character varying | 255 | |
9 | created\_at | No | timestamp | ||
10 | updated\_at | Yes | timestamp |
**Name** | **Value** | **Description** |
---|---|---|
start | YYYY-MM | Select start month |
end | YYYY-MM | Select end month |
compare | \[\] | Array of Map ID |
**Name** | **Value** | **Description** |
---|---|---|
format | enum( GeoTIFF, CSV, GeoJSON) | Export format (e.g., GeoTIFF, CSV, GeoJSON). |
**Name** | **Value** | **Description** |
---|---|---|
start | YYYY-MM | Select start month |
end | YYYY-MM | Select end month |
status | enum: 1 - Pending 2 - In Review 3 - In Validation 4 - Published | CDI Map Status |
The 3-month SPI reflects positive short and medium-term moisture conditions which has a positive impact on vegetation and surface temperature hence promoting vegetation growth and also lowering the the near-surface air temperature.
", "bulletin_url": "https://example.com/eswatini/cdi-2025-01.pdf", } ``` **Response: 200 OK** on success ```json { "id": 100, "geonode_id": 150, "year_month": "2025-01", "initial_values": [ { "administration_id": 339, "value": 0.68, "category": "D4" }, { "administration_id": 338, "value": 2, "category": "D3" }, ... { "administration_id": 330, "value": 30, "category": "D0" }, ], "validated_values": [ { "administration_id": 339, "value": 3, "category": "D3" }, { "administration_id": 338, "value": 2, "category": "D3" }, ... { "administration_id": 330, "value": 15, "category": "D1" }, ], "published_at": "2025-01-29 08:00:30TZ", "status": 4, "narrative": "The 3-month SPI reflects positive short and medium-term moisture conditions which has a positive impact on vegetation and surface temperature hence promoting vegetation growth and also lowering the the near-surface air temperature.
", "bulletin_url": "https://example.com/eswatini/cdi-2025-01.pdf", } ``` #### 4. Reviewer API ##### 4.1 List CDI Map **Endpoint**: `GET /api/v1/reviewer/cdi-maps` **JWT Access: Reviewer** **Request params:****Name** | **Value** | **Description** |
---|---|---|
start | YYYY-MM | Select start month |
end | YYYY-MM | Select end month |
status | enum: 1 - Pending 2 - In Review 3 - In Validation 4 - Published | CDI Map Status |
**Message Type** | **Message Detail** |
---|---|
Data is Missing | - Recipient: DroughtHub Admins - Subject: CDI-E Automation - YYYY-MM - Mission data - Body: - Datetime of execution - “The following datasets have not yet been updated. Another attempt will be done in XX days.” - List the datasets for which the data is missing |
Error | - Recipient: Technical Support Contacts - Subject: CDI-E Automation - YYYY-MM - Execution Error - Body: - Datetime of execution - “The CDI automation has failed for month YYYY-MM. See the attached log file for details.” **Attachment: Log file** |