No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.circleci
app
bin
config
db
docs
lib
log
public
spec
tmp
vendor/assets
.dockerignore
.gitignore
.rspec
.ruby-version
Dockerfile
Dockerfile-dev
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru
dev.env
docker-compose.ci.yml
docker-compose.production.yml
docker-compose.yml
elm-package.json

README.md

Facility Public Portal

Production

Use docker-compose.production.yml as a reference. Create database, index data, and launch the web server.

$ docker-compose -f docker-compose.production.yml run --rm app rails db:create db:schema:load
$ docker-compose -f docker-compose.production.yml run --rm app ./bin/import-dataset ./data/input
$ docker-compose -f docker-compose.production.yml up

Development

  • Install Docker

  • First time

$ docker-compose run --rm app ./bin/setup
$ docker-compose up
  • Initial import data

If you already have a ./data/input directory as described in the importing guide, index it with:

$ docker-compose run --rm app ./bin/import-dataset data/input
  • Upgrade
$ docker-compose run --rm app ./bin/update
$ docker-compose up

Note that you might need to reimport the data depending on the update.

  • Destroy
$ docker-compose run --rm app ./bin/rails db:drop

Or

$ docker-compose down -v

Elm

To compile Elm code, first install Node.js (tested on LTS v4.5.0). This can be done either via Homebrew or by downloading the binaries, extracting them and adding the corresponding entries to your shell's PATH variable.

Then install Elm and this project's dependencies:

$ npm install -g elm@0.17.1
$ elm package install

Once installed, Elm modules will be automatically built and compiler errors will be displayed by the rails development server.

Elasticsearch and PostgreSQL

This project needs Elasticsearch v2.4 and PostgreSQL v9.5. Both are started as docker containers by the docker-compose.

Data from these containers is preserved between restarts. To stop any running instance and delete data volumes, use:

$ docker-compose down -v

To see logs for the running containers use docker-compose logs -f.

As a one-time setup, create the development database and initialize Elasticsearch indices with the following commands:

$ bin/rake db:setup
$ bin/rake elasticsearch:setup

Ruby and Rails

This project uses Ruby v2.3.1. All Ruby dependencies (including Rails 5) can be installed using Bundler:

$ bin/bundle install --path=.bundle

After that, the application can be run in development mode as follows:

$ bin/rails s

I18n support

See this guide

Importing data

See this guide.