Skip to content

Parliament.uk prototype is an early incarnation of a new parliament website. Please see the README for more information.

License

Notifications You must be signed in to change notification settings

ukparliament/parliament.uk-prototype

Repository files navigation

Parliament.uk prototype

Note: parliament-prototype has been depreciated. This served as an initial incarnation of the new Parliament Beta website (https://beta.parliament.uk/).

This application has been split into three separate applications, plus a number of gems to bring it closer to our digital principles (https://pds.blog.parliament.uk/2017/08/16/a-technology-strategy-for-parliament/):

Also see the below for additional helper repos

Parliament.uk Prototype is a Rails application designed to be the beginnings of a new parliament.uk website and API.

Build Gemnasium License

Contents

Requirements

Parliament.uk Prototype requires the following:

Getting Started

Clone the repository:

git clone https://github.com/ukparliament/parliament.uk-prototype.git
cd parliament.uk-prototype

Application architecture

Parliament.uk Prototype is made up of three main components:

There are a number of additional side pieces but for now, these are our main focus.

Parliamentary Data API

Behind the prototype is an API that provides our application with all the data it needs to run. This data is served in an RDF format called n-triples.

In production, there is an API application that serves dynamic data to our Rails application. For local development, we use the parliament.uk-static-api application/docker image.

Using the static application allows us to quickly prototype data responses without a reliance on the internal parliament API.

Bandiera

'Bandiera is a simple, stand-alone feature flagging service' which we use to enable and disable certain features within the parliament application.

We use Bandiera to enable and disable time-boxed states such as dissolution within the application. When enabled, banners display on certain pages of the site.

Parliament Rails Application

This is the Parliament.uk Prototype application itself, the routes, controllers and views that make up our application.

Running the application

Running the application locally is done using docker-compose, but there is a one-off set up command needed the first time:

make dev

This command will set up the dependent docker images and databases that the application uses to run.

Once this step has been completed, you can simply run:

docker-compose up

Now the three main applications should be available as follows:

Running the tests

We use RSpec as our testing framework, and run our tests inside of Docker. Use the below command to run the full suite.

make test

Running them within the running application image

The downside to running make test is speed, virtually every time, we will be rebuilding the Docker image just to run our tests.

To get around this, whilst developing we can first connect to the running application and run tests within it. The following commands assume you have the application running via docker-compose up:

docker-compose exec app /bin/sh
bundle exec rake parallel:spec

This will first open an sh terminal within the running application server, then execute the tests right away without the need to re-build the image.

Contributing

If you wish to submit a bug fix or feature, you can create a pull request and it will be merged pending a code review.

  1. Fork the repository
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

Parliament.uk Prototype is licensed under the Open Parliament Licence.

About

Parliament.uk prototype is an early incarnation of a new parliament website. Please see the README for more information.

Resources

License

Stars

Watchers

Forks

Packages