Skip to content

rdunlop/unicycling-rulebook

Repository files navigation

Welcome to the Rulebook Application.

<img src=“https://circleci.com/gh/rdunlop/unicycling-rulebook.svg?style=svg” alt=“Circle CI” /> <img src=“https://gemnasium.com/rdunlop/unicycling-rulebook.png” />

Dependencies

This application depends on the following services:

  • Email (required) - Using either an SMTP or AWS SES e-mailer for sending e-mails when action occur

  • Google Analytics (optional) - Report activity for metrics

  • Redis (caching) - If On Mac: ‘brew install redis`

Set the configuration variables (for local work)

echo "RACK_ENV=development" > .env
echo "PORT=9292" >> .env

cp config/eye.yml.template config/secrets.yml.template config/secrets.yml

Open secrets.yml:

  update the mail settings to match your mail settings

  Set the code for creation of new rulebooks

Docker Development Environment

We recommend running development within a docker environment.

Benefits:

  • All daemons, processes are running at all times (easier to develop features)

To do this:

  1. install docker (docs.docker.com/docker-for-mac/install/)

  2. run ‘./docker-setup.sh` to set up some files

  3. install ‘docker `and `docker-compose`.

  4. run ‘docker-compose up`

  5. Create the database schema with ‘docker-compose exec app bundle exec rake db:create db:schema:load`

  6. open www.lvh.me:3000/new

  7. Create a new database ‘docker-compose run app bundle exec rake db:create db:schema:load`

Setup the database

Copy `config/database_template.yml` to `config/database.yml`  and make
  any necessary adjustments for your local environment.

Non-Docker Deveolpment Environment

Set up the local database

cd unicycling-rulebook
bundle
rake db:create
rake db:schema:load

Start the local server

bundle exec unicorn

Browse to http://localhost:9292

Log Rotation settings:

It is assumed that the server is running logrotate. In order to have the production logs backed up in a rotating basis, install the logrotation file ‘server_config/unicorn-unicycling-rulebook-logs` into the `/etc/logrotate.d/` directory.