Crystal web framework
The batteries-included framework for Crystal
Routing, controllers, views, a real ORM, generators and a CLI — with sane defaults, so building a web app feels like the framework is working for you.
- 992 specs passing
- SQLite + PostgreSQL
- Linux · macOS · Windows
One framework, the whole stack
Everything a web app needs ships together and agrees on conventions — typed at compile time, so renames break the build instead of the page.
Record — a real ORM
SQLite3 and PostgreSQL adapters, migrations with db/schema.cr, validations, callbacks, associations with batched eager loading, and a contract suite that runs against both backends.
Segment-based routing
Typed to: PagesController.index references, resources, constraints, globs and redirects.
Controllers
Per-request instances, typed params, filters, callbacks and content negotiation.
Views
Compile-time ECR with auto-escaping, layouts, partials and a form builder.
Sessions and auth
Signed cookies, flash, CSRF and full registration via altair g auth.
Secure by default
Security headers, request ids, sliding-window rate limiting and opt-in CORS.
CLI + generators
new, g scaffold, server, routes and database commands.
Performance
Measured under real load
A public k6 harness compares Altair with Express and Fiber on identical PostgreSQL-backed CRUD endpoints — 1,000 virtual users for 60 seconds.
Write · POST /items
13,167 req/s
1.8x Express throughput · best write max latency of all three.
Read · GET /items/:id
14,687 req/s
1.9x Express throughput · zero failed requests in every run.
Start here
Documentation
Install once, scaffold in seconds, and learn the framework guide by guide.