← All work

RailYard

Draw your Rails models on a canvas, connect them with associations, and get a working Rails app out the other end.

I got tired of scaffolding Rails apps by hand. RailYard is a canvas where you drag models around, add fields and associations by clicking, and hit Generate. The whole thing is about 1,900 lines, no build step, no npm.

  • Drag from a model's right port to another's left port and pick the association type. Lines are colour-coded: belongs_to, has_many, has_one, has_and_belongs_to_many. A through association literally routes its line through the join model.
  • Validations and callbacks are picked from dropdowns and show up in the generated code.
  • Save the schema as JSON and load it back later.
RailYard canvas: User, Post, Comment, Tag and Tagging models as cards with fields, and colour-coded association lines between their ports
Five models and their associations. Blue is belongs_to, green dashed is has_many. The has_many :through line runs through Tagging.
The backend doesn't template Rails files. It writes the generator commands Rails already has and runs them.

The generated app lands in output/ with the database created and migrated. cd in, bundle install, rails server.