Member-only story

How to Build a Good API with Rails 8

Azzen Abidi
5 min readAug 11, 2017

Whether you are writing code for a living or for fun, at some point you will find yourself building an API. The problem is building a good API is not as easy as it sounds.

But Rails makes your life easier.

Guide assumptions

This guide assumes you have a basic knowledge in programming and a good understanding of how an API works.

It should be treated as a brief introduction to API development in Rails.

A previous experience with Ruby and Rails is a bonus.

What you will need:

  • RubyOnRails on your machine.
  • A database server/engine : sqlite, mariabd, etc.
  • Code editor: I recommend Visual Code. Rubymine is amazing if you have some extra bucks to spare.
  • Internet Connection.

What makes a good API?

A good api has 4 traits

  • predictable and consistent: code reuse for api end points.
  • static: an api should not change in a breaking way.
  • simple and clear: an api should return what’s expected.
  • flexible: easy to scale and maintain.

Why Rails?

RubyOnRails is mostly known for rapid agile web apps development. Following the current trends, Integrating a frontend framework has become challenging and even time consuming.

In fact, modern web app architectures nowadays consist of a client app that consumes a JSON API. Indeed, Rails 5 introduced the api mode years ago ; A bootstrapped skeleton for api only apps.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Azzen Abidi
Azzen Abidi

Written by Azzen Abidi

Indie Hacker | Startup Mentor | Helped Flowfinitee generate an 8M USD pipeline as founding Marketer - Get in touch: azzen.abidi@gmail.com

Responses (7)

Write a response