v0.1.0
Altair v0.1.0
The initial release — Altair, a batteries-included web framework for
Crystal, built end to end: foundation, router, controllers, views, ORM,
CLI and generators, all shipping with passing specs.
The framework
- Application core —
Altair::Applicationsubclass with typed
per-environment config, singleton instance, a boot banner, and a
top-level error boundary. - Router — compile-time DSL (
get/post/put/patch/delete,
namespace,resources,root), typed references to controller
actions, generated path helpers as real methods, 404/405 handling, glob
segments (/files/*path) and a smarterresourcespluralizer. - Controllers — per-request instances,
render(html/text/json),
redirect_to,head, merged typed params (fetch/require/permit),
send_file/stream,_methodoverride, andrescue_fromexception
mapping. - Views — compile-time
.ecrtemplates with typed locals, auto-escaping
by default, layouts withyield, partials, helpers (incl. block
components), a form builder, and an optional htmx layer. - Smart error pages — debug-mode 404 with route suggestions, 405 with
_methodhints, and full 500 diagnostics; plain text in production. - Request hardening — a 2 MB body limit answers
413before the body
is read. - Middleware pipeline —
use-based stack withLoggerandStatic
(path-traversal protected).
Altair::Record — the ORM
- Wave 1 — foundation: adapter interface with SQLite3 and PostgreSQL,
pooled connections, transactions and savepoints, migrations DSL + runner
withschema_migrationsand auto-regenerateddb/schema.cr,on_query
instrumentation. - Wave 2 — models:
tablemacro with typed attributes, CRUD,
find_by_*finders,pluck, validations (presence, length, numericality,
uniqueness, inclusion/exclusion, format, confirmation), automatic
timestamps, and the eight save/create/update/destroy callbacks. - Wave 3 — associations:
belongs_to/has_many/has_onewith
batched eager loading viaRelation#includes,dependent:handling. - The adapter contract suite runs against both SQLite and PostgreSQL.
CLI, generators and installers
altair new <name>scaffolds a runnable project (src/,db/,
public/, launchers for POSIX and Windows).altair g model/g migration/g controllerand the full
altair g scaffold Post title:string body:textwrite ready-to-edit
files with a seededdb/schema.cr.altair installcopies the binary onto yourPATH, prints its
SHA-256 digest, is idempotent and refuses to clobber an unrelated file
without--force.- Distributed installs — a release pipeline builds Linux/macOS/Windows
binaries (amd64 + arm64) withSHA256SUMS, and the fail-safe
scripts/install.sh/install.ps1/install.cmddownload, verify and
install in one command.
Benchmarks
k6 comparison scripts and results for Altair against Express and Fiber, a
Rails-vs-Altair staging harness, and the tail-latency investigation
write-up (examples/benchmark_k6, examples/rails-vs-altair).
Try it
shards build altair
./bin/altair new blog
cd blog && shards install && ./bin/altair server