Giter VIP home page Giter VIP logo

kortirso / fantasy_sports Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 3.55 MB

Web application for creating and maintaining fantasy leagues for different kinds of sport competitions.

Home Page: https://fantasy-sports.org

License: GNU Affero General Public License v3.0

Ruby 68.62% HTML 10.69% JavaScript 11.74% PLpgSQL 6.74% CSS 2.18% Procfile 0.01% TypeScript 0.01%
ruby-on-rails fantasy-basketball fantasy-premier-league fantasy-sports fantasy-football

fantasy_sports's Introduction

Fantasy Sports

Web application for creating and maintaining fantasy leagues for different kinds of sport competitions.

Installation

$ bundle install
$ rails db:create
$ rails db:schema:load
$ rails db:seed
$ yarn install

Running web application

$ foreman s

Tasks

Check translations

$ i18n-tasks health

Testing

Unit tests

$ rspec

E2E tests

With browser

$ rails server -e test -p 5002
$ yarn cypress open --project ./spec/e2e

Headless

$ rails server -e test -p 5002
$ yarn run cypress run --project ./spec/e2e

Sensitive information leaks

$ bearer scan .

Process

Starting new week

  Weeks::ChangeService.call(week_id: week.id)

week - coming week that must start

Fetching data for game

  Games::FetchService.call(game: game)

game - game for fetching data

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Please see the LICENSE file in our repository for the full text.

fantasy_sports's People

Contributors

kortirso avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

forni82

fantasy_sports's Issues

Integrate player price changing system

FPL considers the player popularity i.e. his net transfers in a gameweek as the only parameter to alter the price.

Sometimes a player will go up in value by .2 or even .3 within the same gameweek. This is how it works: To go up by 0.1 the player needs a net transfer of 10,000. To go up another .1 within the same gameweek he’ll need to get a net transfer of a further 20,000 (that’s 30,000 in total). To go up another .1 within the same gameweek he’ll need to get a net transfer of a further 40,000 (that’s 70,000 in total!). Don’t forget these figures are based on the net transfer figure of 10,000. However, this threshold value varies depending on the popularity of the game. In the beginning of the season, it goes up to 10–15k and comes down to 6–8k during March and April. Whatever the threshold figure turns out to be at that current time, you basically double it each time for each increase.

Maintenance mode

  • Need to add maintenance mode while running Weeks::ChangeService
  • while mode is on:
    • disable json requests
    • redirect html requests to special page

Unlimited transfers

For first week fantasy team need to have unlimited transfers before next week started

Modify finishing week

During week changed status to finished it requires

  • for sport with changes - changes lineup players with 0 minutes played to players from substitution

Integrate achievements

  • Points for team at week (50, 100, 150, 200, ...)
  • Points for team in week rows (50 points in 3 weeks row, 100 points in 3 weeks row, ...)
  • Top-100 by points in overall league (1 time, 5 times, 10 times, ...)

Add opportunity to create custom leagues

  • Add Leagues and Cups page with all leagues of current user
  • User can create fantasy league
  • User can invite other users to fantasy league by invite code by manually providing invite code
  • Invitee must has fantasy team for joining

Admin page

Required for editing

  • sports
  • leagues
  • seasons
  • teams for season
  • teams players
  • season's weeks
  • week's games
  • game's players with statistic

Filters and sorting

  • Filter players by position
  • filter players by team
  • sort players by:
    • price
    • points
    • goals scored (and other statistic params)

Making transfers

Add endpoint that works in 2 modes

  • validate transfers
  • validate transfers and complete them (just with additional flag in params)

need to check

  • what players are removed and added (make team validation + budget validation)

Modify PlayerModal

Right now in Controllers::Seasons::Players::ShowSerializer statistics is calculated for 3 types of weeks

but for active week there must not be Week::COMING

Player Form calculation

Form is a player’s average score per game, calculated from all games played by his team in the last 30 days

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.