Sitemap
Silver

Silver

Coffee/Code/Crypto(SilverC.eth)

Rails Engine Analytics

3 min readJan 28, 2019

Developing my first API! Kind-Of

Press enter or click to view image in full size
by Tsahi Levent-Levi

Rails Engine is a Ruby on Rails API that has the capability to import data from CSV files and uses Netflix’s Fast JSON API serializer to deliver business intelligence endpoints. This application was my introductory project for APIs and Serializers. I must say, I’ve been impressed with the capabilities of API’s. Here are some lyrics from some Disney movie, “It’s a whole new world,” but really.

Application Programming Interface(API), according to Wikipedia, is a set of subroutine definitions, communication protocols, and tools for building software. The analogy that helped me understand goes as follows. If we got to a sit-down restaurant we will most likely have a waiter/waitress that communicates our order to the kitchen. In this particular case, the API is the waiter/waitress, they receive a request, collect/process the response and then return with that response(our delicious pumpkin pie).

Get Silver’s stories in your inbox

Join Medium for free to get updates from this writer.

Now that I have you singing one of Disney’s classics, I will inform you of my first experience building an API and some things that I should have done differently. My initial approach to the project was very ineffective and therefore caused me more time in the long run. One of the most important steps that you can do is to create an entity-relational diagram(ERD). The one shown below is the one that I used for Rails Engine.

Press enter or click to view image in full size
Entity Relational Diagram

The most challenging part of the project to me was the business intelligence endpoints. Building large queries does prove to be a challenging task, especially if you are doing the famous spaghetti on the wall approach. Having said that, getting a business intelligent endpoint to pass was probably one of the most satisfying parts of this project.

Press enter or click to view image in full size
Simple yet beautiful.

If I could redo the project all over again, I would doubtlessly take a longer time initially setting everything up. I can’t stress enough how important it is to have all the relations mapped out and have the outline of the big picture. Having said that, It is critical to keep an agile workflow and follow the best path. Another portion of my Rails Engine that suffered was Test Driven Development (TDD) which was not strong towards the end. This was due to lack of time, but as stated above taking that extra time to write a test or to plan the project will save you time in the long run.

--

--

Silver
Silver

Written by Silver

Coffee/Code/Crypto(SilverC.eth)