{"id":13808521,"url":"https://github.com/openaustralia/theyvoteforyou","last_synced_at":"2026-01-29T21:40:30.197Z","repository":{"id":8241255,"uuid":"9685051","full_name":"openaustralia/theyvoteforyou","owner":"openaustralia","description":"Making parliamentary voting information accessible, understandable, and easy to use so that you can hold your elected representatives to account.","archived":false,"fork":false,"pushed_at":"2026-01-05T06:01:00.000Z","size":28286,"stargazers_count":153,"open_issues_count":27,"forks_count":34,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-01-14T04:09:27.448Z","etag":null,"topics":["democracy","mps","parliament","parliamentary-monitoring"],"latest_commit_sha":null,"homepage":"https://theyvoteforyou.org.au/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openaustralia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"custom":["https://donate.oaf.org.au"]}},"created_at":"2013-04-26T01:23:57.000Z","updated_at":"2025-12-31T05:31:25.000Z","dependencies_parsed_at":"2024-08-04T01:09:08.806Z","dependency_job_id":"f9359f74-dc0b-4ca1-b939-dc359f252875","html_url":"https://github.com/openaustralia/theyvoteforyou","commit_stats":{"total_commits":7483,"total_committers":49,"mean_commits":"152.71428571428572","dds":0.7966056394494186,"last_synced_commit":"da7f56dcc66d21710c1a9a972b65a6d605ea5692"},"previous_names":["openaustralia/publicwhip"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/openaustralia/theyvoteforyou","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openaustralia%2Ftheyvoteforyou","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openaustralia%2Ftheyvoteforyou/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openaustralia%2Ftheyvoteforyou/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openaustralia%2Ftheyvoteforyou/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openaustralia","download_url":"https://codeload.github.com/openaustralia/theyvoteforyou/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openaustralia%2Ftheyvoteforyou/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28886142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["democracy","mps","parliament","parliamentary-monitoring"],"created_at":"2024-08-04T01:01:45.095Z","updated_at":"2026-01-29T21:40:30.192Z","avatar_url":"https://github.com/openaustralia.png","language":"Ruby","funding_links":["https://donate.oaf.org.au"],"categories":["Software"],"sub_categories":["Software-Development"],"readme":"# They Vote For You\n[![Build Status](https://github.com/openaustralia/theyvoteforyou/actions/workflows/rubyonrails.yml/badge.svg)](https://github.com/openaustralia/theyvoteforyou/actions/workflows/rubyonrails.yml) [![View performance data on Skylight](https://badges.skylight.io/status/WaEcq22vbGmE.svg?token=vUJxZEeaJsAHAZwuG7jUg1kAynbWf1OKnhhXosl9ibc)](https://www.skylight.io/app/applications/WaEcq22vbGmE)\n\n## Introduction\n\nIn our democracy the definitive exercise of the power we give our politicians\nwhen we vote them into office is how they vote in our parliaments on our behalf.\nYet you probably don't know how your MP votes. This isn't your fault.\n\nParliamentary voting information is notoriously difficult to find and analyse.\nThis project changes that by making it understandable and easy to use.\n\nOver 10 years ago the pioneering [Public Whip](http://www.publicwhip.org.uk/) project was created in the UK. This is an evolution of that original PHP application into a modern Rails application.\n\n### Process overview\n\n#### Australia\n\nThe [OpenAustralia.org](https://www.openaustralia.org.au) project\n[parses](https://github.com/openaustralia/openaustralia-parser) the Australian\nFederal Hansard into [ParlParse](http://parser.theyworkforyou.com/) format (this\ndue to it's history of being a fork of the UK\n[TheyWorkForYou](http://www.theyworkforyou.com/) project). The debates XML files the parser creates, also available on\n[data.openaustralia.org](http://data.openaustralia.org.au/), contain voting data\nand we load this into a Rails application.\n\n#### UK\n\nThe UK Public Whip site still operates from the original PHP codebase however it's very possible for it to be upgraded to Rails in the future. During the development of [They Vote For You](https://theyvoteforyou.org.au/), the OpenAustralia Foundation was careful to ensure there is an upgrade path.\n\nTo upgrade, checkout the `php-compatibility` branch and point the Rails application at a copy of the UK production database. Test the site out and fix any bugs - there are likely to be some UK-specific additions needed to the Rails application.\n\nOnce the site is working you can then checkout a more recent version of the codebase and run `rake db:migrate` to upgrade the database schema. This also is likely to need some UK-specific changes.\n\nThe final step is to customise the site language and interface. The best way to achieve this would be to develop some sort of theming system.\n\n#### Ukraine\n\nPeople data is collected by a [morph.io scraper](https://morph.io/openaustralia/ukraine_verkhovna_rada_deputies) and fed into [EveryPolitician](http://everypolitician.org/ukraine/). This produces [Popolo formatted](http://www.popoloproject.com/) data that is then loaded into TVFY using a Rake task, e.g.:\n\n    bundle exec rake application:load:popolo[https://raw.githubusercontent.com/everypolitician/everypolitician-data/master/data/Ukraine/Verkhovna_Rada/ep-popolo-v1.0.json]\n\nOnce the people data has been loaded you can start loading votes. These are scraped by [another morph.io scraper](https://morph.io/openaustralia/ukraine_verkhovna_rada_votes), that saves data in a flat format that can easily be converted to Popolo. The conversion is handled by a [small proxy application](https://github.com/openaustralia/morph_popolo) and the results are imported using another Rake task, e.g.:\n\n    bundle exec rake application:load:popolo[https://arcane-mountain-8284.herokuapp.com/vote_events/2015-07-14]\n\n## Development\n\nIf your machine is already set up to develop Rails applications with MySQL just\ncarry out the following steps and you should be good to go.\n\nDeveloping with [Vagrant](https://www.vagrantup.com/) is also possible (see below) but was\nmainly useful with the retired PHP application. A new Vagrant setup can be found in the\n[OpenAustralia/Infrastructure](https://github.com/openaustralia/infrastructure#provisioning-local-development-servers-using-vagrant)\nrepository, however this is primarily intended as a \"production-like\" test environment\nrather than providing a development environment.\n\nBefore beginning, install MySQL, HTMLTidy and Ruby:\n\n```\n# OS X ...\nbrew install tidy-html5 mysql rbenv ruby-build\nrbenv install $(cat .ruby-version)\n\n# ... or Linux (Debian)\nsudo apt-get install tidy mysql-server mysql-client libmysqlclient-dev\n# then follow: https://github.com/sstephenson/rbenv#basic-github-checkout to get rbenv and ruby-build\n```\n\nSteps required to configure, install and start the Rails application:\n\n```\n# Install bundle\nbundle install\n\n# Install mailcatcher\ngem install mailcatcher\n\n# Copy the default config files over.\ncp config/database.yml.example config/database.yml\n\n# (Edit config/database.yml and fill in your username, password and database settings.)\nbundle exec rake application:config:dev\n\n# Set up your database (including seed data)\nbundle exec rake db:setup\n\n# Run tests\nbundle exec rake\n\n# Start the server\nbundle exec rails server\n```\n\n### With Vagrant\n\nOnce you have [vagrant][1] and [virtualbox][2] installed and have cloned this\nrepository run `vagrant up`. This will download the base virtualbox image\nand set up the development environment, be prepared for a bit of a wait.\n\nRun the tests from inside the VM like this:\n\n* `vagrant ssh`\n* `cd /vagrant`\n* `bundle exec rake`\n\nAssuming they pass, you can start the rails server:\n\n* `bundle exec rails server`\n\nOnce it is up you can browse to http://localhost:3000\n\nWhen manually testing the site, the \"sign up\" confirmation emails will\nautomatically go to a dummy smtp server called [mailcatcher][3]. To check the\nemails, browse to http://localhost:1080\n\nIf vagrant reports that it can't mount the `/vagrant` virtualbox shared folder,\nit's becuase the VM has had it's kernel updated. Run\n`vagrant provision \u0026\u0026 vagrant reload` and you should be back in business.\n\nThe original PHP app is also available at http://localhost:8080 but only if\nyou're running an older branch (out of scope for this guide).\n\n[1]: http://www.vagrantup.com/\n[2]: https://www.virtualbox.org/\n[3]: http://mailcatcher.me/\n\n## Loading data\n\n### Australia\n\nThese rake tasks are the ones you're most likely to need to run. You\ncan run them as the `deploy` user in `/srv/www/production/current`, for instance:\n\n```\ndeploy@ip-172-31-37-36:/srv/www/production/current$ RAILS_ENV=production bundle exec rake application:load:divisions[2018-10-18]\n```\n\n* `application:load:members` loads members, offices and electorates. You always\nneed this to run the site. Strictly speaking it only needs to run when details\nneed updating but can be run as often as you like as it only updates data.\n* `application:load:divisions[from_date,to_date]` load division[s]. `to_date` is\noptional and if omitted, allows you to load a single date.\n* `application:cache` this namespace contains cache updating tasks that are\nnecessary for the site to run. They should be self-explanatory.\n\nDaily updates are carried out by the `application:load:daily` Rake task,\nwhich is run daily at 09:15 by cron.\n\n### Popolo\n\nCountries that use [Popolo](http://www.popoloproject.com/), e.g. Ukraine, only need to know about the `application:load:popolo` Rake task. It will load people or country data, depending on what it finds in the file.\n\n## Search\n\nSearch requires [elasticsearch](https://www.elasticsearch.org/). You will need to [download](http://www.elasticsearch.org/download)\nthe `.deb` for Linux or on Mac run `brew install elasticsearch`.\n\nAdd data to your index the first time with `bundle exec rake searchkick:reindex:all` and\n[Searchkick](https://github.com/ankane/searchkick) should take care of updates from there.\n\n## Production\n\n### Extra Requirements\n\n* Memcached\n\n### Australia\n\n#### Deployment\n\nThe code is deployed using Capistrano. To deploy to production run:\n\n    bundle exec cap production deploy\n\n### Ukraine\n\n#### Server provisioning\n\nUkraine's server has its configuration management in [another repository](https://github.com/OPORA/publicwhip_server/). Once you've run the server provisioning tasks you can follow the instructions below to deploy the application.\n\n#### Deployment\n\nAfter provisioning your development server, set up and deploy using [Mina](http://mina-deploy.github.io/mina/):\n\n```\nbundle exec mina ukraine_dev setup\nbundle exec mina ukraine_dev deploy\n\n# Now you can load people data\nbundle exec mina ukraine_dev rake[application:load:popolo[https://raw.githubusercontent.com/everypolitician/everypolitician-data/master/data/Ukraine/Verkhovna_Rada/ep-popolo-v1.0.json]]\n\n# And some vote data\nbundle exec mina ukraine_dev rake[application:load:popolo[https://arcane-mountain-8284.herokuapp.com/vote_events/2015-07-14]]\n\n# Setup caches\nbundle exec mina ukraine_dev rake[application:cache:all_except_people_distances]\n\n# Then build the index so search works\nbundle exec mina ukraine_dev rake[searchkick:reindex:all]\n```\n\nTo deploy to the **production** server, replace `ukraine_dev` with `ukraine_production` in the above commands.\n\n## Accessing the admin panel\n\nThe administration panel, which currently doesn't do a whole lot, can be accessed in development at http://localhost:3000/admin/ and in production at https://theyvoteforyou.org.au/admin. You must be an admin to be able to access that page. Any user that is an admin can make another user and admin too using the admin panel. The first admin user must be created via the rails console:\n```\ndeploy@hostname:/srv/www/production/current$ RAILS_ENV=production bundle exec rails c\nLoading production environment (Rails 8.0.2)\n3.4.4 :001 \u003e  User.find_by(email: \"matthew@oaf.org.au\")\n =\u003e #\u003cUser id: 13792, created_at: \"2021-05-03 10:26:02.000000000 +1000\", updated_at: \"2025-05-09 10:21:17.000000000 +1000\", api_key: \"NNabCaw2gQ/Wla4mVeR8\", admin: true, staff: true, name: \"matthew\", email: \"matthew@oaf.org.au\"\u003e\n3.4.4 :002 \u003e$ bundle exec rails c\nirb\u003e User.find_by(email: \"matthew@oaf.org.au\").update(admin: true)\n```\n\nObviously substitute the email address in the command above.\n\n## Feature flags\n\nSome features that are still in development are enabled via \"feature flags\". The features can optionally switched on for certain users, block of users or everyone. These flags are administered at https://theyvoteforyou.org.au/admin/flipper/features in production or http://localhost:3000/admin/flipper/features when in development.\n\nThe names of the features added in the admin panel need to match those in the code at `config/initializers/flipper.rb`.\n\nTo enable a feature for a particular user: Go to the feature on the flipper admin panel. Then click the button \"Add an actor\". Then add the `flipper_id` which for a user will be of the form `User;\u003cuser id\u003e`. So for example it could be `User;3`.\n\n## Other Credits\n\nThis project uses some icons from the noun project under under creative commons licenses:\n\n* Check icon by useiconic.com from The Noun Project\nhttp://thenounproject.com/term/check/45904/\n* Delete icon by useiconic.com from The Noun Project\nhttp://thenounproject.com/term/delete/45301/\n* Speech Icon by Lissette Arias from the Noun Project\nhttp://thenounproject.com/term/lecturer/8076/\n* User Icon by Universal Icons from the Noun Project\nhttps://thenounproject.com/icon/user-3692903/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenaustralia%2Ftheyvoteforyou","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenaustralia%2Ftheyvoteforyou","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenaustralia%2Ftheyvoteforyou/lists"}