h2. WarRoom
This application assists you in running your fantasy baseball draft.
Originally called "DraftDay", it was created before the 2005 baseball season to assist in my annual onsite draft. It was written to Rails 1.0.2 and is slowly being updated to current Rails versions. WarRoom is a nearly complete rewrite of the application in Rails 2.2.2 with actual tests (!).
It is mostly aimed at Yahoo! Fantasy Baseball today.
h3. Usage
The application lets several owners view player stats and draft picks during a draft.
It is set up today so that a single administrator records all draft picks, but the owners can see all players left (as well as chosen) in real time.
It can be used with remote owners, along as they have a means of communications with the administrator (commish). In 2008, we had one remote owner who drafted his team over IM while using the application.
h3. Functionality
There are several screens to this application
- User screens
Players screen: this is mostly an Ajax driven player stat sorter. It is the main screen where you can see all the available (undrafted) players. Players can be sorted by about any DB field (team, position, stats, etc.). There is also an Ajax live search box. Finally, there is an Ajax updater on the top of the screen that shows the last pick taken.
Picks screen: shows the draft picks in order as well as the upcoming draft order. These are both Ajax periodic updaters.
- Commish (Admin) screens
Entry screen: a commish only screen, where the draft administrator can record picks.
Commish screen: basically the draft list, but fully editable (in case of problems).
** Users screen: your basic user accounts.
h3. Dependencies
- No GEM dependencies (yet!)
- Restful Authentication plugin
h3. To Do
- add real testing. and javascript testing.
- add admin functionality that sets up drafts and pulls players stats
- add analysis features beyond the half-assed projections screen. or maybe make that full-assed.
- eventually make this so no "admin" or "commish" is needed -- that's right a real draft application which allows you to draft your own player and keeps track of time. i can dream.
- highlight players row when moused over
- pull in DL and news from y!
h3. Utilities
In the script folder, there is a script called hpricot_players.rb that scrapes player stats to populate the players model/database. This will be worked into the admin controller soon.
h3. Architecture
There is two major models (players and users) in this application:
player: a person and his asssociated stats and affiliations
user: someone who owns a team (important: you can't have people who don't draft as a user)
All the other models in this application are relationships between players and users (owners):
pick: a player that has been drafted by an user
retainee: a player that has been retained by an user
watchlist: a player that has been watched by an user
I believe everything in this application is fairly RESTful.