Giter VIP home page Giter VIP logo

golfdraft's Introduction

README

App for handling my yearly 18-person PGA tournament pool. Has two main modes, Draft (js/components/DraftApp.jsx) and Tournament (js/components/TourneyApp.jsx).

Draft mode runs a snake draft of all the golfers in the current tournament (specified by pgatour_url in server/config.js). Each player gets to select 4 golfers. Uses socket.io to update all web clients as players are picked. Sounds 3 bells when it is your turn to pick.

Tournament mode shows live scores for all the golfers, as well as the current standings in our pool. By default, only your golfers are shown, but you can view others' golfers by selecting their name in the Pool Standings.

Note: The app forces you to select who you are for convenience. There is no login or anything, meaning you could potentially log in and pick for someone else. This is a purposeful choice, as we want to optimize for the following:

  • Easy adoption. Some of the guys in the league don't have FB and won't want to create an account.
  • Easy support for proxy drafting. We often need to draft for someone else who can't make the draft. This is done ad-hoc, and is supported by the user just using multiple browser windows.
  • Honor system. We rely on the honor system for this whole thing. No need to enforce complexity with logins.

Terminology

These are referenced all over the code.

  • player - A person in our league (not a golfer)
  • golfer - A PGA golfer
  • tourney - Tournament

Run webserver locally

Requires mongodb and redis instances. See server/config.js default values for setup.

npm install
grunt rund

Navigate to http://localhost:3000

Run tests

grunt test

Build prod files (checked in)

If building, keep in a separate commit in master.

grunt build

Live updating of scores

Running the following command will update the scores from pgatour.com, based on the URL in server/config.js.

node server/runUpdateScore.js pgatour <pga tour json url>

In prod, while a tournament is running, I run this command every 10 minutes using a simple cron job. The server is notified via redis. The clients are updated with a socket.io message.

Reset data locally

It will often be helpful to reset data locally so you can do some manual testing.

node ./server/refreshData.js pgatour <pga tour json url>

golfdraft's People

Contributors

alexodle avatar gt6796c avatar njones-ac avatar thomasjmwb avatar

Watchers

 avatar

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.