Skip to content

Montaserz/brickhack.io

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brickhack.io

Build Status View Performance Data on Skylight Code Climate Test Coverage security

The public facing site for BrickHack.

  • Hacker applications: Users sign up/in using MyMLH, which includes standard hackathon application info. This pre-fills the BrickHack application, so hackers don't have to duplicate information.
  • Acceptance, RSVPs: Manage applications & coordinate acceptance/waitlist/denials.
  • Bus Lists: Coordinate bus sign-ups during the RSVP process while communicating important information to riders & captains.
  • Email communication: Ensure hackers get consistent, timely information throughout their application process, while enabling the organizing team to communicate important information at any time.
  • Statistics & Visualization: Surface key information about the application base, distribution of applicants, progress towards attendance, etc.

Getting Started

Code environment

Ensure you have Git set up and SSH access to GitHub. If you have Git but not SSH, you can clone using the HTTPS url, however you'll have to type in your GitHub credentials every time.

$ git clone git@github.com:codeRIT/brickhack.io.git
$ cd brickhack.io

You should then be able to open the code in your editor of choice.

Spin up the services locally

  1. Download & install Docker
  2. Open/start Docker
  3. Once docker is started, build & bring up the website:
docker-compose up --build
  1. In a new terminal window, setup the database:
docker-compose run web rails db:setup
  1. You should now be able to access the website at http://localhost:3000 Windows users: be sure to accept the security pop-ups - they might be hidden! The website will not start until you accept them.

Running tests

Most core functionality is provided by hackathon_manager, leaving this repo solely to surface the homepage (and any other pages). The main goal with this is to make sure every page loads successfully - there isn't too much else to test.

  1. Copy the sample environment variables (cp .env.sample .env)
  2. Run the test suite using Docker:
docker-compose run web rails test

Authentication & Admin Testing

You'll want to make an account & promote yourself to an admin in order to access the entire website.

  1. Visit http://localhost:3000/users/sign_up
  2. Sign up for a regular account
  3. Promote yourself to an admin:
docker-compose run web rails c
# Wait for the console to start...
Loading development environment (Rails 5.1.1)
irb(main):001:0> User.last.update_attribute(:admin, true)
  1. You should now be able to access /manage (with docker-compose up still running)

MyMLH Authentication

Login is optionally available through MyMLH. To use MyMLH locally, you'll need to create a local account & add test MyMLH credentials.

  1. Copy the sample environment variables (cp .env.sample .env)
  2. Replace the values in .env with our test MyMLH credentials. Contact a contributor to obtain these, or create your own app.
  3. Start up the local server (docker-compose up or docker-compose restart web)
  4. Visit /manage and sign in with MyMLH. You'll be asked to sign in to MyMLH and authorize the applicaiton. Upon doing so, you'll be redirected back to your local server.
  5. Repeat steps 3 & 4 from above.

Development Utilities

  • Mail View - Email templates can be previewed at http://localhost:3000/rails/mailers
  • Mail Catcher - When active, emails will be captured by MailCatcher instead of slipping into a black hole (no emails are ever sent in development). Visit mailcatcher.me and follow instructions under "How" to get setup.
  • Guard - Automatically runs tests based on the files you edit. docker-compose run bundle exec guard
  • Coverage - Test coverage can be manually generated via the docker-compose run web rails coverage:run command. Results are then made available in the coverage/ directory.
  • Sidekiq - Run background jobs (such as emails) and view active & completed jobs. Sidekiq is automatically started with Docker - a dashboard is available at http://localhost:3000/sidekiq (also available in production).

Browser Testing

Thanks to BrowserStack's open source program, we have access to cross-browser testing! We test for cross-browser compatibility with BrowserStack's Live product. Talk to a maintainer to gain access to our account.

BrowserStack Logo

Docker Tooling

  • If you need to restart the Rails server:
docker-compose restart web
  • If you need to restart Sidekiq, the background job worker that handles emails:
docker-compose restart sidekiq
  • If you need to make changes to the Gemfile:
# 1. Make your changes to Gemfile
# 2. Run a `bundle install` to update the Gemfile.lock
docker-compose run web bundle install
# 3. Update the "web" and "sidekiq" docker images
docker-compose build web sidekiq
# 4. Start the new containers.
#    If `docker-compose up` isn't already running, exclude "-d"
docker-compose up -d web sidekiq
  • If you make a change to the Gemfile, such as for installing a new gem:
docker-compose run web bundle install
docker-compose restart web
  • If you're working on the hackathon_manager locally:
# hackathon_manager should be cloned to the same folder above brickhack.io
git clone git@github.com:codeRIT/hackathon_manager.git ../hackathon_manager
# Start up services with the development config
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
  • If you need to update a gem, such as hackathon_manager:
# replace hackathon_manager with the gem's name
docker-compose run web bundle update hackathon_manager
docker-compose restart web

You can follow the same format for db and redis, though you shouldn't ever need to restart those.

Development & Deployment

All development work should be done locally in a new branch and/or fork. Then, make a pull request to have the code merged into the develop branch. Once the develop branch gets to a good state, it gets merged into the master branch for a production deployment.

Code pushed to any codeRIT/brickhack.io branch will automatically build on Travis CI for tests. Any build on the develop or master branches will also trigger a deploy to our instance(s) of Dokku - staging for develop, production for master. Performance data of the production environment is available on Skylight.

See the Production Environment Setup page for details.

About

The public-facing site for BrickHack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 44.8%
  • HTML 37.7%
  • CSS 12.3%
  • JavaScript 3.2%
  • Shell 1.4%
  • Dockerfile 0.6%