A high-performance Ruby framework with hexagonal architecture and easy to learn.
Hyraft is a high-performance Ruby API framework combining hexagonal architecture with Elevhyra frontend integration, enabling developers to build scalable, full-stack applications with clean layer separation and reactive client-side interactivity.
Features
- High Performance: Page renders, faster than most Ruby frameworks
- Hexagonal Architecture: Clean separation with ports, adapters, and use cases (concrete)
- Custom Template Engine:
.hyrfiles with metadata, displayers, transmuters, and manifestors - Multi-App Support: Run multiple applications under one framework
- Dual Server Mode: Web server (port 1025) + API server (port 1126) simultaneously
- Auto-Discovery: Automatic template and component discovery across apps
- Lightweight: Minimal dependencies, maximum performance
Hyraft Components
- Hyraft - Framework
(Main) - Hyraft-server - Server
(Switch Server) - Hyraft-rule - CLI
(Commands)
Installation
Install the gem and add to your application's Gemfile:
gem install hyraft --pre
Create a new Hyraft application:
hyraft do myapp
cd myapp
bundle install
Run server:
hyraft-server puma
or
hyr s puma
Visit:
http://localhost:1025
Project Structure
myapp/
├── app/ # APP folder
│ └── web/
│ │
│ └── display/ # Hyraft templates (.hyr files)
│ ├── pages/
│ │ ├── errors
│ │ ├── home
│ │ ├── layouts
│ │ └── segments
│ └── app.hyr
│
├── base-adapters/ # Output adapters
│ ├── in-api/
│ └── out-api/
│
├── circuit/ # Business logic (framework-independent)
│ ├── engine/ # File uploads (images, etc.)
│ ├── ports/
│
├── connectors/ # Business logic (framework-independent)
│ ├── cable/ # File uploads (images, etc.)
│ └── helpers/
├── framework/ # Framework tools
├── public/ # Static assets
│ ├── uploads/ # File uploads (images, etc.)
│ ├── icons/
│ ├── styles/
│ │ └── css/
│ │ ├── main.css
│ │ └── spa.css
│ ├── images/
│ │ ├── hyr-logo.png
│ │ └── hyr-logo.webp
│ ├── favicon.ico
│ │
│ └── index.html
├── routes
│ ├── api_routes.rb
│ └── web_routes.rb
│
├── setup/ # Setup
│ │
│ ├── database/
│ │ ├── migrations/ # Database schema
│ │ │ ├── 001_create_articles.rb
│ │ │ └── 002_add_image_to_articles.rb
│ │ │
│ │ └── sequel_connection.rb # Database configuration
│ │
│ ├── gems/ # Third party gems to import
│ │ ├── database.rb # Database gems
│ │ ├── load_all.rb # Load all gems
│ │ ├── utilities.rb # Utilities
│ │ └── web.rb # Web gems
│ │
│ ├── server/
│ │ ├── api-server.ru # Rack configuration
│ │ └── web-server.ru # Rack configuration
│ ├── environment.rb
│ └── error_config.rb
│
├── boot.rb
├── env.yml
├── Gemfile
└── package.json
# For template files ( .hyr )
VS Code Extension
Enhanced development experience with Hyraft extension for VS Code.
Install from VS Code:
# Open VS Code then press (ctrl + shift + x)
# Search for "Hyraft"
# Click Install
- In a VS Code extension, snippets are predefined pieces of code or text that can be inserted quickly using a trigger (a prefix) in the editor.
Official site
Visit: https://hyraft.com
Development
After checking out the repo, run bundle install to install dependencies.
Then, run rake test to run the tests.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/demjhonsilver/hyraft. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Hyraft project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.