This repository contains all of the code that runs on worldcubeassociation.org.
git clone https://github.com/thewca/worldcubeassociation.org
- Clone this repo! (And navigate into it,cd worldcubeassociation.org
)(cd WcaOnRails; bundle install && bundle exec pre-commit install) && git config pre-commit.ruby "scripts/ruby_in_wca_on_rails.sh"
- Set up git pre-commit hook. Optional, but very useful.
- Set up mysql with a user with username "root" with an empty password.
cd WcaOnRails/
bundle install && bin/yarn
bin/rake db:load:development
- Download and import the developer's database export.bin/rails server
- Run rails. The server will be accessible at localhost:3000
- Run tests. Setup instructions follow
before_script
in.travis.yml
.RAILS_ENV=test bin/rake db:reset
- Set up test database.RAILS_ENV=test bin/rake assets:precompile
- Compile some assets needed for tests to run.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)
- Install Vagrant, which requires VirtualBox.
vagrant up all
- Once the VM finishes initializing (which can take some time), the website will be accessible at http://localhost:2331.- Note: There are some minor issues with development on Windows.
- All emails will be accessible at
http://localhost:2332
. - Please take a look at this wiki page for more detailed informations about the application's internals.