After installing a stable version of Node.js (so far tested against Node.js v14 and NPM v2), follow these steps:
npm install cd app && npm install
Ensure NPM uses the included
npm-shrinkwrap.jsonfile to get the exact same versions Rahvaalgatus was developed with.
Note that you also need to have
jqv1.6 or later installed as compiling some of the assets depend on Jq scripts.
Initialize the database:
Note that for generating the initial SQLite database via Make, you need to have the SQLite command line application available. Try installing it either via your package manager or from SQLite's home page. Ensure it's at least version 3.24. Alternatively you can initialize the SQLite database with
config/database.sqlvia some other means. The
sqlite3executable isn't required during runtime.
Run the server:
For a different port, pass
make web PORT=8888
Set up the <rahvaalgatus.test> domains.
While Rahvaalgatus home page works fine when accessed via http://localhost, its parliament and local government sites link to specific subdomains. Email confirmation and notification emails also use the host from
config/development.jsonfor the development environment). To be able to click on links in emails during development, update the configuration to use or set up your preferred domain.
To use <rahvaalgatus.test>, add it to your
127.0.0.1 rahvaalgatus.test 127.0.0.1 riigikogu.rahvaalgatus.test 127.0.0.1 kohalik.rahvaalgatus.test
Open your local domain (e.g. http://rahvaalgatus.test:3000) in your browser and proceed with typing code.
Environment specific configuration for the server is in
config/$ENV.js. To run it in the production environment, for example, pass
ENV to Make:
make web ENV=production
To test signing in or signing initiatives with Mobile-Id, use one of the Mobile-Id test phone numbers:
|+37200000766||60001019906||Mary Änn O’Connež-Šuslik Testnumber|
|+37200000566||60001018800||Mary Änn O’Connež-Šuslik Testnumber (PNOEE-certificate)|
For more info and test numbers, see the SK ID Solutions wiki.
To test signing in or signing initiatives with Smart-Id, use the following test personal id:
|30303039914||Qualified Ok1 Testnumber|
|30303039903||Qualified Ok Testnumber|
|30303039816||Multiple Ok Testnumber|
For more test ids, see the Smart-Id documentation wiki.
Run them with Make:
To run a specific test, use the
$TEST environment variable when invoking Make:
make test TEST=./test/bin/web_test.js
To have the tests run automatically as you change files, use
An example of getting the number of signatures on an initiative:
curl https://rahvaalgatus.ee/initiatives/92cc16ee-107e-4208-b92c-2ffed24d4f4b -H "Accept:application/vnd.rahvaalgatus.initiative+json; v=1"
See the full API documentation on SwaggerHub or in a machine-readable OpenAPI v3 format from the
openapi.yaml file from this repository. There are a few examples of use in Estonian also on https://rahvaalgatus.ee/api.
We're open to adding more structured data to the public API, so feel free to create an issue on GitHub if you find something's missing.
Rahvaalgatus is released under the GNU Affero General Public License, which in summary means:
- You can use this program for no cost.
- You can use this program for both personal and commercial reasons.
- You have to share the source code when you run it online.
- You have to share modifications (e.g bug-fixes) you've made to this program.
For more details, see the
If you find Rahvaalgatus needs improving, please don't hesitate to create an issue on GitHub.