Project 3: Ruby on Rails - Cellr
A few things have changed since the last time I published a blog, and of course, a few things haven't! What changed? Well, I expanded my existing knowledge of Ruby on Rails enough to build an app from the ground up. And what stayed the same? I still love wine, I'm still on a wine kick and I'm still in school. So when project three came around I knew I wanted to expand on my previous project and build a Rails version of
Process makes perfect
This project started with a plan. It had to. I promised myself I would and I knew it was going to be just the thing that kept me away from all confusion. The requirements list was longer than any project thus far and I couldn't afford to get halfway in without a plan. Well, I made a plan, sketched out my models, their associations, my routes and guess what... I still got halfway through and felt like my plan was failing me. What table should act as my join, what had many of what and what belonged to who??? I was confused. Thankfully, I was able to chat with a few friends to help flush this out, but it was not easy. This project really showed me the value in feature planning, understanding scope and working in small enough sessions to keep my mind from completely going to spaghetti. I also learned that for me, verbalizing my plan helps me catch gaps (Maybe I need to present my plan to myself next time.)
My app is a basic rails app that allows a user to track inventory in their wine Cellr (or cabinet, refrigerator, etc.). Users can sign up with a simple email/password combo or through oAuth through Facebook. The app itself keeps one database of Wineries and bottles of wine. This prevents duplicate data from being persisted to our database. A user is able to "add" a bottle of wine through adding the price they paid for that specific bottle. At that time, users are directed to their Cellr overview page which calls out the bottle count, the total value, the average vintage and a list of wines in each Cellr. I used a scope method on the User class in order to calculate the highest valued Cellr in the app overall. That page is accessible to both logged in and logged out users. I leveraged Bootstrap for to style the front end and the
bootstrap_form gem was a lifesaver! This gem allows the developer to use the
bootstrap_form_for helper in place of
form_for and gives access to its own version of the
form_for helpers. It's awesome!
As an added bonus, I decided to work through getting my project deploying to Heroku. It was a lot of fun. I ran into some issues with my database migrations and url/paths. Working through those bugs just further helped solidify these concepts!
So what now...
I plan to continue to code in this project when I have time. I may even decide to use it for my next project which will utilize JS. For that to work, I will have to rewrite the front-end away from ERB and potentially change how my controllers are sending data to my views. Sounds fun :)
For now here are a few enhancements and features that I think will make this app even more functional and user friendly.
- Refactor controllers.
- Move duplicate view code into partials to stay DRY.
- Add comments or notes to a bottle that will be accessible to the user through their Cellr or on the bottle show page available to all users.
- Show bottles of wine to logged out users and in order to "view info", prompt a login/signup.
- Share bottle of wine to facebook.
- Group wines in users Cellr by Winery, Type, or Grape Variety.
- Front-end update with better design and UX. Potentially use a Bootstrap theme!
** List subject to grow and continue growing.
*** I'm learning that ^^ is just a thing in this world, and I like it!
👉🏻 Check out the project on GitHub
👉🏻 Check out the project live project and track your Cellr.
Buy some wine! Visit Vervewine.com
Thanks for reading! Cheers!