Skip to content

imartinez/senda

 
 

Repository files navigation

Onodo

Waffle

Stack

  • Ruby 2.4.3
  • Rails 4.2.x
  • Backbone.js 1.2.2
  • D3.js 4.x
  • Handsontable
  • Webpack 2.x
  • PostgreSQL 9.x
  • Imagemagick 6.x

Development environment

Postgres is used for the database. We use the hstore datatypes, so 9.0 is required. If developing natively in OS X Postgres.app is the easiest way to get Postgres up and running, but by using the provided Docker configuration it can be conveniently ignored.

To install and run locally without Docker, once you've got a copy of the code from the GitHub repository, install the dependencies:

$ bundle install
$ npm install

Set up the database:

$ bundle exec rake db:create db:migrate db:seed

And then run the application:

$ bundle exec foreman start -f Procfile.dev

If using Docker, make sure to build the image first:

$ docker-compose build

Then set up the database:

$ docker-compose run --rm onodo bundle exec rake db:create db:migrate db:seed

And finally start the application:

$ docker-compose up

To access the running application go to your browser and visit https://localhost:3000.

In development mode, any changes made in the source code (except for initializers and some other init stuff) will be automatically reloaded by Rails.

If you're using Docker and you fancy opening a shell into the running container to execute anything locally, you can do it by issuing:

$ docker compose exec onodo bash

Deploy to Heroku

Follow the docs to the heroku container:release web step. It will create the app in Heroku and release the frontend.

Access your Heroku project dashboard. Configure env vars:

LISTEN_ON  0.0.0.0:8000
WORKER_PROCESSES  1 (or more, thats your call)
SECRET_KEY_BASE  <whatever_secret_you_decide>

Next, since Heroku doesn’t assume our application type (since it’s just a Docker image), we need to setup a postgres database manually using:

$ heroku addons:create heroku-postgresql:hobby-dev

And prepare the database

$ heroku run rake db:create db:migrate db:seed

Restart the app

$ heroku restart

And open it

$ heroku open

If it is not working, have a look at the logs

$ heroku logs --tail

For more info medium link.

Network analysis installation

The network analysis is done by a separate module, implemented in Python using the igraph library. If you're developing natively, make sure you have Python installed, and add the bindings to igraph:

$ pip install python-igraph

If you're developing using the provided provided Docker configuration everithing is already set up for you.

Note: there are Ruby bindings for igraph, but they haven't been updated in years.

Purge & update DB with seed file

Use the following instruction to reset the database if developing natively:

$ bundle exec rake db:purge db:create db:migrate db:seed

Or this one if using Docker:

$ docker compose run --rm onodo bundle exec rake db:purge db:create db:migrate db:seed

About

Network analysis for everyone

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CSS 28.5%
  • Ruby 24.0%
  • HTML 23.4%
  • CoffeeScript 21.9%
  • JavaScript 1.4%
  • Python 0.6%
  • Dockerfile 0.2%