An introduction to Energy Transition, and the Theia front-end
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.



ETFlex aims to make the Energy Transition Model accessible to ordinary people who want to learn more about the subject, as well as help QI better serve educational users.

Most of the application is implemented in CoffeeScript and can be found in /client, while Rails serves up little more than a REST API.


  1. Copy config/database.sample.yml and config/etflex.sample.yml to config/database.yml and config/etflex.yml respectively. Edit any settings as necessary for your local machine.

  2. Install the Qt framework (see "Running the Tests" below for more information). This is required when installing Gems for the "test" environment, and is not needed for production installs.

  3. bundle install

  4. After creating your new database, run rake db:setup db:seed to add the tables, and some initial seed data.

Runtime Options

You can customise the ETFlex experience by including certain options as part of the URL query string.


Any GET request for an HTTP resource (i.e. the root page, /scenes/:id, etc) may include an optional who parameter:

This will set the name of the guest user. If the visitor has been to the ETFlex site previously then either the name will be updated (if they opted not to enter a name on their previous visit), or a new session will be created if the name differs from the one we stored.


Disables or enables the display of high scores. When disabled, the high score "podium" prop is removed from scenario pages, and the high score lists will be hidden on both scenario pages and the root page.

Running the Tests

The ETFlex integration tests use the capybara-webkit Gem to do headless full-stack tests, which include the JavaScript client. In order to run these you will first need to install the Qt4 framework. Mac OS X users with Homebrew should be able to achieve this simply by running

$ brew install qt

Full instructions can be found on the capybara-webkit wiki

Client Events

The CoffeeScript client implements the PubSub pattern to communicate between different components: ( String name )
  This is triggered when a component would like the main module
  to change the name of the current user or guest. Typically occurs after
  the user enters their name when starting a scenario or achieving a high
  score. ( String name, User|Guest user )
  This event is triggered after the app has changed the user name in the
  client. Note that any HTTP request to persist the name change on the
  server may be pending. Components should respond to this event by
  changing the user name in the UI.