Aaronmallen iconAaronmallenSep 30, 2026 ~8 min source read

Hanami, Why?: Introductions — why Aaron Allen built his site with Hanami

Aaron Allen explains why he chose Hanami for his personal site, how Hanami structures applications around small, single-purpose abstractions, and which libraries in the Hanami ecosystem handle dependency injection, typing, and result handling.

Share this story

Send the public story page.

Useful takeaways from this story.

Hanami emphasizes tiny, single-purpose components: Actions, Relations, Repos, and Operations constitute the main application building blocks.

The Hanami ecosystem relies on dry-system for dependency injection, dry-types for typing and validation, and dry-monads for Success/Failure result handling.

# What Aaron built and why Aaron Allen built his personal site with Hanami. The site looks like a standard blog but includes a number of backend features he uses daily: cross-posting to Bluesky and Mastodon, a private journal, a custom analytics engine, a messaging backend for contact form messages, a task manager that syncs with Linear and GitHub Issues, and an activity feed that aggregates commits, journal entries, posts, and tasks.

He chose Hanami because he found Rails overly prescriptive and had moved to Sinatra for freedom before discovering Hanami at RubyConf 2024. Since then he became a maintainer on the Hanakai team and started using Hanami for real projects.

# How Hanami organizes applications Hanami pushes toward small, single-purpose abstractions. The four core pieces Aaron highlights are:

  • Relations: the low-level model layer that handles database queries.
  • Repos: an optional higher-level persistence layer that wraps relations and returns plain data objects (structs) to avoid leaking persistence details.

This separation means a simple CRUD flow will typically be implemented across multiple classes: an Action for the HTTP interaction, a Repo or Relation for persistence, and an Operation for complex mutations.

# Supporting libraries in the Hanami ecosystem Aaron lists several supporting libraries that shape how Hanami apps are built:

  • dry-system: provides dependency injection. Classes include a Deps module to declare what they need, and the system injects instances automatically.
  • dry-types: offers a typing system used to validate and normalize inputs (Aaron notes he will show more about types later in the series).
  • dry-monads: gives Success and Failure result objects used by both Operations and Actions, which can simplify control flow when combined with pattern matching.

# What this means for developers

The practical effect on Aaron's own site is a collection of focused pieces: separate endpoints for different actions, an operation layer for mutations, and a typed validation layer for incoming data. He plans to explain these choices and patterns in more depth in upcoming posts of the "Hanami, Why?" series.

# Example snapshot Aaron includes a short code sketch (truncated in the shared excerpt) showing an Action that injects an operation, validates params, calls the operation, and handles Success/Failure cases. That example demonstrates the intended flow: dependency-injected operations, parameter validation via types, and pattern-matched result handling.

# What to expect next

More context around this story.

Kamiina Botan – Episode 3
Wrongeverytime iconWrongeverytimeSep 11, 2026

Kamiina Botan – Episode 3

Hello folks, and welcome back to Wrong Every Time. Today we’re checking in on Kamiina and her liquor-loving dormmates, as we lounge our way through a fresh episode of Botan Kamiina Fully Blossoms When Drunk. When last we left off, … Continue reading →

Tumblr iconTumblrSep 23, 2026

i have a few questions. first, who is the group on your desktop theme header? and then, the idols on the projects sidebar. i think the first one is a wasuta member but unsure. and,...

Hi Anon! The group on our desktop theme header is Tacoyaki Rainbow. Projects sidebar in order: Matsuda Miri from Wasuta, Hina from FAKY, Honda Hitomi from IZ*ONE, Dream Ami (soloist, from DREAM), and Hamagishi Hiyori from Hinatazaka46. Jpop winter/christmas songs that I can name off my head: Flower: Koibito ga Santa Cl

Welcome, thoughtbot!
Hanakai iconHanakaiSep 29, 2026

Welcome, thoughtbot!

Originally appeared on Hanakai . I’m so happy to share that thoughtbot is our newest silver sponsor! If you’ve written Ruby for any length of time, thoughtbot has most likely helped you out. Maybe it was a blog post , an episode of The Bike Shed , one of their many open source gems , or one of the lovely humans who wor

Aaronmallen iconAaronmallenSep 27, 2026

Hello, world!

Originally appeared on Writing | Aaron Allen . Hello, and welcome to my new website! My name is Aaron and I have been writing software since I was thirteen years old ( twenty-seven years ago ). I am a senior software engineer at Credit Ninja and have worked for companies like Root Insurance and Zillow . The main focus

Loading more related stories...

Keep reading in the app

Open the app view to save this story, compare related coverage, and continue from the same source.

Open in app