Skip to content

Latest commit

 

History

History
188 lines (139 loc) · 4.46 KB

README.md

File metadata and controls

188 lines (139 loc) · 4.46 KB

Rapu Ture

Maintainability AwesomeCode Status for ServiceInnovationLab/RapuTure Build Status Test Coverage Deploy to heroku

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
brew install rbenv

Then edit your .zshrc and add:

eval "$(rbenv init -)"

to the bottom of it.

  • You will need to setup the app's environment variables
mv env-example .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
  • Install PostgreSQL (in a Mac)
brew install postgresql
  • Start PostgreSQL on startup (in a Mac)
pg_ctl -D /usr/local/var/postgres start
  • Install PostgreSQL (in Ubuntu)
apt-get install postgresql postgresql-contrib
  • Configure PostgreSQL to startup upon server boot (in Ubuntu)
update-rc.d postgresql enable
  • Start PostgreSQL (in Ubuntu)
service postgresql start
  • Create role in DB (In a Mac)
psql -dpostgres
postgres=# CREATE USER postgres SUPERUSER;
  • Install xcode command line tools *(In a Mac)
sudo xcode-select --switch /Library/Developer/CommandLineTools        
  • Bundler. Install this from gem
gem install bundler
  • Run the setup script
bin/setup
  • mv env-example .env
  • 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