HowTheyVote.eu
HowTheyVote.eu allows anyone to easily find out how Members of the European Parliament vote in plenary.
Although the results of roll-call votes are generally available on the website of the European Parliament, it is rather difficult to find out what MEPs voted on or how a particular vote turned out. This is because the necessary information has to be gathered from various websites of the Parliament. HowTheyVote.eu automatically scrapes information from multiple official sources and presents them in a simple UI.
Development Setup
We use Docker for our development setup. This setup is intended for development purposes only!
- Make sure ports 3306, 5000 and 8000 are free.
- Install
dockeranddocker-compose. You can find instruction on how to install Docker on the Docker website. - Run
docker-compose run app composer installto install PHP dependencies. - Run
docker-compose run app npm installto install Node.js dependencies. - Run
docker-compose run app npm run devto build the frontend assets. Alternatively, you can rundocker-compose run app npm run watch, to rebuild the assets automatically on file changes. - Run
docker-compose up. - Create
.envfiles based onscrapers/.env.exampleandapp/.env.example. Afterwards, runphp artisan key:generateinside theappcontainer. - When creating a fresh development environment with a clean DB, execute
php artisan migrate,php artisan db:seed --class=GroupSeeder, andphp artisan db:seed --class=TermSeederinside theappcontainer (e.g. withdocker-compose exec). Alternatively, you can also import e.g. the HowTheyVote.eu database dump that can be found here. Runmariadb/import_database.shto import a database and change the.sqlfile's path inside of the script if necessary. - Run
php artisan scout:import '\App\VotingList'to initialize the search index.
Database Dumps
We provide a (small) dump in the mariadb/dump directory that can be imported using mariadb/dump/import_database.sh.
The latest production database can be retrieved from our data repository.
If you have scraped data the mariadb/dump/export_database.sh script can be used to create a new dump.
To familiarize yourself with the schema of the database, the models in app/app/*.php are a good starting point.
FAQ/Help
- To run the tests for the Laravel application, run
composer test. Do not runphp artisan test, as that will clear your local database. - After running the tests you will need to execute
php artisan config:cacheto be able to access the database from your local application instance again. When troubleshooting local problems with accessing the database, this is in general a good first step. - To run the tests for the python scrapers, execute
make test. - Before submitting a PR, remember to run
makeinside of/scrapersandcomposer cs-fix, as well ascomposer testin/app. Non-linted code as well as failing tests will be rejected by our CI.
Production Deployment
We’re using Ansible to manage server provisioning and deployment to production environments. Currently, the Ansible playbook ansible/site.yml supports deploying EP-Votes to a fresh Uberspace 7 account.
- Install Ansible 2.10 or later. Update
ansible/hostsand the respective host variables. - Run
ansible-playbook -i ansible/hosts --ask-vault-pass ansible/site.ymlto set up the Uberspace and deploy the application. - Run
ansible-playbook -i ansible/hosts --ask-vault-pass ansible/meilisearch.ymlto compile and configure the MeiliSearch search server. This may take some time and it’s not necessary to run this playbook on every deployment.
Related Work
-
Parltrack is an open source project that improves access to information about legislative processes, including (but not limited to) vote results.
-
abgeordnetenwatch.eu is a German NGO that allows citizen to publicly ask questions elected representatives in the federal and state parliaments as well as the European Parliament questions. abgeordnetenwatch.eu also includes voting records for editorially selected votes in the European Parliament. Those are however limited to German MEPs.
-
VoteWatch Europe maintains a database of vote results for the current and many past legislatures. However, not all vote results are publicly accessible.
Licenses
This software is licensed under GPLv3. Data exports accessible via the web interface on <HowTheyVote.eu> and database dumps are made available under the Creative Commons Attribution License 4.0.
The contents of the database are sourced from the plenary minutes of the European Parliament, MEP profiles on the Parliament’s website, and the Legislative Observatory.
We use adapted emojis designed originally by OpenMoji – the open-source emoji and icon project. License: CC BY-SA 4.0
This work is sponsored by the Federal Ministry of Education and Research in the 9th round of the Prototype Fund (Reference: 01IS21818).