Web Application 001

Hova Black
2 min readFeb 11, 2021

The journey to developing my first web-based CRUD application using Sinatra MVC, began with the introduction to database management. Understanding how data is stored and accessed as well as the language that is used, shone a light on concepts I had briefly encountered. The goal was to create an application that tracked something of interest, use the MVC approach, must have user accounts and contain basic CRUD functionality.

The structure of a Sinatra application is made easy for you with the use of the Corneal gem, and what a gem this is. With a few commands in the terminal and you have a blueprint of what is needed and required for your application, its only drawback is that it doesn’t write all your code for you.

Starting on the project was simple enough, I was going to build on my previous CLI project. The app extends on the concept introduced in the CLI project. A user can create an account and consequently login to their account, where they are able to create drink orders. A user can view all drinks they have ordered, make changes to an order as well a delete an order. Using ActiveRecord associations, a user has_many drinks and a drink belongs_to a user. The concept of sessions enables users to stay logged in, while clearing a session logs the user out.

The one area of confusion was determining the routes, what action needs to occur when a user clicks on a link. Being the novice that I am, I initially wrestled with the concept of RESTful routes, with additional guidance I have an application that meets the requirements and gives me the power of ordering drinks in the palm of my hand (well on web browser for now).

Care to order some drinks…

--

--