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.
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
$ bundle exec rails s
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_id
s 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
).