Introducing Brainstem, your companion for rich Rails APIs
summary
A Rails library named Brainstem appears on GitHub as a released API presentation layer that serializes ActiveRecord via presenters, versions those presenters, and exposes predictable JSON with sideloaded associations so complex graphs return in one network request. It adds filters, sorts, pagination, and reuses model scopes, and ships an adapter brainstem.js that provides an identity map for Backbone so client code loads relational models without repeated requests. Mavenlink uses it for internal and external APIs and it works in production.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:53What do you want in an API
- 5:13Fast API
- 7:10Motivation
- 11:57Presenters
- 15:13Filters Sorts
- 23:34Relational Models
- 24:23Design Decisions
- 27:12Filters
- 30:52Summary
related talks
40mUsing Backbone.js with Rails: Patterns from the Wild
32mReading Rails: A Visual Walkthrough of the...
28mBuilding in Rails, Backbone, and CoffeeScript
40mTrailblazer: A new Architecture for Rails
32mTrailblazer A New Architecture For Rails
29mBackbone.js, Jasmine and Rails: The Lust Story
29mBackbone.js, Jasmine and Rails: The Lust Story
35mCrossing the Bridge: Connecting Rails and Your Front-End Framework
