IATI Code Blog

IATI Dashboard

IATI Dashboard - Static Files All The Way Down

24 Mar 2014

By Ben Webb

Currently the IATI Dashboard is hosted using github pages (although this will soon change, see below). As some of you will know, this means that it entire site is made up entirely from static files.

The static HTML files etc. are generated by the code in the IATI-Dashboard repository. This code uses a variety of sources, including some data from github, but is mostly based on static JSON files generated by IATI-Stats. This is turn generates the stats JSON files from IATI publisher's source XML files, which are downloaded by IATI-Registry-Refresher.

There are several advantages to using static files. They are easy to move around, and delete, and easy to serve (only a basic webserver is needed). Using them for data storage removes the need to run, use or understand any database software, which hopefully makes it easier for other people to deploy. All computation can take place overnight, when other server load is at a minimum. Generating static files also makes it easy to check that all pages generate successfully.

I chose JSON for my data storage format, because it is easier to quickly manipulate using a dynamic language such as Python or PHP, than a more "heavyweight" alternative like XML. After XML, it's also one of the most widely used generic data interchange formats.

Storing the stats output in JSON gives us a simple API for no extra effort. Since the datastore uses this data in this form, I can be sure all information on the dashboard is also accessible via a machine readable source by others. To help people find the relevant JSON file, the dashboard now has links from each table column or graph to the JSON.

Of course, using static files does have it's downsides. Some of the problems I've encountered: