Generated by GPT-5-mini| Hanami (web framework) | |
|---|---|
| Name | Hanami |
| Developer | Luca Guidi; Slice; Ruby community |
| Released | 2014 |
| Programming language | Ruby (programming language) |
| Operating system | Cross-platform software |
| Genre | Web application framework |
| License | MIT License |
Hanami (web framework) is a Ruby-based Web application framework focused on modularity, performance, and simplicity. It was created to provide an alternative to Ruby on Rails by emphasizing lightweight components, explicit boundaries, and a clear separation of concerns. Hanami draws influence from established frameworks and architectural patterns used across software engineering practices and from contributors in the Ruby community.
Hanami originated as an effort by Luca Guidi and contributors affiliated with Slice and other open-source software projects to build a framework that contrasts with Ruby on Rails and frameworks like Sinatra and Padrino. Its design philosophy aligns with principles advocated in Domain-driven design, Clean architecture, and practices popularized by projects from GitHub and organizations such as Heroku. Hanami emphasizes small, testable components and encourages developers to adopt patterns used by teams at Shopify, Basecamp, and Engine Yard.
Hanami's architecture separates the application into well-defined components similar to ideas from Service-oriented architecture and Microservices applied at the application level. Core runtime is implemented in Ruby (programming language), with integrations for Rack (interface) middleware, adapters for PostgreSQL, SQLite, and MySQL via Sequel and ROM inspired patterns. Hanami provides modular subsystems for routing, controllers, views, assets, and background jobs, comparable to subsystems found in Symfony and Django. The framework supports deployment on platforms such as Heroku and Amazon Web Services, and integrates with Docker and Capistrano for operations.
Routing in Hanami follows a deterministic, explicit style akin to routing in Sinatra and Ruby on Rails, while promoting clear controller boundaries informed by practices from REST (Representational State Transfer) and conventions used by HTTP/1.1. Controllers are implemented as lightweight Ruby objects, embracing patterns seen in Command pattern usage within Enterprise architecture and influenced by design decisions in RSpec-testable controllers. The framework integrates with Rack (interface) and supports middleware stacking similar to approaches used by Express (web framework) and Koa (web framework).
Hanami supports view rendering using template engines common in the Ruby (programming language) ecosystem, such as ERB and adapters inspired by template systems used in Handlebars and Haml. The view layer enforces separation from the controller layer, following guidance from MVC-style frameworks like Ruby on Rails and Sinatra. Asset management integrates with tools influenced by Sprockets, Webpack, and frontend ecosystems around React (JavaScript library), Vue.js, and Angular (web framework), enabling pipelines similar to deployments by GitLab and Netlify.
Hanami’s data layer offers options reflecting the diversity of Ruby (programming language) persistence libraries, including support for Sequel (software), ROM and compatibility approaches used by ActiveRecord within Ruby on Rails. The framework encourages explicit repositories and value objects, echoing patterns from Domain-driven design and architectures employed by ThoughtWorks and Netflix for maintainable data access. Migration tooling and schema management align with practices established by ActiveRecord migrations and Flyway-style versioned migrations.
Hanami places emphasis on testability, integrating well with RSpec and Minitest test suites, and adopting testing patterns promoted by Kent Beck and contributors from Test Driven Development. Performance goals are comparable to lightweight frameworks such as Sinatra and microframeworks used at Pinterest and Twitter, with low memory footprint and fast boot times. Security considerations follow best practices from OWASP Top Ten guidance and platform hardening techniques used by Cloudflare and NIST recommendations, including protections against Cross-site scripting, Cross-site request forgery, and SQL injection when used with recommended adapters.
The Hanami ecosystem is supported by contributors across the Ruby community, with extensions, gems, and integrations available through RubyGems and collaborative development hosted on GitHub. Community resources and discussions occur on platforms such as Stack Overflow, Reddit, and developer blogs from organizations like Shopify, GitHub, and ThoughtWorks. Conferences where Hanami has been presented or discussed include RubyConf, RailsConf, and regional meetups organized by Ruby User Group chapters. The project’s governance and contribution practices reflect norms established by large open-source projects like Linux kernel and Kubernetes.
Category:Ruby (programming language) frameworks Category:Web frameworks