My First Web App

One month ago, I decided to start a blog (www.kinglemuel.com/articles)to document my progress in the Flatiron school. I thought it would be a good idea to keep track of my daily performance and so I debated which platform I would use: wordpress, medium, or blogger. I eventually decided that If I am pursuing a career as a web developer then at the very least I should be capable of building a simple blogging app in rails. Luckily, the official rails guides offer a beginner’s tutorial for developing rails apps via a blogging application. The ‘Getting Started’, (http://guides.rubyonrails.org/getting_started.html)rails guide taught me the basics of MVC or Models, Views, Controllers, a simple design pattern for structuring web apps.

The ‘models’ in MVC represents how we model our interactivity with an applications data. Rails uses something called an Object Relational Mapper to facilitate this process, it sounds complicated, but it’s really just an object oriented way of storing and accessing information in a database. Conceptually, a database is just a table with rows and columns. My blog is an example, there is an ‘Articles’ database, with each row representing a single article and multiple columns representing various attributes pertaining to that article, such as an id number and the date that specific article was created.

Traditionally, a language called SQL must be used to directly execute commands on relational databases like this, but thanks to various web app frameworks such as ruby on rails we can use a pattern called ORM. The concept is simple, we use classes to represent the database table and each instance of the class or object becomes an entry within the database table. Using the previous example, our database table called Articles correlates with a class called Article, and each entry within the database table is an instance of the Article class. I also learned about ‘Views’, which combines front end technologies such as HTML, CSS, Javascript, and embedded scripting language features to produce a convenient pattern for designing user interfaces.

Controllers and Routing might be the final pieces of the puzzle but they are not the least in value, after all if no one can access the pages on your site, it really doesn’t matter how much data or how pretty your application is. Every rails app comes installed with a routes.rb file which contains configurations for managing server request and their responses. Using my site as an example, when a user types www.kinglemuel.com/articles into his browsers address bar, a request is made to the server where my site is hosted. The routes files will direct this request to the corresponding Controller file which will determine a proper response which by default is to render the requested html file.

Along the path of learning how to build a web application I learned about various supporting frameworks for the front end and gems that can enhance your projects features. Bootstrap is a front end library that combine css and javascript to provide programmers who aren’t too skilled at design a simple solution for developing quality user interfaces by referencing css classes within your html. Additionally, building a blogging app from scratch contains many drawbacks if you are used to the power of a full blown CMS like wordpress. Thankfully, many gems exist for setting up word formatting, picture storing, and other required features that is normally attributed with a blog.

The experience of building a blog as my first web application led to an understanding of the fundamentals regarding the MVC paradigm, the value of external libraries which ruby calls gems, and front end technologies like Bootstrap that can improve design patterns for the less artistic programmer.

Show your support

Clapping shows how much you appreciated Lem’s story.