Skip to content

Web site for exploring Legislation as Code rules

License

Notifications You must be signed in to change notification settings

BetterRules/RapuTure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rapu Ture

Maintainability AwesomeCode Status for ServiceInnovationLab/RapuTure Build Status Test Coverage

Overview

Rapu Ture is a phrase that means "Exploring the rules/law"

This web application presents the variables from within Aotearoa New Zealand's Legislation as Code (Open Fisca) service, as web pages, allowing a user to discover what calculations are available, and where in legislation (or regulation) the rule came from.

Environments

Environment URL Git Branch
UAT https://www.rules.nz master
Production

Project Resources

Resource URL
Backlog https://github.com/orgs/ServiceInnovationLab/projects/11

Documentation

OpenFisca

People Involved

Role(s) Name(s)
Team Rapu Ture
Developers Brenda Wallace, Dana Iti, Jacob Ong, Lyall Morrison, Mischa Saunders
Designers Siobhan McCarthy
Testers
Project Manager Charlotte Hinton
Product Owner Brenda Wallace

Comms

Slack: LabPlus-team #rapu-ture

Setup

This is a ruby on rails app. You will need to:

  • Git clone this repo
git clone git@github.com:ServiceInnovationLab/RapuTure.git
  • You will need to ensure you are using the correct ruby version
ruby -v

Choose one of these tools, to change the ruby version

  1. rbenv
  2. rvm
  • You will need to setup the app's environment variables
cp example.env .env

Docker

This application is configured to run using Docker and docker-compose. You will need Docker for Desktop to run this locally.

To set up:

docker-compose build

To run:

docker-compose up

To fetch data:

docker exec raputure_web_1 bundle exec rake fetch:fetchall

To shut down:

docker-compose down

Non-Docker

It can also be set up without Docker. You will need Ruby, Node, and Postgres.

  • Install the correct version of Ruby. We recommend installing rbenv to manage multiple versions of ruby, and then using that to install the version of ruby specified in our file .ruby-version

  • Install rbenv from https://github.com/rbenv/rbenv then

rbenv install < .ruby-version

In a Mac

Install PostgreSQL

brew install postgresql

Start PostgreSQL on startup

brew services start postgresql

In Ubuntu

Install PostgreSQL

apt-get install postgresql postgresql-contrib

Configure PostgreSQL to startup upon server boot

update-rc.d postgresql enable

Start PostgreSQL

service postgresql start

Bundler. Install this from gem

gem install bundler

Ensure that your .env file contains these values:

DATABASE_USERNAME: postgres (we used this as the default)
DATABASE_PASSWORD: <whatever password has been set for that user>

Run the setup script

bin/setup

Load seed data from OpenFisca (Note: this takes 15 minutes)

bundle exec rake fetch:fetchall

Run the app

bundle exec rails server

Development

Major Dependencies

Ruby 2.5 Rails 5.2 / Puma

  • Postgres
  • Haml
  • React

Quality assurance tools

  • Rubocop
bundle exec rubocop
  • Code Climate - integrated with Travis CI

Deployment

  • Deploys to Heroku via Travis. See .travis.yml

Testing

  • Rspec tests are included in the Travis deployment script and can be run locally
bundle exec rspec