Rahvaalgatus is dependent on CitizenOS's backend. While open sourced late March 2018, the full backend may be too much to run locally for development. Fortunately they provide an online test environment to develop against. Its tokens are embedded in Rahvaalgatus' source code, so no configuration necessary.
After installing a stable version of Node.js (so far tested against Node.js v4 and NPM v2), follow these steps:
npm install cd app && npm install
Run the server:
For a different port, pass
make server PORT=8888
Set up a <rahvaalgatus.test> domain.
CitizenOS's authentication and editor servers reply to cross-origin requests only if they come from
rahvalgatus.test. Add such a subdomain to your
/etc/hostsfile for development:
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 sign in during development, use one of the Mobile-Id test phone numbers:
See more at http://www.id.ee/?lang=en&id=36381.
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
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.