okfn / ibp-explorer

[ARCHIVED] Data Explorer for the Open Budget Survey, built in collaboration with the International Budget Partnership.
http://survey.internationalbudget.org
7 stars 5 forks source link

Open Budget Survey Explorer

Build Status Coverage Status Issues

This project is no longer active. Live version used to live at: http://survey.internationalbudget.org (Archived version: https://web.archive.org/web/20220119021336/http://survey.internationalbudget.org/)

Developed in collaboration between the International Budget Partnership and the Open Knowledge Foundation. Written by Tom Rees, Hélène Durand, Tryggvi Björgvinsson, Damjan Velickovski, and Brook Elgie.

Applications

Explorer

Explorer is the biggest part of the web application, representing most of the endpoints, and is served from the root route - /.

The explorer application is a static backbone app (served through express), built using webpack. Its data is built up from static files stored in the ./data directory. See below for more details.

Questionnaire Review

In addition to the explorer and tracker applications, there's another small static app to serve the questionnaire review pages.

A page for each country in the survey is built, with questions and answers from the survey questionnaire, for ease of review. These can be accessed with a username and password at /questionnaires. These pages are built, each time the app is deployed, from data defined in a .csv file hosted on Google Sheets.

The questionnaire data spreadsheet id, and the username and password are set as env vars as defined below.

The static pages are built using Metalsmith into /_build-questionnaires and served as a static site from the central express app.

Tracker

There is retired code for the the Tracker application in the tracker directory that was concerned with the 'Document Availability' page, previously served at the /availability endpoint. The functionality offered by this app has since been moved into the Explorer and is now available from #availability.

The Tracker will be removed at some point in the future. Below is the previous description:

The Tracker app is concerned with the 'Document Availability' page and is served from the /availability route. It is an express app. Its data is retrieved during runtime from an external API using the separate ibp-explorer-data-client app.

Some of the installation instructions below concern the retired Tracker and can be ignored.

Installation and Deployment

To run locally:

To deploy:

Environment variables:

You will need to set additional environment variables needed by ibp-explorer-data-client

To test:

Updating the explorer data

All the data lives in the ./data folder, along with a Python tool to Extract-Transform-Load it through a complicated data-massage. Outputs are:

To update the data:

To get those changes processed by the tool:

Updating the explorer front-end

After generating new data from the ETL script:

Testing etl pipeline

Some basic tests for the python etl pipeline are provided in ./data/tests. Run $ pytest in the ./data directory. These compare the etl output with expected data.

Updating the tracker translations