For the second portfolio project of the Flatiron School, we were tasked with creating a web application complete with a database using the Sinatra DSL in Ruby. Easier said than done! The Sinatra project was the culmination of several weeks of core concepts that are integral for creating a web application: understanding object associations, building MVC (model-view-controller) frameworks, Restful routes, and learning the fundamentals of SQL to manage data in databases. Personally, I found each of these discrete concepts interesting and enjoyed delving into the world of backend development.
However, when it came time to piece together all these important and interconnected patterns and concepts in the form of my project, I found myself metaphorically “sinking” underneath an ocean of new information and struggled at first to understand exactly how these concepts all dovetailed together. So, I picked myself up, accepted the challenge, and strategically made use of two important tools in my coding arsenal: DB browser and tux. I will specifically touch upon the first tool I used — DB browser.
For my Sinatra project, I created a CMS (Content Management System) web application that allows a user to create an account and build a virtual wine collection. Users can add wines to their inventories, edit their own individual wines within their collection, and can also view the wine collections of other users.
One of the most difficult challenges I faced was establishing the relationships between the three models I used in my project and incorporating my seed data. Specifically, I was having trouble with visualizing my model associations and determining whether my seed data was successfully created. I knew that having a concise visual representation of my database table would be incredibly useful as I built my web application.
While conceptually I understood my model relationships, I found myself frequently referencing my application diagram/drawings. Here is where DB Browser for SQLite came to the rescue! DB browser is a visual tool that helps developers create, design, and edit database files compatible with SQLite. We had briefly examined and played around with this program in class; however, I definitely was by no means adept at using it. Though, by the end of my project, I found myself consistently referring back to DB Browser in order to verify and view my model associations.
As a developer, I’ve learned that it’s important to create web applications or projects that are flexible and scalable. Paying close attention to these two design principles, not only gives you the groundwork to create more functionalities within your project, but in my opinion also expands the level of interesting and fun directions your project can take.
The scope of my project grew from two initial models to three models — this meant that I spent substantial time creating/designing data tables, tweaking dummy data, and reworking associations. Thus, unsurprisingly this type of backend development necessitated the need for a tool like DB Browser to track and manage my database. I was thrilled to add a new tool to my digital arsenal and look forward to continuing to expand my knowledge base of web application design and construction.
How to Download DB Browser
- Head to https://sqlitebrowser.org/ and follow the on-screen instructions.
You can find my Sinatra project here: https://github.com/jcport1/vinologue