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.
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.
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.