Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
app
 
 
bin
 
 
 
 
 
 
db
 
 
lib
 
 
log
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Omni Dash

Build Status Code Climate

A one-stop shop for all information, news, and courses for your event. Originally created for the Hatch London event.

Getting up and running

Prerequisites

  • Ruby 2.3 or later (Matt is developing using 2.4.1)
  • Yarn or NPM (yarn is recommended)
  • PostgreSQL server, either local or otherwise (MacOS users use https://postgresapp.com/)
  • Redis server (required from 3b90062 onwards)

Some gems you'll need beforehand:

  • foreman (for running webpack + rails + livereload)
  • bundler (for grabbing project dependencies)
  • guard (for running livereload)

Install gems and javascript dependencies

NOTE

If you're using MacOS with Postgres.app, you need to configure bundler like so:

$ bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config

Get Rails + dependencies (you can run bundle install instead, but this keeps your local files nice and tidy):

$ bundle install --path=vendor/bundle

Install node dependencies. Use the --pure-lockfile option to ensure dependencies are exactly the same as the ones found in yarn.lock (recommended):

$ yarn --pure-lockfile

Setup the database

Copy the .env.example file to .env and edit with your favourite editor:

$ cp .env{.example,}
$ nano .env

RAILS_DB_HOST=localhost
RAILS_DB_PORT=5432
RAILS_DB_USER=postgres
RAILS_DB_PASS=
RAILS_ADMIN_USER_EMAIL=admin@example.com
RAILS_ADMIN_USER_FIRSTNAME=Admin
RAILS_ADMIN_USER_LASTNAME=User
RAILS_ADMIN_USER_PASS=password
  • RAILS_DB_HOST - Leave as localhost if you're running locally.
  • RAILS_DB_PORT - Leave this unchanged unless you changed the port.
  • RAILS_DB_USER - Username for the database. It's normally postgres.
  • RAILS_DB_PASS - Password for the database user, if it exists.
  • RAILS_ADMIN_USER_EMAIL - Email address for admin account
  • RAILS_ADMIN_USER_FIRSTNAME - First name of the admin account
  • RAILS_ADMIN_USER_LASTNAME - Last name of the admin account
  • RAILS_ADMIN_USER_PASS - Password of the admin account
  • RAILS_MAILER_FROM - "From" address for emails. Ignore for dev environment

We recommend leaving the RAILS_ADMIN_USER settings as the default values when developing. Never set the real password in your env file. You'll see why shortly.

Create the development and test databases, and migrate the tables.

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

Create the admin user, using the real password instead of <password> here.

$ RAILS_ADMIN_USER_PASS=<password> bundle exec rake db:seed

Run in development mode

Start the fans!

$ foreman start -f Procfile.dev

Now visit http://localhost:3000 to see the app!

Email tester

Install the mailcatcher gem as described on the project website

Then run the gem to start the mailserver and open the web interface to intercept app emails.

Testing

Rails tests are run with rspec:

$ bundle exec rspec

React app testing doesn't yet exist, but will almost certainly use jest like so:

$ yarn run test