After installing a stable version of Node.js (so far tested against Node.js v6 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.
Run the server:
For a different port, pass
make web PORT=8888
Set up a <rahvaalgatus.test> domain.
While Rahvaalgatus works fine when accessed via http://localhost, its email confirmation and notification emails 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
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 server 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)|
To test signing in or signing initiatives with Smart-Id, use the following test personal id:
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.