rubymonsters/rgbapp

Name: rgbapp

Owner: Ruby Monsters

Description: This is an app that supports the work of the Rails Girls Berlin organizers team

Created: 2017-01-30 18:21:40.0

Updated: 2018-04-23 18:30:01.0

Pushed: 2018-05-14 19:32:07.0

Homepage:

Size: 692

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Rails Girls Berlin application Build Status

About

This repo is the open source project for the Rails Girls Berlin App that aims to help the Rails Girls Berlin orga team to organize their events by making the attendees, coaches and volunteers applications and/or participation more manageable.

Technical Requirements
How to set up
  1. Clone the repo (git clone <repo-url>)
  2. Change into the project directory (cd rgbapp)
  3. Run bundle install. This can fail for a number of reasons. See below for some troubleshooting.
  4. Run (bundle exec) rake db:create:all. This will create the databases for development and test by default.
  5. Run (bundle exec) rails server. This will start the application in development mode.
  6. Go to http://localhost:3000/ in your browser. You should see a welcome screen saying ?Yay! You're on Rails?
Database
1. Installation

For the production database we use Postgres - make sure it is installed, configured and always running.

Mac

The easiest way is to use Postgres.app. Don't forget to setup the CLI tools.

Linux

In Debian/Ubuntu you'll need the postgresql and libpq-dev packages.

Windows

TODO

2. Migration

List all available rake tasks of this project:

st all rake tasks
undle exec) rake -T

lter rake tasks related to the database
undle exec) rake -T | grep "db"

We already have a database structure file here, just load it into your freshly created development database and migrate to be synced with the current project status:

ads a schema.rb file into the database
undle exec) rake db:schema:load

grate the database
undle exec) rake db:migrate

splay status of migrations
undle exec) rake db:migrate:status

Tip: You may take a look at the short cut $ (bundle exec) rake db:setup in the rake tasks list.

Important: Initial Data

Start up the server, go to http://localhost:3000/sign_up and sign up as a new user. Then log into the rails console and assign yourself as an admin in order to create a new event.

g into the console
undle exec) rails c

st all users
sers = User.all

nd your user account
ser = User.find_by(email: 'your_email@email.de')

sign yourself as an admin
ser.admin = true

eck if your last commmand worked
ser.admin?
 true

Since the database is initially empty, you may encounter an error similar to the one below.

ERROR:

veRecord::RecordNotFound in ApplicationsController#new \
dn't find Event with 'id'=1

Execute following in the rails console:

st all events
vents = Event.all

ent Load (0.7ms)  SELECT "events".* FROM "events"
 #<ActiveRecord::Relation []>

eate your first example event with a bang ("!") that validates your input immediately
vent = Event.create!(name: "RGB Beginners WS 2017", place: "Travis", scheduled_at: "2017-10-31", application_start: "2017-10-02", application_end: "2017-10-20", confirmation_date: "2017-10-25")

 #<Event id: 1, name: "RGB Beginners WS 2017", place: "Travis", scheduled_at: "2017-10-31 00:00:00", created_at: "2017-10-02 00:00:00", updated_at: "2017-10-02 00:00:00", application_start: "2017-10-02 00:00:00", application_end: "2017-10-20 00:00:00", confirmation_date: "2017-10-25 00:00:00">

st all events
vents = Event.all

ent Load (0.4ms)  SELECT "events".* FROM "events"
 #<ActiveRecord::Relation [#<Event id: 1, name: "RGB Beginners WS 2017", place: "Travis", scheduled_at: "2017-10-31 00:00:00", created_at: "2017-10-03 12:55:54", updated_at: "2017-10-03 12:55:54", application_start: "2017-10-02 00:00:00", application_end: "2017-10-20 00:00:00", confirmation_date: "2017-10-25 00:00:00">]>

Now start up the server with $ (bundle exec) rails s again and go to: http://localhost:3000/events/1/applications/new

The current production URL start page can be found here (this may change in the future): http://radiant-bastion-50958.herokuapp.com/events/1/applications/new

Attention: You would need access to the production database and heroku app for production deployment. Ask the maintainers of this repository for the credentials.

Good to know

Shell prompt

Dependent on your shell the prompt symbol may be different than $, e.g. % (bundle exec) rake -T.

Specifying environment

When not specifying any environment (e.g. RAILS_ENV=development), then you will execute all your commands in development mode by default.

Server restart

If you don't see any changes, e.g. after a migration, consider to restart the server and check again.

Troubleshooting

Cloning the repo fails with some message about SSH keys

Use the https url instead. There is a link to get it under the GitHub ?clone or download? menu.

Installing gem pg fails

TODO

Running rake

You may see following error sometimes:

:LoadError: You have already activated rb-readline 0.5.5, but your Gemfile requires rb-readline 0.5.4. Prepending `bundle exec` to your command may solve this.`.

If this is the case try $ bundle update and then run $ bundle exec rake -T instead of rake -T.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.