By: Caleb Bass --->> For: CS 4573 - Special Topics in Computing --->> Fall 2017
Link to the website supplementing the project: http://www.baseballauthorityhq.com/
Direct link to the page showing the tables: http://www.baseballauthorityhq.com/table.html
Starting off on this project, I wanted to build upon what we learned in the Intro to Databases class by utilizing the database with an actual website. My goal was to put together a large database and then pull the data into a Wordpress site, so I created a website with some "dummy" content to go along of with the theme.
The easiest part of the whole process was definitely the database. I've become pretty comfortable with SQL, and using DataGrip to build everything was pretty straightforward. I did have to edit some of the data, as there was simply so many attributes per table that it was ridiculous, but that's baseball for you, it's a statistician's dream. The raw data I used came from Lahman's archives, which is one of the most comprehensive repositories on the sport.
After getting all the tables and data in order, I then set up a local server using MAMP and started trying to find a way to display the data in a pleasing and useful way. At first, I foolishly started to hard code each table's column headers and all into their own webpages, but I soon discovered there was a much better way to go about it.
Using jQuery and the wonderful DataTables plugin, I was able to make searchable and sortable tables dynamically. Adding to the dynamic ability, I used AJAX and server side processing to make it so the page never has to be reloaded when switching between tables. Selecting a different table from the dropdown simply destroys and redraws a new table in the specified HTML div.
Along the way, I discovered that in order to get all of the proper attribute column heading for the tables, and generally processing data, that JSON would be very useful. The simple structure made it easier to pass data around than it would have been otherwise.
Far and away the most difficult part of the whole process has been getting what I created locally to work on an actual website. Getting all the directories, connections, and all the other little details right so the files can be properly used has been a struggle at times. Writing up the code and previewing what it it does/looks like is the easier part, while taking the working pieces and putting them in the correct places so they can truly be utilizied is the hard part.