Building an API from scratch for a web application might sound challenging for a first-timer. But if you have the fundamental Ruby on Rails knowledge, you might even find it easier than you expected.

Image for post
Image for post

What is an API ?

Rails can serve as both the front-end and back-end of a website. It can also be configured specifically to work just as an API. So what is an API? Basically, API(Application Programming Interface) is a way for one system to communicate with other external systems. As perfectly explained on Ruby on Rails guides, when people say they use Rails as an “API”, it means developers are using Rails to build a back-end that is shared between their web application and other native applications. The reason most developer use Rails is that it provides a set of defaults that allows us to get up and running quickly. That is why instead of using Rails to generate view files that communicates with the server through forms and links, many developers are treating their web application as just an API client that responds with JSON. …

THUNK/THəNGk/ — verb, past tense: thunk; past participle: thunk “nonstandard or humorous past and past participle of think.”

Oxford’s English dictionaries

“Who would’ve thunk it?”

If you have already watched Dan Abramov’s instructional videos and read the official documentation, but still puzzled by the “Thunk” concept — Don’t worry you are not alone!

Image for post
Image for post

Would you like to add images to your small web app, googled & searched Stack Overflow in agony, got lost in gem hunting, and confused by all the information? This article is for you!

Image for post
Image for post

In coding schools, building small web apps is an essential part of the curriculum. In most cases, you end up building an app, listing your favorite books, DVDs, albums, movies, basketball/hockey/baseball cards, comicbooks, or something similar in nature. After looking into my classmates’ demos, noticing all the pretty images in their apps, I thought it would be great to display all the amazing cover art for my Comicbook App! Should be easy right? Not quite so.

In my case, searching and reading all Stack Overflow posts, questions, and comments turned into an agonizing process. First of all, there were many different ways to accomplish setting up, storing, rendering, and uploading an image in your app. There are so many fancy gems that could help you. However, if you are racing against time to deliver a school project, sometimes it really helps to keep it simple and go back to basics. Therefore, I decided to follow a very simple method: adding an image URL represented as a string and transmit it using JSON. I will use Rails as an API for creating my back-end and JavaScript for my front-end. (If you are interested in a step by step guide in building a rails API, please also check my The Startup article

Starting a new project is not the easiest task. Especially if you are new to Rails, and running between projects. Well, wouldn’t it be great if someone could just do some coding for us? No, we don’t need caffeine driven Jim Carrey with some divine powers! All we need are Rails Generators!

Image for post
Image for post

With one one-line command in your terminal, Ruby on Rails can create a model, controller, and view files associated with your application! You can even go one step further and add your controller actions and basically get a working app in a couple of minutes by using a Scaffold generator. However, if you are a beginner, Scaffolding comes with a warning. …

While working on my Sinatra CRUD application project at Flatiron School, one of the most important, if not the most, aspects of the project was to get a solid understanding of the Seven RESTFUL ROUTES, verbs to control CRUD actions on HTTP requests. If you are not familiar with the concept it may sound like a movie title parodying The Magnificent Seven or Seven Samurai.

So what are we talking about when we say Seven RESTFUL ROUTES and why do we need them?

Image for post
Image for post

To understand the real value of RESTful routes, let’s go back in time when the Internet was RESTless. Remember the old days where we would look at a ridiculously long URL on Netscape Navigator (or another browser/client) and have little to no chance to navigate through or change the domain path? In those dark ages(before 2000) there was no standard on how to design an API or use one on web applications. Most developers had to deal with protocols like SOAP (Simple Object Access Protocol) which were complex to build, manage, and hard to debug. …

Nowadays, I’m working on an app project that requires scraping, mapping, and iterating data from websites.

Frankly, building your first application with a cumulated software engineering knowledge of 4 weeks is not an easy task. When tasked to write a web scraper for my software engineering program at The Flatiron School, my initial reaction was to start panicking with a desire to scrape my own brain.

After spending some time with scraping, things started to come together and finally made some sense. In no way, I think of my self as an “expert” on this topic. …


Koray Ozkal

Software Engineer & Marketing Strategist -experience with top tech. companies inc. Cisco, Citrix, Hitachi, Apple, Facebook-former NBA writer & guitarist

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store