bsmithgall / elswisser Goto Github PK
View Code? Open in Web Editor NEWChess tournament and pairing management, written in Phoenix/Elixir
Chess tournament and pairing management, written in Phoenix/Elixir
Right now everything only works because we have an even number of players going into the pairings. We need to allow for byes given that there are odd numbers of players.
Could have some fun statistics about various tournaments:
Let's improve it.
With a double elimination tournament, it would be good to have a view of all games that are currently playable regardless of rounds in the pair-card format.
Should include:
There's some information about how to do this in here.
Might be good to try and get the basic tests working again and hook in CI, though that could be another issue.
We want people to be able to drop out of the tournament mid-go and have things function normally for pairings, etc.
Need to figure out a good UI for that, maybe the table can expand and fill in a live view with detailed player stats plus some form fields?
Should both live inside of a "Rounds" context.
Rounds schema:
Games schema
Probably on the pibernetes, hopefully the tailscale operator is working well enough to get it exposed to the internet.
Especially in a DE tournament, it would be nice to know what matches correspond to what rounds, and then have it link out as well.
Would be nice to have a big listing page of all the games that happened in the tournament.
Inside of the rounds context there should be a "pairings" page. To start, we should be able to manually manage pairings (e.g. this player with this player) to generate new game records inside the round.
For this to be "done":
tournament/id/rounds/id/pairing
should have a nice little interactive table which shows all the players along with their progress in the tournament.white
in the next round.Need to show tournament results:
To figure out: should results be calculated on the fly? Or stored/cached in the database (perhaps at the end of each round)? Probably easiest to calculate on the fly for now and then cache them later.
Right now we have white_id
and black_id
on the game table, which is miserable. There needs to be a M2M table to connect them in order to do basic stuff.
finished_at
, meaning they show up in a strange place in the player's game historyWe should have a little modal popup from the rounds view that shows the players tournament histories etc. Should be able to re-use the little boxes from the pairings page.
It shouldn't do that
Right now it's not responsive at all, but it should be since it would be nice to manage this stuff via my phone.
topnav
take a sidenav
as a slot.Elswisser
text at small widths, only show iconNeed this to be able to properly calculate optimal pairings.
For some reason there's a bunch of different game link formats which all end up resolving to the same game ID.
Need to provide basic application layout:
Note that phoenix uses Tailwind as of 1.17, so we'll need to figure out how that is supposed to work as well.
Should be able to slot into the existing data model decently well, though the routes might change a bit.
Edit: this is pretty complicated. Here's a rough checklist of what is needed to get this to work:
type
polymorphism based on a column table, and allowing it to be set when creating a new tournament.Need to be able to:
See section 28J
We need to implement a round progress page which shows all the games in a given round, allows for selection of results, etc. Here's the equivalent coronate page:
Note that both this and the pairings page (#2) are part of the same route in the coronate UI, though I think we should probably use two separate pages for this.
Need to:
All of the ::after
stuff was build around perfect tree single-elimination brackets, there's a bunch of weird stuff around:
Additionally, perhaps the championships stuff should be separate?
Needs side navigation with current tournament name, links to various things, quick information. We can probably again use Coronate as a guide with some improvements.
Instead of tournament ID we should enable navigation by tournament slug. This of course requires us to ensure that tournaments are uniquely named, so we'll need to add a unique name index.
We should be able to do this on live views by sending an update via send/2
and handle_info/2
; there's an example in the PGN live view we can use to base this off of. There's another approach laid out in this blog post as well.
Should help us us down on database requests etc
The built-in seems good enough for now. Best way forward is probably to just lock the write actions behind require_authenticated_user
and call it a day.
This will require some reworking of the internals, but it would be nice to support multi-game matches per round. Right now, the assumption is that you have a single "game" per round (which has a unique link, winner and loser, etc), but it would be cool to support something like "first to 2.5" style scoring.
Probably the way to do this that is lowest lift to what exists now is to do Tournament
-- 1:M --> Round
-- 1:M --> Match
-- 1:M --> Game
.
Then the Tournament
could start taking in some configuration options. This would also be a nice way to jumpstart into support for a round-robin style tournament (everyone plays everyone else).
This is possible to do somehow with Phoenix, would be cool to do.
For the tournament side nav (and just in general), it would be good to figure out a way to get the "status" of a given round. We can probably be pretty naive about this:
NOT_READY
if the prior round is not status COMPLETE
PAIRING
if the prior round is complete but not all players are paired yetPLAYING
if all players are paired, but not all games are completedCOMPLETED
if all games in that round are completedI don't think it makes sense to store this field in the database, but rather to calculate it on the fly. We can calculate it for a single round when we load up an individual round pairing page, and for all rounds in a tournament when we load up the tournament view pages.
Need to:
Tournament.crosstable()
method that calculates out a crosstable. There should be a clever way to do most of this in SQL directly.Need to:
Round.scores()
function which returns out a crosstable of scores. At some point this is going to need to also handle tiebreaking. Here's a screenshot of tiebreak rules suggested by USCF. We can probably punt on implementing these until later, since it seems like it's going to require either some pretty complicated SQL or parsing things in code directly.We'll follow the USCF rules for this as best as we possibly can. Should be doable via a blossom algorithm for graph-based matching.
It would be nice to keep a rating history so we could see how player ratings change over time.
Otherwise stats calculations are incorrect. We should try to backfill games based on the rating changes.
White backgrounds might actually be transparent? In any case whoever has the white pieces make it basically impossible to read.
Maybe dom-to-image
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.