Skip to content

jpokeefe/ekklesia-portal

 
 

Repository files navigation

Ekklesia Portal

Portal of the Ekklesia e-democracy platform.

Tech Stack

Development

Quick Start

The shell environment for development can be prepared using the Nix Package Manager. It includes Python 3.7, PostgreSQL 11, development / testing tools and dependencies for the project itself. The following instructions assume that the Nix package manager is already installed, nix-shell is available in PATH and an empty + writable PostgreSQL database can be accessed somehow.

  1. Clone the repository with:
    git clone https://github.com/Piratenpartei/ekklesia-portal
  2. Enter nix shell in the project root folder to open a shell which is your dev environment:
    cd ekklesia-portal
    nix-shell
  3. Compile translations:
    ipython makebabel.ipy compile
  4. Create a config file named config.yml using the config template from src/ekklesia_portal/config.example.yml or skip this to use the default settings from src/ekklesia_portal/default_settings.py. Make sure that the database connection string points to an empty + writable database.
  5. Initialize the dev database with a custom config file:
    python tests/create_test_db.py -c config.yml
  6. The development server can be run with a custom config file by executing:
    python src/ekklesia_portal/runserver.py --debug -c config.yml

Running PostgreSQL as User

You can run a PostgreSQL database server with your user permissions if you don't want to use an existing database server. Run the pg_ctl commands from the nix shell.

Run as user:

pg_ctl -D ~/postgresql init
postgres -D ~/postgresql -k /tmp -h ''

Create database (in another terminal):

createdb -h /tmp ekklesia_portal

You can connect to the database with psql now:

psql -h /tmp ekklesia_portal

The database can be used by ekklesia_portal with the following connection string in the config file:

database:
    uri: "postgresql+psycopg2:///ekklesia_portal?host=/tmp"

Generate CSS

CSS is compiled from Sass files that include files from Bootstrap and Font-Awesome. sassc is used as Sass compiler. The repository includes compiled CSS so you don't have to run the following command if you are not changing the Sass files.

Generate CSS with:

sassc src/ekklesia_portal/sass/portal.sass \
  src/ekklesia_portal/static/css/portal.css

Running Tests

  1. Enter nix shell in the project root folder to open a shell which is your test environment:
    cd ekklesia-portal
    nix-shell
  2. Compile translations:
    ipython makebabel.ipy compile
  3. Create a config file named testconfig.yml using the config template from tests/testconfig.example.yml Make sure that the database connection string points to an empty + writable database.
  4. Initialize the test database:
    python tests/create_test_db.py -c testconfig.yml
  5. The tests can be run with pytest from the repository root directory.

History

Ekklesia Portal started as an improved implementation of Wikiarguments in Python 3.x using the Flask micro web framework. The project is now based on the Morepath web framework and tries to explore ideas from the Ruby project Trailblazer.

License

AGPLv3, see LICENSE

Authors

  • Tobias 'dpausp'
  • Joscha ’GamesGamble’

About

Motion portal for the Ekklesia eDemocracy platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 46.3%
  • Python 21.3%
  • JavaScript 18.9%
  • Nix 9.8%
  • HTML 3.6%
  • Shell 0.1%