DEV Community

Salmaan Ali
Salmaan Ali

Posted on

First Sinatra Project

I've just completed my first MVC ruby project with Sinatra. And the most important thing I learned during the process was to plan plan plan. My biggest mistake was jumping straight into the project, wanting to satisfy my coding itch, without first considering what it was exactly I was trying to build.

I gave the project requirements a quick read over and basically knew that I had to build an MVC app that gave one of my models the full CRUD capability. So I jumped in and started coding. At first my project was to have a list of video games where users could add, edit, or delete from the central community list. But what value was there in that? Why would users simply add a video game to a community library? Wouldn't it be more valuable for users to edit their personal library, and maybe share that list with the community? And did it make sense that any user could add whatever they wanted to that central list of video games? Expectedly, I started second guessing my idea. But maybe because of some sunken cost fallacy, I felt like I needed to continue with that initial idea since I had already begun coding.

That night when I went to bed, I was finally away from my computer and it gave me the time to think more about the project. I started thinking it all through in my head and began realizing that I needed to add another feature to the app where individual users could actually own and interact with their personal contributions, and have it be well coexistent with the overall community members' contributions in the app.

Reviews! That's it. The app will list a ton of games, and users will be able to review each game and read the reviews of other users.

Although this new idea was related to the original one, I did have to do some significant back-tracking. But once I had that clearer goal in mind, the overall building of the app was much easier.

I was confidently able to declare ActiveRecord associations between the models, seed the database with realistic records, and build out each of the routes tactically.

I definitely would have myself a ton of time and stress if I started slow and thoroughly planned my project.

In the end it all worked out :). Users are now able to submit reviews of any game on the list. If you want to check it out, I've copied the github repo below.

https://github.com/sallyman128/salmaan_sinatra_mod_project

Top comments (0)