My first application

Dexter Crockett
4 min readFeb 8, 2021
Me after finishing

That gif is not an exaggeration. Okay maybe my head did not actually explode and I did not actually have steam coming out of my ears, but that is how I seriously felt afterward.

The journey to complete my first FlatIron project was a rough one indeed. For starters, picking a project. I thought that would be the easy part. Working in the legal cannabis industry, I figured a cannabis menu would be perfect and familiar for me. I “found” a few that seemed great. Trouble is, I neglected to test them. Not the smartest move I know, but a lesson learned. None of them worked, even though they were free and open. They required keys that needed to be e-mailed, but they never came. It was at this time I had my Eleanor Shelstrop moment.

It was okay though. My awesome Cohort lead Dj gave us a list of free API’s to use so I had a plan B. This time I made SURE to pick a good API that worked. I landed on the “I’m Bored” API. It is cool and pretty simple to use. It stores a database of random “events” composed of activity, the type of activity (education, DIY, cooking, etc.), the number of participants involved (0–5), price (ranges from 0.0–1.0 with zero being free, a unique for the event, and a handy link for learning skills like programming a new language, and accessibility which states how easy the events are. Pretty simple, and you wind up with hashes of events with corresponding key-value pairs.

{"activity":"Create a compost pile","type":"diy","participants":1,"price":0,"link":"","key":"8631548","accessibility":0.15}

Now that I had my API, the fun could begin. I first needed a good structure for how I wanted my application to work. I wanted my user interface to be simple and easy to use. I wanted to be able to create instances of events by type, number of participants, and totally random. This meant that I would need three API methods in my API class. Getting that to work was more simple than I was making it out to be. That proved a little difficult as I was adding something to my API URL that didn’t need to be there. It is funny the things you overlook. Eventually, I got it working and was able to make test events. It felt good to get something working. Even if it was just a test.

Next came my custom class for when my instances were created. I used three attribute accessors for the inputs that would be input by the user. I also included a save method that would save all instances of events. This is just in case the user wants to see past events they have instantiated for future use. The problem is, nothing was saving and I could not for the life of me figure out why. I had my save method and everything. Using a binding.pry I was able to see that my array was present, but nothing was being saved in it. I had no choice but to move on.

Then, I needed to link everything through my environment by requiring my libraries and files in places like my environment. This allows communication between my various classes while creating my events and letting the user interact with the application. The application simply will not run without it.

Finally came my CLI. This proved a lot easier with help from Dj and Avi’s videos going over it. They both say to imagine me as the user and how I would want to interact with my program. This goes back to how simple I wanted it to be. Everything worked how I had planned. Well, almost everything. I could generate events by type, participants, or random. It felt good to have my program at 95%. I’m still trying to figure out why nothing is saving. I’ll keep looking. I’m determined to get this right.

I am still very much confused when it comes to ruby. I constantly refer to videos and various coding sites to find answers and ask questions from fellow students, my cohort lead, and AAQ. I know that I’ll eventually get the hang of Ruby. It’s just a matter of time.

--

--