Skip to content

atuljain/rhizome

 
 

Repository files navigation

Set up

Prerequisites

  1. Node >= 0.10.0
  2. VirtualBox

Building technical documentation

  1. cd docs
  2. make clean
  3. make html
  4. Docs files now available here: docs/_build/html

Setting up the development environment

Docker

Prerequisites

  1. VirtualBox

for OSX:

$ brew update
$ brew tap phinze/homebrew-cask
$ brew install brew-cask
$ brew cask install virtualbox

[static-files]: https://docs.djangoproject.com/en/1.7/howto/static-files/)

Install Docker Machine. In Mac OS X you could install via brew

$ brew install docker-machine docker-compose

Initialise Docker environment

$ docker-machine create -d virtualbox dev
$ docker-machine start dev

Add eval "$(docker-machine env dev)" into .bashrc file

In Mac OS X, forward the port to host

$ VBoxManage controlvm dev natpf1 "django,tcp,127.0.0.1,8000,,8000"

Navigate to repository directory, de-comment Line.8 ENV CHINESE_LOCAL_PIP_CONFIG="--index-url http://pypi.douban.com/simple --trusted-host pypi.douban.com" to use Chinese pip mirror.

Run

$ docker-compose build && docker-compose up

Entry Docker instance

$ docker exec -it rhizome_rhizome_1 bash

The app is hosted at http://localhost:8000

Installing frontend dependencies

Note - in order to do development on the front end within docker, you will need to install npm outside over your docker, ( see below ) and run gulp dev in order to for the front end build to watch and build new code.

Go to webapp/ folder

$ npm install -g gulp
$ npm install

Populating Data

Use the following script to pull the production database and sync it with your local

$ ./bin/sync_prod_data.sh

running test

  • backend: $ python manage.py test --settings=rhizome.settings_test

  • frontend: coming soon...

Building the Front End

Go to webapp/ folder

$ gulp dev

Deploying

when spinning up a new ubuntu instance nstall the following dependencies :

$ sudo apt-get update
$ sudo apt-get install apache2 --fix-missing
$ sudo apt-get install unzip --fix-missing
$ sudo apt-get install python-pip --fix-missing
$ sudo apt-get install python-pandas --fix-missing
$ sudo apt-get install python-dev
$ sudo apt-get install libpq-dev
$ sudo apt-get install postgresql-9.3
$ sudo apt-get install python-psycopg2
$ sudo apt-get install libapache2-mod-wsgi
sudo apt-get install apache2 apache2 apache2-mpm-prefork apache2-utils libexpat1 ssl-cert

to set up the db..

$ CREATE USER djangoapp WITH PASSWORD 'somepassword' SUPERUSER LOGIN;

then create the directory for the rhizome django app, and static files

$ sudo mkdir /var/www/apps/
$ sudo mkdir /var/www/apps/rhizome/

Serving the Django Application with Apache.

You'll need to configure Apache and WSGI on whatever server you're deploying to, and set up a PostgreSQL database for the application first. Make sure that Apache is configured to use the prefork MPM; the worker and event MPMs result in incorrect responses returned for requests when multiple requests are made to the server.

For more information on deploying Django applications, see the Django documentation.

You will also want to set up apache to server the files in the /static and /media directories.

Serving Static files

The frontend files can be served statically by any webserver. Make sure that the STATIC_URL setting in the backend's settings.py is set to wherever you deploy the static files. ([Read more about static files in Django.][static-files])

[static-files]: https://docs.djangoproject.com/en/1.7/howto/static-files/)

Gulp tasks

The default task runs clean, copy, sass and browserify, so that if you simply execute

dev

$ gulp dev

from the command line it will build the entire frontend for development.

package

Create dist/rhizome.zip which contains requirements.txt and all files

test slack integration

About

Generic ETL Engine / Visualization Framework for Polio and Beyond!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 56.1%
  • Python 27.9%
  • CSS 13.0%
  • HTML 2.8%
  • Shell 0.2%