Skip to content

Installing Hoot Draft

Matthew Orres edited this page Aug 23, 2019 · 2 revisions
  1. Download the latest release from the project releases page and extract the project to a temporary local directory.

  2. Create an empty MySQL database and a corresponding MySQL user that has full access to this database.

  3. Additionally, you should have a webserver (Apache, Nginx or IIS) setup to serve HTML and PHP. You will need to have the following items ready before beginning setup and deployment:

    • The IP address or DNS name of the webserver the app will be served from (SSH must be enabled & keys created - see this article for help)
    • Additionally, it's highly recommended for now to use SSH keys without passwords. Until Deployer supports it, it becomes a real hassle that ends up breaking an otherwise fine build process (it continually asks for your SSH key password, up to 20 times in a single build process)
    • Yarn installed on your server
    • Node installed on your server, versions 8 or above (also, see this AskUbuntu answer if you need help updating the version installed on your machine)
    • PHP (preferably 7.0+) installed on your server and wired up to your web server of choice
    • Both the php-mysql and php-xml PHP extensions enabled. To check, run php -m | grep xml and php -m | grep mysql - if each command returns mysql or xml, they are installed.
    • A long, randomly generated JWT seed token (generate at least a 32-character token using a generator - Google can help :) )
    • Google Recaptcha 2 registration, both public and private keys
    • SMTP server credentials (like Mailgun )
    • The absolute file path to the base directory the application will be stored on the webserver
      • IMPORTANT Requests from Apache/Nginx/IIS should be pointed to a symbolic link called current located within the yoursite.com folder (/var/www/yoursite.com/current, for example) which will be auto-created and updated during the Hoot Draft deployment. Ensure the SSH user has full write permission to this directory, too.
      • Within the yoursite.com folder on your server, multiple folders will (eventually, after multiple deployments) exist, each named a sequential number corresponding to the "build" contained within (so you will see folders 1 and 2 within the yoursite.com folder after 2 deployments). The symbolic link (current) will be automatically updated to point to the latest build during deployment.
  4. Open a command prompt or terminal on your computer, and navigate to the temporary local directory (same folder as index.html). Type vendor/bin/dep setup local and hit enter to begin the automated Hoot Draft settings wizard. It will ask you questions in the terminal window, type in the answers and hit enter to save.

  5. If your Hoot Draft install will be at the base of the domain or subdomain (as in sub.example.com or www.example.com), you may skip this step. If your base URL looks like www.example.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 www.example.com/phpdraft, then you must edit the HTML like this: <base href="/phpdraft/">
  6. Make any necessary changes to your .htaccess (Unix-like) or web.config (Windows) config files.

    • If you updated base href tag in index.html above, you'll need to edit line 5 of .htaccess like so: RewriteBase /phpdraft
  7. (Optional) Once the settings wizard has finished, type vendor/bin/dep backup local to take the settings files the wizard created for you in the last step, and back them up in a secure folder elsewhere on this machine.

This is helpful when upgrading the app in the future, as you can import these settings before deploying the application. A good suggestion is within your logged in user's home folder (along side Documents and Downloads folders, for example) in a folder called "phpdraft_settings". If you have more than 1 install, you would need to keep them in separate folders within phpdraft_settings

  1. Time to deploy! For best results, ensure your current machine is on hardwired ethernet instead of wireless.

  2. Type vendor/bin/dep deploy local and wait as the deployer automatically uploads the app, installs dependencies and updates the app database. If you receive a success message from the deployer, continue on!

    • Check the project Gitter chat, or ping Matt on Twitter for help in this process.
  3. Go to the base URL of your Hoot Draft install and register a new user account with your email address.

  4. 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 :) )
  5. Log in with your email address and password.

  6. 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 Hoot Draft. Enjoy!
Clone this wiki locally