Octree |
Contact Us |
Our Blog (FR)
Decidim |
Decidim Docs |
Participatory Governance (META DECIDIM)
Decidim Community (Matrix+Element.io)
Public Participatory Budgeting
This repository create a new participatory component, cloned from participatory budgets. It is done on decidim version 0.24.3 exclusively for now.
Usage
- As a non-connected user, I can insert my personal data, and use it to vote. This data will be checked oveer the official residentship database.
- As a non-connected user, I have a clear view on the vote process. First insert my personal data, then vote, then finalize my vote.
Restrictions
From the original budget component, the following features are not implemented:
- Authorizations: You can not define authorizations for this component (as it authorized only registered user)
- Percentage rules: we improve the flow for
minimu_project
vote flow only. The others rules are un-tested and highly volatile
Warning
This repository was done for the very specific use case of Lausanne City, you probably won't find any usage of this module.
Why
The data-protection law in Switzerland is clear: save the minimal data for a limited amount of time.
As at Lausanne we see PB have somehow lower participation rates, we decide to experiment around public access. We go through a another strategy than Authorization in order to:
- Keep the submissions in the context of a PB
- Be able to remove user data without affecting behaviour
- Having a nicer UX flow as we now know there is a first step process in PB.
Installation
Add this line to your application's Gemfile:
gem "decidim-lausanne-budgets", git: "https://github.com/octree-gva/decidim-lausanne-budgets"
Then execute:
bundle
bundle exec rails decidim_lausanne_budgets:install:migrations
bundle exec rails db:migrate
Testing
The Rakefile is shipped with a
test_app
using docker-compose
to run a database.
If you haven't done it already, install docker](https://docs.docker.com/get-docker/).
bundle exec rake test_app
Local development
For decidim version 0.27, use Gemfile.0.27. For version 0.26, use Gemfile.0.26
cp Gemfile.0.27 Gemfile
First, you need to run an empty database with a decidim dev container which runs nothing.
docker-compose down -v --remove-orphans
docker-compose up -d
Once created, you access the decidim container
# Get the id of the decidim dev container
docker ps --format {{.ID}} --filter=label=org.label-schema.name=decidim
# 841ae977c7da
docker exec -it 841ae977c7da bash
You are now in bash, run manually. This will check your environment and do migrations if needed
bundle exec rake decidim_lausanne_budgets:install:migrations
docker-entrypoint
You are now ready to use your container in the way you want for development:
- Run a rails seed:
bundle exec rails db:seed
- Have live-reload on your assets:
bin/webpack-dev-server
- Execute tasks, like
bundle exec rails g migration AddSomeColumn
- Run the rails server:
bundle exec rails s -b 0.0.0.0
- etc.
To stop everything, uses:
docker-compose down
to stop the containersdocker-compose down -v
to stop the containers and remove all previously saved data.
Debugging
To debug something on the container:
Ensure
decidim-app
is runningdocker ps --all # CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES # 0517244cbdde decidim-module-lausanne_budgets-decidim-app "sleep infinity" 20 hours ago Up 20 hours 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp, 0.0.0.0:3035->3035/tcp, :::3035->3035/tcp decidim-lausanne-budgets-app # 5399fc0c0866 postgres:14-alpine "docker-entrypoint.s…" 20 hours ago Up 20 hours (healthy) 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp decidim-module-lausanne_budgets-pg-1
In another terminal, run
docker exec -it 0517244cbdde bash
Run
tail -f $ROOT/log/development.log
to access logsbundle exec rails restart
to restart rails server AND keeps webpacker runningcd $ROOT
to access thedevelopment_app
cd $ROOT/../decidim_module_lausanne_budgets
to access the module directory
Contributing
This repository is not yet ready for contributions.
License
This engine is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE.