An analytics tool to visualize and understand how you and your friends interact in your Whatsapp groups.
The following tools are proposed for the different parts.
- Backend: Python with Flask and uWSGI
- Frontend: AngularJS with Highcharts.js for visualization.
- Docker for containerization
- AWS ECS for hosting.
First, clone into repository via
git clone firstname.lastname@example.org:BowTieProject/groupdynamics.git cd groupdynamics
Next, checkout fetch all existing branches and checkout the desired one.
git fetch git checkout <branch-name>
###Backend: Setting up the Virtual Environment
We use virtualenv to isolate the Python distribution and packages from the host's own Python distribution.
Check if there is a venv folder
If there is no virtualenv, do:
if your system has a python2.7 distribution as default:
if your system has any other python distribution as default (and assuming you've installed python 2.7):
virtualenv -p /usr/local/bin/python2.7 --no-site-packages venv
Now, activate the virtual environment
install the required packages
pip install -r requirements.txt
and to run the app
###Frontend: Setting up the Yeoman Toolset
To install Node, it is highly recommended that you use nvm. Follow the instructions in https://github.com/creationix/nvm to install it in your computer. Basically you just need to run:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
Once you've installed nvm, you need to install the proper Node version:
nvm install v0.12
Now use that version:
nvm use v0.12
Ok, install the required libraries using npm:
npm install -g grunt-cli bower yo generator-karma generator-angular
we should now install the required dependencies using bower and npm:
npm install bower install
###Frontend: Serving the GUI
You probably want to serve your GUI so you can see changes as you make them. Grunt allows you to serve a live GUI that will update whenever it detects a change in the code:
This, however, will not boot up the backend. If you want to test the entire application do
and then after it is built run the
run_backend.py command as seen above.
GroupStats uses Docker and AWS for it's deployment. The deployment process consists of the following:
- On commit to the master branch, there is a commit-hook that calls Docker Hub to build the image. The steps needed to build the image are explicitly described in the Dockerfile.
- Once the image is built, the admin manually goes to AWS's EC2 Container Service (ECS) and updates the service, pulling the latest Docker image (This piece could, and should, automated in the future deploying every time the docker image has been updated).