Skip to content

EJ uses gamification and machine learning to promote discussions and participation in a virtual democracy

License

Unknown, GPL-3.0 licenses found

Licenses found

Unknown
LICENSE
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

pencil-labs/ej-server

 
 

Repository files navigation

Environment CI Status Website
Production pipeline status ejplatform.org _
Development pipeline status `dev.ejplatform.org < http://dev.ejplatform .org>`__

EJ Platform

Getting started

Local development (virtualenv)

ej-server REQUIRES Python 3.6 and python-3.6-dev If you are using Ubuntu 14.04 or 16.04, you can use Felix Krull's deadsnakes PPA at https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6-dev

Alternatively, you can use J Fernyhough's PPA at https://launchpad.net/~jonathonf/+archive/ubuntu/python-3.6:

sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6-dev

If you are using Ubuntu 16.10 or 17.04, then Python 3.6 is in the universe repository, so you can just run::

sudo apt-get update
sudo apt-get install python3.6-dev

First install virtualenvwrapper in your machine (sudo apt-get install virtualenvwrapper on Debian based distributions). Clone this repo and create a virtual environment using Python 3.6+:

$ git clone http://github.com/ejplatform/ej-server/
$ mkvirtualenv ej -p /usr/bin/python3.6
(if the command don't run, reload bash or check your system path)

Now, go into the repository and run the configure script:

$ cd ej-server
$ ./configure.sh

Grab a cup of coffee while it downloads and install all dependencies. If everything works, you should be able to run the server using the inv run command.

The script installs the invoke task runner, fetches all dependencies from pip, and initializes the database. If you prefer, you can do all steps manually. The first step is to install the Invoke task runner to run each step of the installation (if you are not familiar to Invoke, think of it as Python's version of Make):

$ pip install invoke

You can install dependencies manually using the files in /etc/requirements/, or simply use the update-deps task. The later is preferable since it installs the volatile dependencies in a special local/vendor/ folder:

$ inv update-deps --all

Invoke allow us to execute a sequence of tasks very easily. The command bellow will run migrations and populate the database with fake data for local development:

$ inv update-deps db db-assets db-fake

This creates a few conversations with comments and votes + several users and a admin:admin <[email protected]> user. Use invoke to start the dev server:

$ inv run

Tests are executed with Pytest:

$ pytest

Using docker

If you want to use docker, just clone the repo and start docker compose:

$ git clone http://github.com/ejplatform/ej-server/
$ sudo docker-compose -f ./docker/develop/start.yml up -d

After the command, ej-server can be accessed at http://localhost:8000.

Tests

There are two ways to locally execute the automated tests using docker-compose:

  • If you already ran sudo docker-compose -f ./docker/local/start.yml up -d and the server is up and running, execute:
sudo docker-compose -f ./docker/local/start.yml exec django pytest
  • If you just want to run the tests without necessarily getting up all the services available on local environment, the configuration file on docker-compose docker/local/test.yml will have only the necessary services to run the tests. To run the tests, execute:
sudo docker-compose -f ./docker/local/test.yml run --rm django

Environment Variables

The env.example file has all the environment variables defined to ej-server.

Additionally, the docker-compose environment variables files are defined on their own directory:

Deployment

An example of deploy in production using docker-compose can be found in docker/production/deploy.example.yml.

Continuous Deployment

Commits at develop branch will release to http://dev.ejplatform.org.

Commits at master branch will release to https://ejplatform.org.

Rocketchat Integration

See the guidelines at docker/extensions.

About

EJ uses gamification and machine learning to promote discussions and participation in a virtual democracy

Resources

License

Unknown, GPL-3.0 licenses found

Licenses found

Unknown
LICENSE
GPL-3.0
COPYING

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 53.4%
  • CSS 21.5%
  • HTML 12.7%
  • Jupyter Notebook 10.9%
  • JavaScript 1.2%
  • Shell 0.3%