Phase 2 Portfolio Project

Armando Rojas
2 min readJan 29, 2021

I recently finished Phase 2 of my web development course at Flatiron School. In this phase, I finally got to start creating actual websites! I did this by learning how to use Sinatra. Sinatra is a gem for Ruby that allows you to create complex websites and host them on your own computer.

Using Sinatra, I created Shelvs, my first fully original website. Shelvs is a website that lets you keep track of your books by storing them in libraries according to their topic.

I was able to make this work by using Active Record to create three tables (Users, Libraries, and Books) that are all accessible through models. Using this method allowed me to create relationships between the tables. For example, user and library have a has many and belongs to relationship meaning that a user can have many libraries but a library can only have one user. This means that only the user who created a library can modify it.

After creating the models I had to create the controllers. Controllers function by taking a request from a browser and responding with only the relevant info.

Next, I made my views files. Views files are what make up the actual content that the average user sees. I used ERB files to make my views which allowed me to add code to the webpage itself.

Overall, this project was pretty difficult but I feel like it helped me get a better understanding of how websites work so that I can make even better ones in the future.

--

--