Git Product home page Git Product logo

phpdraft's Introduction

PHP Draft

PHP Draft allows commissioners to setup web-based real-time drafts for their fantasy sports leagues. If your leagues do offline drafts (instead of using your fantasy provider's online drafting tools), PHP Draft is just for you!

The league commissioner creates an account, and then adds your fantasy league. Pick the draft sport and style, specify the number of rounds the draft will last. Add the league managers (teams), and specify pick timers to make sure that one guy (you know who) doesn't hold the entire league hostage for an afternoon while he agonizes over whether to choose Joique Bell or Bishop Sankey in the twelfth round. Hit the start button.

BOOM. Your fantasy draft is underway.

Leave a laptop running on a podium and make each team enter their selections as their pick comes up, or be a gatekeeper commissioner and make every pick go through you - it's your choice!

The large color-coded draft board is perfect for displaying on large screen televisions (compatible with Google Chromecast screen casting!) and will display all pertinent info on-screen as it automatically updates.

NFL, NBA, MLB, NHL and even Rugby are supported, along with trades. Watch your draft unfold or run the whole thing from your smartphone with a Bootstrap-powered responsive web app!

Don't know how to install a web app or run a web server? No problem:

Sign up for a free account on https://www.phpdraft.com and get drafting today!

Minimum Requirements

  • PHP 5.4+ installed
  • MySQL 5+ database
  • Ability to use .htaccess to enable/use mod_rewrite (Apache) or web.config (IIS)
  • Ability to create and edit a file one directory above your PHP Draft install directory
  • SMTP mail account (for user registration/password resets)
  • Google reCAPTCHA 2 site key (public and private - used to verify new user registration)
  • OPTIONAL (but recommended): SSL certificate installed for your domain (for enhanced user privacy/security)
If you currently use PHP Draft v1.3.0, please see UPGRADE.md for instructions on how to perform an upgrade instead of a new installation

Installing PHP Draft 2.0.0

  1. After downloading the latest release, extract the project to a temporary local directory.

  2. Create an empty MySQL database (as well as a corresponding MySQL user that has full access to the database) named phpdraft.

    • If your hosting prepends your account name to the database name that's OK, just be sure to edit initialize.sql to match (Step 3) and appsettings.php (Step 5) with the correct name.
  3. Execute /api/Domain/Migrations/2.0.0/initialize.sql on the phpdraft database.

    • If your database name is not precisely phpdraft, you must edit Line 4 of this script to reflect this before executing the script.
  4. Copy [temp local directory]/api/config/EXAMPLE_appsettings.php to one directory above your temporary local directory (so in the folder above index.html), renaming it to appsettings.php.

  5. Open appsettings.php in a text editor, and edit all applicable settings:

    • DB_HOST, DB_PORT, DB_USER and DB_PASS will need to be updated to allow PHP Draft to connect to the MySQL database
    • DB_NAME corresponds to the database name. In most cases, this can be phpdraft
    • AUTH_KEY is a secret key that will be used to generate login tokens. Keep it safe (do NOT share it!). If you're not sure what this is, use a "CodeIgniter Encryption Key" generated by www.randomkeygen.com
    • RECAPTCHA_SECRET is the private key for your Google reCAPTCHA 2 account. Without it new user registration will fail.
    • MAIL_SERVER, MAIL_USER, MAIL_PASS and MAIL_PORT allow PHP Draft to send emails for both new user email verification and password reset emails.
    • APP_BASE_URL is the home URL for your PHP Draft installation - for example http://www.yoursite.com/phpdraft (whatever you type in to the browser to load PHP Draft). No trailing slashes!
    • API_BASE_URL is the base url for your PHP Draft API - which should be the same as APP_BASE_URL except with /api appended to it, like: http://yoursite.com/phpdraft/api
    • The rest you can read up and configure as you like, but the above settings are the bare minimum.
  6. If your PHP Draft install will be at the base of the domain or subdomain (as in your.site.com or yoursite.com), you may skip this step. If your base URL looks like yoursite.com/phpdraft, do the following:

    • Open index.html and find this HTML: <base href="/"> and change it to match the directory path after the base domain. So if your base URL is yoursite.com/phpdraft, then you must edit the HTML like this: <base href="/phpdraft/">
  7. Open js/config.js and update two values to match your installation:

    • apiEndpoint should be a fully qualified URL that points to your PHP Draft API (so http://www.yoursite.com/phpdraft/api/ is valid - note the trailing slash)
    • recaptchaPublicKey should contain the public key portion of your Google reCAPTCHA 2 key
  8. In your FTP client, navigate to one directory level ABOVE where PHP Draft will exist and upload the appsettings.php you edited in Step 5.

    • For example, if my site's absolute server path is /home/hosting_account/www/, I need to upload appsettings.php to /home/hosting_account/. Ideally this file should not be served by the web server, but must be readable by PHP scripts in directories below it.
  9. With your FTP client upload all contents of your temporary local directory into the directory that PHP Draft will exist.

  10. Go to the base URL of your PHP Draft install and register a new user account with your email address.

  11. In the phpdraft database, find the row in the users table that corresponds to your newly created account. Make three edits:

    • Change the value in the enabled column to 1 (which will enable your account)
    • Change the value in the roles column to ROLE_ADMIN,ROLE_COMMISH (which will make your account both a site administrator and a commissioner)
    • Change the value in the verificationKey to NULL (this deletes the key contained in the new user email sent to your email address - you don't need to validate your own email :) )
  12. Log in with your email address and password.

  13. In the top header bar, click on Admin Stuff then select Player Data. Using the CSV files contained in the /resources/ directory, update each sport with the matching CSV file:

Sport CSV File
Football (NFL) ProPlayers_NFLStandard_20xx.csv
Football - Extended Rosters (NFL) ProPlayers_NFLExtended_20xx.csv
Baseball (MLB) ProPlayers_MLB_20xx.csv
Basketball (NBA) ProPlayers_NBA_20xx.csv
Hockey (NHL) ProPlayers_NHL_20xx.csv
Rugby (Super15) ProPlayers_Super15_20xx.csv
Congratulations! You have installed PHP Draft. Enjoy!

Bugs and feature requests

Submit an issue on the repository (tab at the top) and clearly mark what you're submitting is a Bug, new feature or something else.

Notes

  1. Version 2 adds full-blown user management and secure access, such that PHP Draft is no longer a PHP site, it's now a first class web application that can run in a Software as a Service (SaaS) model. What does that mean? You don't actually need to install PHP Draft yourself - you can use my site at https://www.phpdraft.com instead :)

    • I pay out of pocket for my own hosting. If you use it, please consider making a Paypal donation to [email protected] to help cover the costs. Thanks!
  2. This was a complete project rewrite with 110% feature parity from version 1.3.0 (I added a few nice features/smoothed other things out from 1.3). The only missing "feature" was the MP3 sounds autoplaying when pick timers ran out. I plan on bringing it back soon, but felt it was both A) a superfluous feature at best and B) would risk jeopardizing the 2.0 codebase hardening in time for real life MLB 2016 usage.

    • If you loved this feature, let me know! (Twitter: @mattheworres ) I may prioritize it a little higher if I hear from enough folks and add it back in a future version.
  3. This also marks the first time that PHP Draft has been available on Git/Github as opposed to Mercurial/Sourceforge/Bitbucket.

    • Can I just say how awesome Atlassian Bitbucket is?! It kills me to switch from Bitbucket to Github, but the main reason for the switch was...
    • Sourceforge. When I started the project in 2010, Sourceforge was an OK place for open source projects to live. It's a different story nowadays, unfortunately. SF has turned into a shell of its former self, and never seemed to find a sustainable revenue model. From its issues with "junkware" to the severely declined OS traffic, it makes it less and less advantageous for PHP Draft to live there.
    • Github is synonymous with open source, and I hope to switch to both it as well as Git over Mercurial will help drive more code contribution. Plus, their platform is just better - it's a one stop shop of a code repository as well as a project homepage where I can easily push new releases.
    • For now, issue tracking will remain in Atlassian's JIRA - and I am still incredibly grateful for their lifetime license of the JIRA software for this project. If I end up getting more contributors in the future, I can envision needing to leverage the power that JIRA provides. Stay tuned.

Contributing & custom development

See DEVELOPMENT.md if you are interested in developing or making custom changes to your PHP Draft.

PHP Draft is now a PHP API with an Angular (Javascript) front end, and has a complicated build toolchain that includes NPM, Bower, Gulp, and Coffeescript (to name a few) - take a gander at that readme for better instructions on how the project is now built.

If you come up with something that others may find worthwhile - please fork this repository and submit a pull request. I provide this code (and the hundreds of hours of my personal time I've poured into the project) free of charge under an open source license without any expectation of payment or even gratitude. I do it to help a few folks out, and to return the favor I ask that you help pass it on :)

Changelog

See CHANGELOG.md :)

Creators

Matthew Orres

Copyright and license

Code and documentation copyright 2010-2016 Matthew Orres. Code released under the GNU v3 license.

phpdraft's People

Contributors

jchusko avatar mattheworres avatar

Watchers

 avatar  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.