Skip to content

Rails project for displaying the results of a tournament with images and commentary.

Notifications You must be signed in to change notification settings

gellaho/gellaho_tournament

Repository files navigation

Readme

This project is used to show fans who has won in a fan image contest. Each image faces each other in a tournament, and the website shows the results along with optional commentary.

Setup

Requires ruby, node, yarn (See .tool-versions and package.json for most uptodate versions)

$ gem install bundler
$ bundle
$ yarn

$ createuser gellaho_tournament -P -s

Make the password for this new user gellaho_tournament

$ bundle exec rails db:create
$ bundle exec rails db:migrate

Run

$ bundle exec rails s

Adding a Tournament

Go to localhost:3000/tournaments/new (username and password is "test" by default)

Upload a .zip file containing one .json file of the following format and a bunch of images (A sample can be found at https://gellaho.com/archives/4-tournament-example):

{
  "name": "title of tournament",
  "category": "type of tournament",
  "entrants": [
    {
      "tournament_id": "unique identifier within file",
      "creator": "who made it",
      "name": "title of image",
      "image": "name of image.png"
    },
    ...
  ],
  "commentators": [
    {
      "tournament_id": "",
      "name": "",
      "image": ""
    },
    ...
  ],
  "commentary": [
    {
      "commentator": "",
      "text": ""
     },
     ...
  ],
  "rounds": [
    {
      "name": "",
      "number": null,
      "matches": [
        {
          "entrants": ["", ...]
          "winner": "",
          "commentary": [
            {
              "commentator": "",
              "text": ""
            },
            ...
          ]
        },
        ...
      ]
    },
    ...
  ]
}

All "commentators" and "commentary" fields are optional.

The tournament_ids are used to identify which entrants/commentators are in each match. This is so you don't have to type out the names every single time. These will not be used in the databse anywhere, it's just used for identification in the importer (See app/services/TournamentImporter.rb).

Example Image 1

image

Example Image 2

image

About

Rails project for displaying the results of a tournament with images and commentary.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published