Ruby on rail is our main backend framework at Overloop


Controllers

Serializers

Params

Jobs

Commands

Sidekiq

Services

RSpec

Models

Tips and tricks

🏠 HOME








The Magic Ingredient

3 words: Conventions over configuration.


Basics

Ruby on Rails

Ruby on Rails (also known as rails) is a web application framework (backend), which presents as a set of ruby gems (aka libraries).


Code Organization

Framework

Rails organization is made around some main components, making what we call the MVC framework:

At Prospect, we don’t really use the View part of Rails, since we’re using Ember for the frontend, and reserve it for a very little subset of elements (mails, PDFs, …). That’s the API configuration of Rails.

Apart from that, Rails also includes a set of other components:

Components

Rails also come with some components:


MVC & Service Oriented Architecture

To implement that in Rails, we decided to split our code in two parts:

Business logic:

Technical elements:

All the technical components of our applications that do not relate to business logic:

Rules

We define strict rules on the roles of each elements:

The relation between those elements is unidirectional: technical elements can call business logic, but not the opposite.

Source: https://study.dnsimple.com/resources/maintaining-rails-hanami/

Source: https://study.dnsimple.com/resources/maintaining-rails-hanami/

As you can see, we use a variety of classes to implement this service oriented architecture.

We will talk about each and every one of them in the subsection of this page. It will allow you to see how we implemented our framework and see a complete flow of execution.

If you discover Rails and our framework for the first time, we highly recommend you to check these out. You can start by learning about controllers, then just continue the flow from there.


References

Documentation

Ruby on Rails API

Ruby on Rails Guides

Interesting newsletters

This week in Rails