My Book Recommendation Sinatra App
The most important thing I learned during the course of this Sinatra project was that waiting until I felt like writing this blog post and recording my video walkthrough just made me not want to do it even more. But, before I get into that:
The Basics
Hereâs a link to the repo.
So the app allows people to recommend books to each other. I used my newly acquired (at the time) knowledge of sessions to build a very basic authentication system. I faced two particularly challenging issues while building my book recommendation app: The first was the fact that all objects of the User class could recommend books and be recipients of book recommendations. I ended up simplifying this by adding a ârecommender_idâ foreign key to my Recommendations table (which was the join table for my Users and Books tables). This way, the âuser_idâ of the recommendation would be that of the person whose page the book appeared on, but the recommenderâs information was still stored and easily accessible. I also create custom setter and getter methods in the Recommendation class for recommender_id just so I could work with it as easily as I worked with my other Active Record objects.
The second issue was my utter inability to style forms. I ended up getting a bit more comfortable with Bootstrap while styling this app, but I still cannot figure out how to style forms the way I would like them. I ended up just centering all the forms. Iâve been trying to style the forms in my next project for the past three days so hopefully I have a breakthrough soon. (Also, the styling on my next project, is much, much, MUCH better so stay tuned for that blog post/video walkthrough.)
EDIT
The forms look totally fine in this app. I literally waited so long to record this video walkthrough and write this blog post that I forgot that I do know how to style forms. The styling issue that i had was that I wanted to display my books in a grid formation but couldnât get the spacing right.
Reflections
Anyway, it was a terrible idea for me to wait to write about this app because I didnât realize that as soon as I started learning Rails and moved on to building my Rails project, this project seemed less and less interesting to me. BUT, one really nice thing about returning to my Sinatra app was that I had a meeting last week at the Upperline School of Code, where Iâll be a teaching assistant for a course that culminates in the building of a Sinatra app. Since Iâll be helping students create Sinatra apps, it doesnât hurt to get some extra practice.









