comparative / cap

Research and analysis tool for for archived sources of policy data.
http://www.comparativeagendas.net
1 stars 2 forks source link

Comparative Agendas

Comparative Agendas is an online research and analysis tool for for archived sources of policy data.

http://www.comparativeagendas.net

Getting Started

(Example commands assume root user on Ubuntu 18.04 LTS)

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'

apt-get update

apt-get upgrade

apt-get install postgresql-9.4

sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" /etc/postgresql/9.4/main/postgresql.conf

echo 'host all all 0.0.0.0/0 trust' >> /etc/postgresql/9.4/main/pg_hba.conf

wget -qO- https://get.docker.com/ | sh

mkdir /var/www

cd /var/www

git clone https://github.com/comparative/cap

cd /var/www/cap

docker build -t cap:web .

nano /var/www/cap/env.list

service postgresql start

docker run --add-host=mypostgres:0.0.0.0 --env-file ./env.list --name="web" -d -p 80:80 -v /var/www/cap:/var/www/cap cap:web

docker exec -it web bash

cd /var/www/cap

python

>>> from app import db

>>> db.create_all()

>>> exit()

psql -U postgres -d cap -c "INSERT INTO \"user\" (email, password) VALUES ('admin','admin')"

Deployment

For production you may need to run your own Highcharts Export Server.

These are the instructions:

http://www.highcharts.com/docs/export-module/setting-up-the-server

... but you don't need to follow them because this repo contains a Docker image:

cd /var/www/cap/highcharts-export

docker build -t cap:export .

docker run --name="export" -d -p 8080:8080 cap:export

Built With

Acknowledgments

This software project was made possible by the following groups and institutions: