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

MIT licensed · Star on GitHub

terminal — quick start
$ curl -fsSL https://github.com/Arab-Open-Source/Altair/releases/latest/download/install.sh | sh # verifies SHA-256, installs to ~/.local/bin $ altair --version Altair 0.3.x

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.

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, Fiber and a Ruby full-stack MVC app on identical PostgreSQL-backed CRUD endpoints — 100 virtual users for 60 seconds at an identical connection budget.

Altair

Write · POST /items

13,981 req/s

1.7x Express · 6.3x the Ruby full-stack arm · best write max of all four (25.2 ms, tighter than Go).

Altair

Read · GET /items/:id

13,619 req/s

1.8x Express · 4.6x the Ruby full-stack arm · deterministic tail on the official gcry collector.

Methodology

100 VUs · 60s

Full report — plus the official gcry collector: one flag removes Boehm's tail spikes.

FrameworkWrite req/sWrite p99Write maxRead req/sRead p99
Crystal logoAltair13,98113.8 ms25.2 ms13,61916.6 ms
Go logoFiber (Go)20,3009.8 ms36.8 ms18,99012.1 ms
Node.js logoExpress8,07423.2 ms65.5 ms7,67128.0 ms
Ruby logoRuby full-stack2,213407.0 ms1,072 ms2,975313.6 ms

100 virtual users, 60 seconds, one 20-connection / 6-worker budget for every framework. Altair holds second place on throughput with the best write tail of all four arms; the closest architectural peer — the Ruby full-stack arm — trails 6.3x on writes and 4.6x on reads.

Start here

Documentation

Install once, scaffold in seconds, and learn the framework guide by guide.

Install

One-command setup on Linux, macOS and Windows with checksum verification.

Usage

Create a project, generate a scaffold and run the server.

Guides

Routing, controllers, views, the ORM, sessions, security and uploads.

CLI reference

Every command and generator, with flags and examples.