Git Product home page Git Product logo

joelgritter / worldcubeassociation.org Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thewca/worldcubeassociation.org

0.0 1.0 0.0 306.13 MB

All of the code that runs on worldcubeassociation.org

Home Page: https://www.worldcubeassociation.org/

License: GNU General Public License v3.0

Ruby 56.47% CSS 1.37% HTML 17.72% PHP 13.04% Shell 1.36% JavaScript 8.13% SCSS 1.90% Dockerfile 0.02%

worldcubeassociation.org's Introduction

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 using Docker (simplest option, but only runs the Rails portions of the site)

  • Install Docker (remember to complete the Linux post-install steps if you're on Linux)
  • Install docker-compose. The best way to get an up-to-date version is to get it from their releases page
  • Navigate into the repository's main directory (worldcubeassociation.org)
  • To start the server at http://localhost:3000, run docker-compose up and to bring it down, docker-compose down (or just press ctrl + c in the same terminal)
  • To run tests, run docker-compose exec wca_on_rails bash -c "RAILS_ENV=test bin/rake db:reset && RAILS_ENV=test bin/rake assets:precompile && bin/rspec"
  • If you're using Visual Studio Code to develop, you can attach it to the Docker container so that your extensions can take advantage of the Ruby environment and so the terminal runs from inside the container

Run directly with Ruby (lightweight, also 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 Node.js and yarn, we need them for our javascript assets. Feel free to take a look at our chef recipe for the accurate versions we use and how we install them. Please note that other versions may work, but it is not guaranteed.
    3. bundle install && bin/yarn
    4. bin/rake db:load:development - Download and import the developer's database export. Depending on your computer it may take a long time. Alternatively you can run bin/rake db:reset which will create the database and seed it with random data (it's way faster, but less representative of our website content).
    5. bin/rails server - Run rails. The server will be accessible at localhost:3000
  • Run tests.
    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.

worldcubeassociation.org's People

Contributors

jfly avatar jonatanklosko avatar thewca-bot avatar viroulep avatar dependabot-preview[bot] avatar pedrosino avatar dependabot-support avatar dependabot[bot] avatar pochmann avatar clementgallet avatar lgarron avatar pingskills avatar jbmertens avatar albertopdrf avatar baiqiang avatar timhabermaas avatar gregorbg avatar coder13 avatar unsolvedcypher avatar jambrose777 avatar tussosedan avatar fatboyxpc avatar ivan-brigidano avatar danielegdal avatar laura-o avatar sauroux avatar ligio90 avatar timreyn avatar campos20 avatar danieljames-dj avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.