crails
Version, currently main branch1 version
- main branchlatestNov 5, 2026
github.com/OrelSokolov/crails
Rails-port MVC framework on Crystal — the crails CLI and the full-stack framework
Installation
# Add this to your shard.yml
dependencies:
crails:
github: OrelSokolov/crails
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.21.0- License
- MIT
- Target
crailsfrom src/crails_cli.cr
Dependencies
Runtime Dependencies
- icr*github: OrelSokolov/icr.cr
- brotli~> 0.3.0github: OrelSokolov/brotli.cr
- erb_cr~> 0.1.0github: OrelSokolov/erb.cr
- railties_cr~> 0.1.18github: OrelSokolov/railties.cr
- importmap_cr~> 0.1.0github: OrelSokolov/importmap.cr
- propshaft_cr~> 0.1.0github: OrelSokolov/propshaft.cr
- project_watch~> 0.1.0github: OrelSokolov/project_watch.cr
- action_pack_cr~> 0.2.0github: OrelSokolov/action_pack.cr
- action_view_cr~> 0.1.0github: OrelSokolov/action_view.cr
- attr_reader_cr~> 0.1.0github: OrelSokolov/attr_reader.cr
- active_record_cr~> 0.1.0github: OrelSokolov/active_record.cr
- active_support_cr~> 0.1.0github: OrelSokolov/active_support.cr
README
CRails — Clean Rails - The most beautiful compiled web framework
Current status: a port of Ruby on Rails. At this point CRails is simply a port of Ruby on Rails to Crystal. We are porting the framework in its current form: the framework itself, its spirit and the beauty of its code. The code is being ported from Rails one-to-one, so that refactoring can happen later — this is a draft, not even a first release.
Philosophy
The project's philosophy — explicit contracts first, lessons from Rails and Ruby, why Crystal and not Rust, and the promises the framework intends to keep — lives in IDEA.md. It is effectively a roadmap and a promise for the future, not a description of what is already implemented.
Desktop and mobile now! 
CRails doesn't end at the server. With positron.cr the same stack ships desktop and mobile applications — go desktop, go mobile:
- the backend is a regular CRails application;
- the frontend is still plain HTML + CSS;
- all data work — models, queries, validations — lives on ActiveRecord
(
active_record.cr), embedded right into the client.
Compilation to a single native binary is what makes this possible: the whole app — views, models and the database layer — ships as one executable that runs as a native desktop application — a whole new world for desktop apps.
Installation
Install with carat package manager to get the binary:
carat install OrelSokolov/crails
crails new helloworld
The best performance in class
Median RPS, official once-campfire-verification harness, AMD Ryzen 9 3900X stand:
| Route | Rails | Express | Go | Rust | C | Elixir | CRails |
|---|---|---|---|---|---|---|---|
| room_show | 1 731 | 10 430 | 14 316 | 21 953 | 31 698 | 2 346 | 38 092 |
| messages_page | 1 641 | 16 248 | 14 336 | 21 539 | 32 114 | 2 480 | 37 553 |
| sidebar | 1 804 | 19 979 | 14 945 | 24 411 | 34 857 | 2 566 | 52 299 |
| search | 1 801 | 17 764 | 15 988 | 25 113 | 33 460 | 2 522 | 48 930 |
| avatar | 28 046 | 40 989 | 48 656 | 74 442 | 18 920 | 31 896 | 76 669 |
| static_css | 37 048 | 42 843 | 59 413 | 72 389 | 37 095 | 36 788 | 75 962 |
| /up | 2 571 | 20 531 | 29 238 | 36 557 | 62 890 | 4 230 | 82 265 |
| post_message | 166 | 1 015 | 2 442 | 2 935 | 1 303 | 556 | 2 033 |
Beats Rust in some cases, but with beautiful code and the MVC pattern — see more at the original repository.
Ecosystem
CRails is assembled from standalone shards, each living in its own repo under github.com/OrelSokolov:
Base (resolved by the root shard.yml):
- active_support.cr — core utilities, Concern, inflections
- attr_reader.cr — Ruby-style
attr_readermacros - erb.cr — ERB templating (ECR)
- action_view.cr — views, helpers, FormBuilder
- action_pack.cr — controllers, routing, middleware
- importmap.cr — importmap-based JS assets
- propshaft.cr — asset pipeline (+ brotli.cr precompression)
- active_record.cr — ORM, migrations, adapters (db/pg/sqlite3)
- railties.cr — the
crailsCLI, generators, app glue - icr.cr —
crails console - project_watch.cr —
crails watch
Optional layers (add to your app's shard.yml when needed):
- active_job.cr — background jobs
- action_cable.cr — WebSockets
- action_mailer.cr — email
- action_mailbox.cr — inbound email
- active_storage.cr — file uploads
- action_text.cr — rich text
- action_bot.cr — bots (webhooks + SSE)
- devise.cr — authentication
- turbo.cr — Hotwire Turbo
- live_view.cr — LiveView-style reactive views
- kiq.cr — Sidekiq-compatible jobs backend
- active_backup.cr — database backups
- action_mcp.cr + active_agent.cr — MCP servers and AI agents
- serverx.cr — nginx-model zero-alloc HTTP server (buffer per connection, offset parser, master/workers via SO_REUSEPORT), compatible with any
HTTP::Handler
License
MIT
What this is
A full clone of the Ruby on Rails API on Crystal, as 1:1 as possible in the end interface — so that a developer moving from Ruby/Rails feels no difference. Goal: Rails application code ports to Crystal nearly verbatim.
The practical differences from Ruby on Rails — the CRails namespace,
ERB → ECR, the crails command, nilable finders, keyword arguments,
type narrowing and other consequences of Crystal's static typing —
are collected in DIFFERENCES.md.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Nov 5, 2026
- Crystal
>= 1.21.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/OrelSokolov/crails
Metadata
- Created
- Oct 29, 2026
- Updated
- Nov 13, 2026
- Synced
- Nov 13, 2026
- Versions
- 1