The advanced
business logic framework

A powerful set of gems that
simplifies the implementation
of clean Ruby applications.

SOME CODE?

A mature and battle tested framework
used in thousands of applications

We streamline code organization

Trailblazer is a framework-agnostic set of gems helping to improve your app's code structure. It is used in hundreds of commercial Rails apps and was often introduced later on, after many years of extensive development, to reduce technical debt.

Missing abstractions

Most web frameworks have excellent abstractions for routing, rendering, and databases. When it comes to organizing business logic, however, you're left alone.

The existing places, such as controller actions, models, callbacks and hand-tailored service objects, lead to codebases hard to maintain.

Our toolbox

Instead of cluttering your code over the entire MVC framework, Trailblazer introduces a bunch of new abstractions, with a standard service object leading the way: the operation.

Code is organized into small chunks we call steps. The operation helps to structure your logic and takes over flow control.

Bullet-proof conventions

While you can focus on developing your app and writing code that matters, Trailblazer gives you automatic error handling by letting you apply the Railway pattern to your logic.

This not only saves you tons of if and elses but provides clever ways to reuse huge parts of your code by supplying inheritance and composition mechanics to structure your application.

Learn about operations

Who can use Trailblazer?

Developers and Teams
Companies with Legacy Codebase
Startups and Fast-Growing Companies
Growing Teams
Companies Emphasizing Test-Driven Development
Companies Prioritizing Long-Term Support

Our abstraction layers

Trailblazer's main objective: keep software maintainable. We do so by providing a range of additional abstraction layers, where code is moved from conservative "MVC" to new layers and objects.

class MemosController < ApplicationController
  def create
    if Memo::Operation::Create.(params: params)
      render
    end
  end
class Memo < ApplicationRecord
  belongs_to :user
  has_many :memos
end

Lean MVC

Move your business logic out of controllers and models.

Let controllers do routing and rendering, let models be SQL abstractions instead of being dumps for all sorts of application code. Your messy callback chains go to operations.

A place for business logic

Our service object operation takes over control flow, maximizes reusability with inheritance and composition, and lets your team focus on writing features.

module Memo::Operation
  class Create < Trailblazer::Operation
    step :validate
    step :save
    step :send_email
    step :increase_counter
    fail :errors
module Memo::Contract
  class Create < Reform::Form
    property :text
    property :author

    validates :text, presence: true
  end

Tackling Problems

Our self-contained solutions include form objects, representers for parsing and rendering, and our popular view component library.

Our main features

Multiple abstractions
In Trailblazer, we provide a set of solutions aiming for different problems. Our stand-alone gems range from structuring business logic to form objects, view components and much more. You pick what you need.
Legacy Ready
You can start using TRB in complex existing applications today. Refactorings can be applied step-wise, legacy code can be minimized as you go. Remember: Rome wasn't build in one day, either.
Long-Term Support (LTS)
TRB is in use in thousands of production applications. That's why we promise: Trailblazer 2.1 is long-term supported. Easy upgrades and stable APIs allow us to innovate and keep you covered.

What others say about
Trailblazer?

Trailblazer has been a game-changer for our development team. It has revolutionized the way we handle complex business logic in our Ruby applications. With Trailblazer, we've experienced a significant improvement in code organization, maintainability, and overall productivity.

Frankie, CEO Codebase

The architecture provided by Trailblazer has allowed us to separate concerns effectively, making our codebase cleaner and easier to understand while providing an intuitive way to handle errors using the railway pattern.

It's refreshing to see business logic extracted from controllers and models into dedicated operations, resulting in more focused and testable code.

Richard Böhme, Ruby Developer, webit! GmbH

One of the standout features of Trailblazer is its workflow- oriented approach. The ability to define and orchestrate activities in a clear and structured manner has greatly simplified our application's complex workflows. We can easily visualize and manage the sequence of steps, making it easier to reason about and maintain.

Brooke, Developer

A beginner's guide!

Our new tutorial book is published! Building an authentication library similar to Devise we discuss everything from software design basics to tools and library functions of Trailblazer 2.1.

Learn more

Subscribe to our newsletter !

2-3 mails per year with news about releases and things we're up to.