Our friend Luis Figueroa which is a web programming expert, has recommended that we try and share a modern web framework for Ruby called Hanami that has multiple features, excellent portability and usability, as well as a web interface that will please more than one.
What is Hanami?
Hanami is an open source web framework that we can classify as "full-stack" since it allows us to program both the Front-end and the back-end of an application, it has been developed by Luca guidi using ruby.
The tool provides us with a series of modules that can be used in their entirety or separately, they are structured as follows:
- Hanami :: Model: Persistence with entities, data repositories and mapper.
- Hanami :: View: Presentation with a separation between views and templates.
- Hanami :: Controller: Full-featured, fast, verifiable actions for the Rack.
- Hanami :: Validations: Contains MixIn validations for Ruby objects
- Hanami :: Router: A Ruby / Rack HTTP router
- Hanami :: Helpers: Helpers for our Ruby applications
- Hanami :: Mailer: Mail for Ruby applications
- Hanami :: Assets: Asset Management (On going ) from Ruby
- Hanami :: Utility: For handling Ruby core extensions and class utilities.
The tool also comes equipped with a console that is an interactive system for REPL based IRB , which is useful for interacting with objects defined in a project.
Hanami Characteristics
Among the many features that Hanami offers us, we can highlight:
- An excellent level of modularity with tools that allow us to develop from simple projects to the most complex.
- Clean, intuitive, fast interface with enviable usability.
- A web framework with very fast response times.
- It has a series of integration with the most modern technologies, it is also equipped with comprehensive security policies, which will give us the possibility of developing applications that are secure from their origins.
- It comes equipped with more than 100 features that will allow us to develop applications in a simple way.
- Hanami takes special care of the use of memory, so its functionalities are aimed at saving it, ensuring its developers that Hanami tends to consume 60% less memory than the other web frameworks for Ruby.
- It is a simple tool to write any type of application quickly and with a clear principle of code maintainability.
How can I use Hanami?
To use Hanami we must have Ruby installed, which for example in Ubuntu and derivatives is done as follows:
sudo apt-get install rubygems
Once we have rubygems installed, we follow the following steps:
- We download and install hanami
gem install hanami
- We create the hanami instance and run the server
hanami new bookshelf
cd bookshelf && bundle bundle exec hanami server
- Then we can access the framework if we visit the following url http: // localhost: 2300
We can find extensive documentation for the use of Hanami hereSimilarly, the source code of the web framework for Ruby is available in the github official app.