Rails Sync Async Boilerplate

screenshot of Rails Sync Async Boilerplate

Ruby on Rails sync/async with authorization/sanitization/serialization mechanisms (boilerplate)

Overview

The Ruby on Rails Sync / Async (boilerplate) is a project that aims to provide a clear and maintainable structure for Ruby on Rails codebases, regardless of their size. It also offers the ability to develop a single endpoint that can be used with classic API, polling, or websockets, reusing the same authorization, sanitization, and serialization mechanisms.

The project addresses concerns such as messy code in growing codebases and reducing the size of controllers by separating actions into different files. It also aims to simplify the process of adding polling or websocket functionality without duplicating code or adding complexity to the codebase.

Features

  • Clear and maintainable code structure: The project suggests structuring the code using intermediary files such as "services" to avoid code becoming too concentrated in controllers or models.

  • Separate actions in different files: The project aims to reduce the size of controllers by separating actions into different files, allowing for better organization and focus on the main goals of the controllers such as authorization, sanitization, and serialization.

  • Single endpoint for synchronous and asynchronous access: The project offers the ability to develop one endpoint that can be accessed synchronously or asynchronously, while reusing the same authorization, sanitization, and serialization mechanism. This reduces the need for duplicating code and simplifies maintenance.

Summary

The Ruby on Rails Sync / Async (boilerplate) project offers a solution for structuring code in Ruby on Rails projects to maintain clarity and avoid messiness. It provides separate files for actions, focuses on the main goals of controllers, and avoids excessive use of gems for authorization and serialization. Additionally, it simplifies the development of endpoints that can be accessed synchronously or asynchronously, while reusing the same authorization, sanitization, and serialization mechanism. Overall, this project aims to improve the maintainability and flexibility of Ruby on Rails codebases.