Skip to content

jfly/worldcubeassociation.org

 
 

Repository files navigation

worldcubeassociation.org Build Status Coverage Status

This repository contains all of the code that runs on worldcubeassociation.org.

Setup

  • Clone this repo! (And navigate into it)
    git clone https://github.com/thewca/worldcubeassociation.org
    cd worldcubeassociation.org
    
  • Ensure you have the correct Ruby version installed. We recommend using a Ruby version manager like rvm or rbenv. They should both read the .ruby-version file to use the correct version (rvm current or rbenv version to confirm).
  • Ensure Bundler 2 is installed
    • To update from bundler 1:
      gem update --system
      bundle update --bundler
      
    • Or, if you haven't installed bundler previously:
      gem update --system
      gem install bundler
      
  • Set up git pre-commit hook. Optional, but very useful.
    (cd WcaOnRails; bundle install && bin/yarn && bundle exec overcommit --install)
    If some changes are made to this hook, you will have to update it running this command from the repository's root directory: BUNDLE_GEMFILE=WcaOnRails/Gemfile bundle exec overcommit --sign.

Run directly with Ruby (lightweight, but only runs the Rails portions of the site)

  • Install MySQL 8.0, and set it up with a user with username "root" with an empty password. If it poses problems, try the following:
    # Run MySQL CLI as administrator and set an empty password for the root user:
    sudo mysql -u root
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
  • Install dependencies and load development database.
    1. cd WcaOnRails/
    2. Install yarn if you hadn't
    3. bundle install && bin/yarn
    4. bin/rake db:load:development - Download and import the developer's database export.
    5. bin/rails server - Run rails. The server will be accessible at localhost:3000
  • Run tests. Setup instructions follow before_script in .travis.yml.
    1. RAILS_ENV=test bin/rake db:reset - Set up test database.
    2. RAILS_ENV=test bin/rake assets:precompile - Compile some assets needed for tests to run.
    3. bin/rspec - Run tests.
  • Mailcatcher is a good tool for catching emails in development.

Run in Vagrant (gets everything working, but is very slow, recommended only if you need to run the PHP portions of the website)

Production

See Spinning up a new server and Merging and deploying.

About

All of the code that runs on worldcubeassociation.org

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 57.0%
  • HTML 16.9%
  • PHP 14.1%
  • JavaScript 7.2%
  • CSS 3.4%
  • Shell 1.4%