My second assignment was to create an MVC app with Sinatra.



April 5, 2019




This project required creating a CRUDMVC app using Sinatra. “Essentially, you're building a simple Content Management System (CMS) using the tools you've learned thus far.”

We were supposed to create an app that would track something important to us, so I chose to create something that would allow pet owners to keep all of the important information about their pets in one place - vaccination history, vet information, preferred food, how much they should be fed and how many times per day. I thought of this because I know that for Waffles, I have all of his information but it’s stored in different places and not readily shareable all at once.

A user can create a username and password for themselves, and then create as many pet profiles as necessary. They can view all of their pets at once and edit information for any pet and save the changes.


My process for this assignment involved a lot of trial and error, proofreading, and google. The first time through, I was over ambitious and eventually confused myself and my repo beyond what I’d be able to fix before the due date. I went back to my original idea and tried to be more careful. This worked until I had all the code in place but things were still breaking. So, finally, I went back through everything piece by piece in order the way I would interact with the site. Does the welcome page show up? Good. Can I create a pet profile? No? Okay, go back and fix the code. Instead of trying to add everything at once, I did it in pieces. I waited until things were working before I started trying to require being logged in and redirecting if not. I waited until my edit form went to the right place before actually filling in some of the values. This last approach was the best, and will probably be what I do going forward. It’s almost like being patient and deliberate is a virtue who knew.

Because I went through a couple of iterations to get things working, the code I’m submitting today (4/5/19) is not what I’d consider a finished product; I plan to continue working on it as we learn more things. I would like to change the styling using HTML and CSS and make the layout more friendly and readable. I would also like to add the ability to save a photo for each pet, and to share a link to a profile letting pet owners share their notes with petsitters and family.

I had a better time completing this project than I did our first; I felt more confident in my ability to solve problems and get things working on my own. I focused on being more conscious of when I pushed commits and what my messages were, since that’s what I wanted to improve on over our first project.

For our next project, I would like to work on making my code as clean as I can and maybe finishing the requirements early enough that I have time to do the fun things, like play with the style.


What we’ve accomplished:



A user can create an account for themselves by submitting a username, email, and password. They can log in and log out.



Users can create profiles for their pets, save that information, log out, and have that information available when they log back in. They can also delete their own information. They cannot edit the information of other users.



The app utilizes a has_many and belongs_to relationship, multiple models, and an MVC structure.