I cannot believe it. I have built four applications…using CODE?! When I say it out loud, it does feel a little weird, but…here we are. Leading up to each project, I generally had an idea of what I was doing. This app (Vanilla JS), was a little different.
Unlike my previous bouts with fantasy football, my first ever Rails app was a victory…I think. Looking back at the start of my coding journey, I am shocked and proud to be where I am now. Not like a pat on the back, but really a reflection on the idea that what I have accomplished, anyone can do if they out their minds to it. And being able to build something out of nothing is SO COOL! But I am sure you all have not click on this blog to talk about how amazing this is. On to what I think made the app what it is:
Every year my close friends and I play fantasy football. With that, we also have a pick-em pool. For those who do not know, a pick-em consists of picking a team that you will think will win each week. If your pick wins, you move onto the next week. If not, you have to buy back in. This app consists of just that. Users create an account, have access to a full NFL schedule, then they can pick a team that week. Users can only make one pick per week. And once they pick a team, they can no longer pick them for the remaining season. get the
The app itself consists of seven controllers, six models, and six tables in the database. This started off with only three of watch but quickly changed as I added more to the application. In order to display the NFL schedule without manually seeing the DB with all 256 games, I used the API (MYSPORTSFEEDS) to get this data. I created a method to search the API data and create a game object and save it into the database. The game consisted of the two teams playing, date, victor, and time data. Moving on from that, I needed to find a way to make sure that users could only submit one pick per week. I was initially able to achieve this using a custom validator, but quickly ran into some issues as using normal Date ruby methods would not since a week needs to consist of a Tuesday - Thursday night rather than a Monday - Sunday. To achieve this, I created a Week table and had a custom Start of week and End of week. I then created my pick validator using a range.
There were three things that really helped me through this project.
If you would have asked me how I felt about seeing the seoncd project come up only 4 weeks or so away from the first project, I would have said how upsetting it was. As I did not feel like I was going to be able to prepare, retain, and work ahead. Boy, was I wrong. Although it did off a little rocky (Advanced SQL queries are something else) it did end up much better than I thought. With the introduction of ActiveRecord, all started to click and so did my Siatra Project.
One down and a few more to go. I finally finished building my first program from the ground up.