Skip to content

High Level Architecture

johnadamsDFID edited this page Jun 3, 2016 · 8 revisions

Components

Development Tracker has the following key components:

  • an open public API (provided by OIPA)
  • a Ruby Sinatra application that consumes the API and serves HTML pages
  • Javascript on the front end to support AJAX queries

High level architecture diagram

Open public API (consumed by DevTracker)

The open public API is provided for DevTracker by Zimmerman & Zimmerman in Amsterdam, using the publicly available OIPA API. The DevTracker code in this repository points to public and private hosted versions of OIPA (see setup instructions).

This API has access to the entire IATI dataset (all data that is referenced on the IATI Registry), including data from UK Government Departments and our NGO, private sector and multilateral partners.

The major challenges we faced in adapting the API were mainly due to the fact that DFID projects have a hierarchy of Project and Component level, with financial information (budgets and transactions) being held at hierarchy 2 level. This makes aggregation of financial data more challenging than with a single-tier structure. We modified our IATI data to aggregate some elements which then makes the API easier to use.

OIPA returns IATI data in JSON format, which is easily consumed by the Ruby Sinatra application.

Ruby Sinatra application (this repo)

The core of DevTracker is a Ruby application built using the Sinatra lightweight framework. Ruby gems permit parsing of the JSON feed from the OIPA API.

The Sinatra framework provides the Embedded Ruby (ERB) templating system to build the dynamic web pages that make up DevTracker.

Some static content not available through IATI (e.g. country descriptions) are held in separate JSON files and accessed in the ERB page templates.

Controller (devtracker.rb)

This is the master controller and routes requests to the appropriate views.

View - ERB templates (/views directory)

All ERB templates are in the /views directory in the appropriate folders for the routing outlined in devtracker.rb.

Public site content (/public directory)

Public site content (images, Javascript, stylesheets) are contained in the /public folder.

Static data (/data directory)

Static data content (codelists, country descriptions etc) are contained in the /data folder.

Front-end Javascript components (this repo)

Javascript is used in the front end to support the following functions:

  • graphs using C3
  • mapping using Leaflet
  • dynamic AJAX calls to the API to support filtering and pagination

Considerations in a live version

Running a live version of DevTracker has the following architectural components (which are not available in this repo, for obvious reasons)

  • A Varnish cache between the Sinatra app and the API, to improve performance.
  • Continuous Integration to support easy deployment
  • RSS feed provides information to an email subscriber service

Further reading

See a short blog post on the new DevTracker architecture.