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.
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.
- Download & install Docker
- Open/start Docker
- Once docker is started, build & bring up the website:
docker-compose up --build
- In a new terminal window, setup the database:
docker-compose run web rails db:setup
- 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.
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.
- Copy the sample environment variables (
cp .env.sample .env
) - Run the test suite using Docker:
docker-compose run web rails test
You'll want to make an account & promote yourself to an admin in order to access the entire website.
- Visit http://localhost:3000/users/sign_up
- Sign up for a regular account
- 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)
- You should now be able to access
/manage
(withdocker-compose up
still running)
Login is optionally available through MyMLH. To use MyMLH locally, you'll need to create a local account & add test MyMLH credentials.
- Copy the sample environment variables (
cp .env.sample .env
) - Replace the values in
.env
with our test MyMLH credentials. Contact a contributor to obtain these, or create your own app. - Start up the local server (
docker-compose up
ordocker-compose restart web
) - 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. - Repeat steps 3 & 4 from above.
- 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 thecoverage/
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).
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.
- 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.
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.