Giter Club home page Giter Club logo

citizenos-api's Introduction

Citizen OS

If you use the Citizen OS open source code, please let us know: [email protected]! <3 We are mostly interested in the usage statistics. Perhaps you can open the stats for us?

Citizen OS is a free participation platform for collaborative text creation, structured discussion and voting. Read about the newest developments on our news page: https://citizenos.com/news/.

🎯 Features

  • Private and public groups and topics
  • e-ID log-in and vote signing
  • Science-led structured argumentation environment
  • vote delegation, minivote, multiple choices votes
  • bottom-up empowerment
  • Independently funded by a sustainable NGO
  • GDPR compliant
  • Multi-platform UI
  • activity feed
  • Community moderation
  • Translated in 14 languages
  • And much more, explore Citizen OS

πŸ’‘ Philosophy

The Citizen OS Foundation is a civic tech non-profit organisation based in Tallinn, Estonia.

Our mission is β€œto empower as many people as possible to participate in respectful, meaningful discussions in order to collaboratively decide on issues that affect their wellbeing."

The main focus of the Citizen OS Foundation is our collaborative decision-making platform for civic initiatives, which is provided free of charge to anyone who wants to use it. The online platform allows for deliberative discussions, collaborative decision-making and voting in situations where it is either impossible or inconvenient for participants to be in the same room.

In Estonia, where a national e-ID system is in place, the Citizen OS platform is also used in situations when a large number of people need to digitally sign a single document, such as people's initiatives, petitions, housing associations agreements and NGO general meetings. Documents signed using the Citizen OS platform are accepted by all levels of government, including the Riigikogu (Estonia’s Parliament) and the national Commercial Register.

We listen to our users in issues.

πŸ‘€ Installation

TOC:

πŸ“– Running locally

✏️ Prerequisites

βš™οΈ Installing

  • Get the source - git clone [email protected]:citizenos/citizenos-api.git
  • Go to the source directory - cd citizenos-api
  • Install dependencies - npm install
  • Add to dev.api.citizenos.com to your hosts file - sudo -- sh -c -e "echo '127.0.0.1 dev.api.citizenos.com' >> /etc/hosts"
  • Create the DB:
    sudo su -c "DATABASE_URL=postgres://citizenos:citizenos@localhost:5432/citizenos npm run dbcreate" postgres
    
  • Create DB user:
    • NOTE: DO NOT use this in production, you may want different privileges!
    sudo su -c "psql -c \"CREATE USER citizenos WITH PASSWORD 'citizenos'\"" postgres
    sudo su -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE citizenos TO citizenos\"" postgres
    

βš™οΈ Configuration

We use https://github.com/lorenwest/node-config.

Configuration files are in ./config directory.

Order of applying, further down the list overrides value from the sources above it:

  • default.json - Global configuration that is same for all environments.
  • {process.env.NODE_ENV}.json - Environment specific overrides.
  • local.json - Your local configuration that you create your self. This file is for YOUR SPECIFIC overrides, the file is in .gitignore so you don't accidentally commit it.
  • ENV - configuration values defined in environment variables. What can be overwritten there, can be read from custom-environment-variables.json

Examples of Citizen OS API configuration: https://github.com/citizenos/citizenos-api/wiki/Configuration

⚑ Running

NOTES:

  • When using over HTTPS you need to add ./config/certs/citizenosCARoot.pem to your trusted CA certificate store or browsers will complain.

βŒ› Updating

You need to do the following to update Citizen OS on your server:

πŸ”¬ Testing

  • You need an instance of citizenos-api and etherpad-lite running before you execute tests.
  • npm test

πŸͺ² Debugging

  • By default logs are in ./logs/app.log

⚠️ Issues

FATAL ERROR: Committing semi space failed. Allocation failed - process out of memory

Node.JS runs out of memory. This can be solved by tuning the garbage collection (GC) of Node.JS runtime via V8 options.

  • --max-old-space-size - Max size of the old generation (in Mbytes). By default it's 1.5GB. Set it to amount that is maximum that you want Node.JS process to allocate. Example: node --max-old-space-size=250 ./bin/www

Reading:

Endpoint GET "/api/auth/google/callback" failed miserably. Status: undefined Stack: InternalOAuthError: failed to fetch user profile

Google+ API is not enabled. Enable Google+ API at https://console.developers.google.com/apis/library/plus.googleapis.com by clicking "ENABLE".

πŸ“– Contributing

Pull requests

  • All pull requests to master branch
  • Live site runs on prod branch

DB changes

DB changes require migrations, please read https://github.com/citizenos/citizenos-api/wiki/DB-Migrations

πŸ“– Improvement ideas

  • Support different authentication and signing methods so that anyone could add their country specifics. That takes us to modular architecture where ideally I would like to add new methods by installing a module and configuring it.
  • Implement generic "if this, then that" engine where anyone can plug into Topic state changes with their own custom logic. Right now for example Rahvaalgatus.ee has a flow where a signed document is sent to Parliament via e-mail, but this is very region/partner specific.
  • Email layout designing should be much simpler. Right now there is hard-coded CitizenOS layout and special layout for Rahvaalgatus.ee. We may consider using MailChimp or other services so that there is a separate service where mails are designed and sent and for which each Partner pays themselves.
  • ...

citizenos-api's People

Contributors

tiblu avatar ilmartyrk avatar oksks avatar dependabot[bot] avatar loorm avatar el-tu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.