Giter VIP home page Giter VIP logo

elovation's Introduction

Elovation

Quality Gate Status

At Braintree, we play ping pong in the office. We wanted a way to track results and assign ratings to players. Elovation was born. It's a simple rails app that tracks the results of any two player game and assigns ratings to the players using the Elo rating system.

This also supports individual player rankings within multi-player teams, using the Trueskill ranking system

Deploy yourself with Fly.io for free

The root of this directory is setup with a Dockerfile ready to deploy to fly.io.

To deploy to fly, you must install a command line tool and sign up using the following instructions

Once you have installed and signed up to fly.io (you can skip the suggested example launcher), you can proceed to generate a fly.toml file for this project to deploy to fly.io

To do this, run fly launch --dockerfile Dockerfile, you will be prompted to generate a new project, with a new name. When prompted to setup a postgres database, select yes. You do not need to setup redis, so skip that step.

It should "just work", if it doesn't, please file an issue.

Game Options

There are two types of "Games" that Elovation allows for: Trueskill & Elo

Trueskill

Trueskill allows for teams of multiple players, to play other teams - yet still calculate each individual player's ranking.

When creating a new game you may set the maximum numbers of teams in a result, and the maximum number of players per team in a result. You can record a result in any combination up to the maximum.

The default is set to 2 players per team, and 2 teams per result (like playing a game of doubles Table Tennis / Foosball). The minimum allowed players per team is 1, and the minimum allowed teams per result is 2.

If you increase the allowed number of teams per result, this will allow scenarios where a team can defeat multiple other teams in a single match at the same time. A possible example of this is a Paint Ball / Nerf War with multiple teams that is "last team standing" - All other teams are the losers and the remaining team is the winner.

Suitable for:

  • Table Tennis
  • Foosball
  • Paint Ball / Nerf Wars

Elo

Elo is a simpler method devised for Player versus player games only and does not support teams. It also increments and decrements by a set value which makes a win/loss amount more predictable.

Suitable for:

  • Chess
  • Table Tennis
  • Foosball

Caution

If you intend to use this software commercially, you must remove the Trueskill implementation as it is patented by Microsoft.

Contributing & Development

Docker

The root directory of this app contains a Dockerfile.dev file, and a docker-compose.yml as helpers to make the development experience easier.

Assuming you have Docker installed, you should be able to run docker compose up from the root directory, and get your dev instance running and accessible from http://localhost:4321

ASDF

The root directory contains a .tool-versions file, this is used by a version management tool called ASDF. If you are running Mac OS, you may find you need to run ASDF to help manage your ruby version if you're trying to run without docker, or you wish to make a custom fly.io deployment.

OS Support

This was developed in a MacOS environment, but it uses Docker to help with cross-platform compatibility.

When developing/deploying from Windows, please use the Windows Subsystem for Linux, or run the Dockerfiles through a line-endings conversion tool. See: #115

elovation's People

Contributors

bdejesus avatar bobo333 avatar christoshrousis avatar dan-manges avatar dbz avatar dragosv avatar drewolson avatar fbernier avatar jacobmovingfwd avatar jtdowney avatar lauranjansen avatar miharekar avatar milnertime avatar phillc avatar shelbyd avatar zombor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elovation's Issues

Player is able to win against themselves

On the results screen.

When a user is selected as the winner.

The dropdown for the lower should not include the winner, to eliminate the chance for the user to select the winner as the loser, which causes an error on result submission

Complete noob, have no idea how to use the app

Hello everyone, im sorry i don't know what I'm doing, but I saw this program and really wanted to use it, after an hour of investigating on how to use github I got lost. I want to use this app, can someone give me an step by step on how to install and use this?
Im using Fedora 39.
Again im sorry, I dont know how to use this Im completely new to this.

No obvious how to set avatar

A lot of people are asking me how to setup an avatar. A note on the profile page and/or user creation page should clear this up.

Docker Support

Hi, any chance of regular installation documentation for a base Linux system? That way we could throw this on Docker Hub too!

Create an organization?

I don't currently have enough time or interest to actively maintain elovation. Is there interest in creating an organization?

I'd be happy to add folks like @phillc to the team if there is interest.

Implement code climate properly

Code climate is a 3.9, which is awesome, but as a low priority there is things to be improved upon while the project is still young to improve future maintainability

  • Sign up to code climate
  • Add code climate badge
  • Investigate code climate coverage
  • Investigate rubocop implementation
  • Address code climate issues where reasonable

Players Listing Flow

Some of the UX flows of the application are a little odd, and may require a rethink.

Specifically, you are able to get a listing of all players that belong to a particular game, but you can reach the full players listing screen from that players_games screen.

If you navigate this way, you can't easily navigate back to the game or games listing screen, it just feels a little odd.

The could be resolved by having some form of primary navigation between the listing screens, two make it easier to navigate from players listing to games listing via main navigation.

Winners need a more effective way to gloat

What do you think about having an "undefeated for N games" feature that would show up beside player names within the game view that have won at least some threshold number of games?

Update Ruby 2.4.0 => 3.1.0 & Rails 5.1 => 7.0.4

Any chance of getting this updated so that it works on the current Heroku runtime? 😄
This is more or less exactly what I am looking for, as we have the exact same scenario in my workplace. However, I am not a developer :/

Any help would be amazing 💯

Progress Charts

Hello,

I do not know any coding at all - only enough to create an account at Herokuapp.com and then port over the information to them - as was stated in the instructions.

My question is about the "progress" chart shown here.

Is there a setting to make this daily, weekly or monthly? The 40 year time limit won't allow the dots to move much.

Many thanks from a non-developer!

Exportable/Importable Standings

Would it be possible to allow admins to import players with their rank into the system? I'm looking to use this for cornhole rankings and I have a previous set of ranks that I would like to keep since it has implications on matching partners in blind draw competition.

In that same vein, would it be possible to include a function that would allow for the export of updated standings in excel? Thanks!

is there an ACL system?

it seems liek everybody can add games and matches, i am sure it would be a mess after a while. It would be nice to have JUST one or two administrators that will do the data entry.

Creating an Elo game is not intuitive

if game.min_number_of_teams != 2 ||

Involving this line of code here; you cannot create a game unless these specific settings are inputted (2 teams and 1 player per team). If the elo option is selected; the game settings should default to this.

Is this expected behaviour or can I fix this

No way to remove a double entry

Would love a way to remove a double entry, remove the RatingHistoryEvent, along with the result, and put the ELO back to the right place.

As a administrator I want to email players thier results so they don't have to access the system

If the person in charge of running elovation is the sole user for an organisation they may need to email out player results.

The solution in my head would be to supply a single email blast button that emails the current game to each player, as well as their current overall standings. As per issue #56 it would be nice if this was supplied in PDF format, although that might add a high level of complexity not required.

  • Choose appropriate free heroku addon for mail sending (sendgrid/mandrill etc)
  • Write specs and appropriate codebase for sending out emails
  • Remember to add to heroku one click deployment

Game and player management

I would like to remove or edit any number of played games. I've had players report incorrect results that I didn't get to in time, and the software doesn't allow me to delete or edit the game outcome.

Issue 2: I'd like to delete a player at his/her request. This isn't possible given how many games they have played. I can only delete if they have played no games or I've deleted their games played, where the game record shows zero.

Issue 3: It would be nice to provide a link to the players that is read only, so they can track/view their own progress. Currently I have to convert the webpage to PDF and distribute the standings.

Thanks.

Deployment Error fly.io

fly.io deployment fails with the following error at the line in dockerfile
RUN SECRET_KEY_BASE=DUMMY ./bin/rails assets:precompile

 => [build 4/6] COPY --link . .                                                                                                                                                                                                                          0.0s 
 => [build 5/6] RUN bundle exec bootsnap precompile app/ lib/                                                                                                                                                                                            0.8s 
 => ERROR [build 6/6] RUN SECRET_KEY_BASE=DUMMY ./bin/rails assets:precompile                                                                                                                                                                            0.3s 
------
 > [build 6/6] RUN SECRET_KEY_BASE=DUMMY ./bin/rails assets:precompile:
#0 0.270 /usr/bin/env: ‘ruby\r’: No such file or directory
#0 0.270 /usr/bin/env: use -[v]S to pass options in shebang lines
------
Error: failed to fetch an image or build from source: error building: failed to solve: executor failed running [/bin/sh -c SECRET_KEY_BASE=DUMMY ./bin/rails assets:precompile]: exit code: 127

I'm not into ruby and just wanted to deploy this out of the box for a friend. Please advise.

As a user I want to add my team name to customise the user experience

It appears one of the most common reasons for forking is to add customised branding. If this was baked into the system in the first place with appropriate documentation then users wouldn't have to fork the repo they could just deploy to heroku.

  • Add environment variable for brand name
  • Replace header "elovation" with brand name for variable
  • Add "powered by elovation" to footer of website
  • Add clear documentation to discourage forking

Time zone support

Ability to choose a timezone as a config variable so that the progress chart is in sync with the local time zone. Looks like its running off of UTC at the moment

Improve static analysis score & update contribution guidelines around standardisation

The codebase wasn't bound by any style guide, on the basis that static analysis and formatting for Ruby was in its infancy when it was first written. Even today, arguments should be maintained that Ruby is an expressive language with the philosophy of productivity, fun and being human., Static analysis is arguably counter to that.

That being said, given that now, the Ruby Style Guide is a mature set of guidelines built on top of many years of experience. And that this project is open source, which can benefit greatly from a set of standardisation, I made a decision to include Rubocop to make the code style familiar and easy to contribute to.

I do not believe that it should be a gate, to stop contributions, but an indicator of potential technical debt. I hope that this will not discourage individuals to contributing to the codebase, as I would gladly accept pull requests which don't meet the standards, and someone else can be responsible for standardising the code after the fact.

Similarly to the above, I have not resolved the current Rubocop violations, and have left them open for anyone to fix as they see fit. Ideally they should be resolved over time, and the project should work towards no violations, but they are not pressing.

Onboarding flow

As an addendum to #62, the admin user experience could be improved by introducing some minor onboarding. flow improvements.

Recently I update the dashboard to include a statement that there are not enough players to start recording matches. This would guide a new admin to introduce at least 2 players before they're able to create games, and they would be less likely to encounter empty game screens (which can imply an incomplete piece of software and reduce confidence in the software).

Minor amendments like this could improve adoption of the software, and a similar improvement could be made to the game screens to improve the user experience overall.

Improve code test coverage in Rspec

Pretty self explanatory. While the Rails 7 rebuild in #108 was sufficiently manually tested, a lot of the unit testing was ignored as it was deemed more important to have a working version of the software to encourage new contributors to return to this project.

Access matches database externally

Hello, is there any way to access and modify the database externally?

I would like to modify the dates for the matches that took place before implementing the system but cannot find anything allowing me to do so, as well as batch edit anything else. May be a simple oversight on my part. Thanks!

db:migrate

Tried to execute heroku run rake db:migrate. Failed with the following

E:\Projects III\Stuff\Public\HEROKU\elovation [master +0 ~1 -0]> heroku run rake db:migrate
Your version of git is 1.8.4.. Which has serious security vulnerabilities.
More information here: https://blog.heroku.com/archives/2014/12/23/update_your_git_clients_on_windows_and_os_x
Running rake db:migrate attached to terminal... up, run.8555
!
! Error connecting to dyno, see https://devcenter.heroku.com/articles/one-off-dynos#timeout-awaiting-process

Emphasize the relevant Head-to-Head records and add recent results for a player

When the player list gets long, it gets harder to see all relevant players in the Head-to-Head list (Select a game -> select a ranked player on the right). This could mean one of several things, including bolding non-zero numbers, greying players who only have zeros, or columnizing the page to make it a little more legible.

Might as well add a second column with the most recent N results for a player.

heroku-postgres's `hobby-dev` plan no longer available

I tried setting up elovation in heroku, but it failed due to hobby-dev plan no longer available in heroku-postgres.

I created a fresh account on December 8th 2022 (I set the necessary payment information for heroku to work) and then I clicked on the button to deploy elovation on heroku. Then, I filled all the necessary information to setup the environment, and received the following error:

Configure environment
There was an issue setting up your app environment.
- invalid app.json
- The heroku-postgresql:hobby-dev plan is no longer available. Choose a different plan. See all available plans in the Elements Marketplace at elements.heroku.com.

So, I propose the following fixes:

  • rewrite the app so that it uses a free addon (I don't know much about Rails development/heroku/... to be more precise, sorry), or
  • rewrite the description in the README so that it no longer says that "Elovation can be run on the free tier, so all you will require is a Heroku account to get started with no running costs."

Rails 4.1

Hey, I've migrated this to Rails 4.1 and Bootstrap 3.2 (https://github.com/mediately/jusk). I can make a PR if you want. I saw @bdejesus already did some design stuff so I can wait till that is PRed and merged and then I can rebase and PR Rails stuff.

Interested?

Default player option leads to mistakes

My co-worker Aaron is finding that people log results against him by mistake because his name is the first on the list. To compensate, he created a new player --- aaa Choose a player aaa ---. Naturally, that new player challenged him in several games shortly after. Change the default to something like "Select a Player".

Docker Compose Issue

Hello I am unable to figure out why my docker-compose up is failing on the Run bundle env.

I am seeing the following error:
'/usr/local/bundle/bin/bundle:23:in `load': cannot load such file -- /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.17.2/exe/bundle (LoadError) from /usr/local/bundle/bin/bundle:23:in `<main>'

NoMethodError (undefined method `rewind!' for nil:NilClass)

2012-09-19T01:19:45+00:00 app[web.1]: Started DELETE "/games/5/results/168" for 70.102.219.22 at 2012-09-19 01:19:45 +0000
...
2012-09-19T01:19:45+00:00 heroku[router]: POST rentrak-ladder.herokuapp.com/games/5/results/168 dyno=web.1 queue=0 wait=0ms service=31ms status=500 bytes=643
2012-09-19T01:19:45+00:00 app[web
.1]: Completed 500 Internal Server Error in 23ms
2012-09-19T01:19:45+00:00 app[web.1]:
2012-09-19T01:19:45+00:00 app[web.1]: NoMethodError (undefined method rewind!' for nil:NilClass): 2012-09-19T01:19:45+00:00 app[web.1]: app/models/player.rb:48:inrewind_rating!'
2012-09-19T01:19:45+00:00 app[web.1]: app/services/result_service.rb:35:in block (2 levels) in destroy' 2012-09-19T01:19:45+00:00 app[web.1]: app/services/result_service.rb:34:ineach'
2012-09-19T01:19:45+00:00 app[web.1]: app/services/result_service.rb:34:in block in destroy' 2012-09-19T01:19:45+00:00 app[web.1]: app/services/result_service.rb:33:indestroy'
2012-09-19T01:19:45+00:00 app[web.1]: app/controllers/results_controller.rb:27:in `destroy'

Software usage documentation

I believe the target market for this repo should be as wide as possible, and while the system is fairly basic it may be unclear how to perform actions

  • Ensure it is clear that users can use Elovation with no programming/ruby knowledge
  • Ensure it is clear that users can rollback games #56

As a user I want to add match scores to improve data accuracy

As per issue #54 it would be nice to add scores, it might be good to make this an optional feature though as people may want to keep the system simple. I suspect this is a large task.

  • Investigate trueskill / elo gem support for scores
  • If available implement logic to record scores, else record scores with not impact on ranking

Implement Openskill as an alternative to Truskill

Hi, in the recent years (2011 to be precise), a team of Taiwanese researchers published a paper about an alternative method to online ranking through a Bayesian approach, just like Truskill. It has the same concepts of perceived skill and variance, but is completely patent and trademark free. Currently, there isn't a Ruby implementation, but the the algorithm has been implemented under the name Openskill in several languages, like Javascript, Python, Elixir, Lua, Kotlin, and even one in Go by yours truly.
I'm not asking for you to start immediately start implementing this algorithm, hell, I might even do it some day. What I'm suggesting is that you keep this idea in the back burner, for maybe, whenever you feel like, add this rating method to Elovation.

Can't set up basic authentication.

As soon as i set the basic authentication parameters i can't get the app to run again, are the BASIC_AUTH instruction out of date?
I'm sorry if this is too much of an easy problem that i'm not able to fix.

active ratings list is a little confusing

People don't seem to be sure why someone would show up in the "Head to Head" but not "Active Ratings". I think if this was renamed to "Recent Ratings" it would be more clear, and mirror the other column on the game show page.

Rspec - address aurorun deprecation

Address the following rspec related error:

Requiring 'rspec/autorun' when running RSpec via the 'rspec' command is deprecated. Called from /home/christos/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:292:in 'require'.

match details

Excellent ! I've hosted it to Heroku in 10 min without knowing anything about Rails !

I plan to use this for a group of Hearthstone players.

I'd like to enter some details about the match (an URL, a score, a date).

Also when creating a match it would be nice that I can't face myself in the autocomplete fields.

Game rules/description

A short and optional game description to be displayed on the game page might be useful. One of my co-workers just spun up a game that needs a little explanation (a pentathlon of the other games.)

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.