v0.1.1
Altair v0.1.1
The first full public release: the batteries-included web framework for
Crystal, end to end — foundation, router, controllers, views, ORM, CLI and
generators — together with the documentation site and one-command
installers for every platform.
The framework
Phases 0–5 ship with passing specs.
- Application core — a conventional
Altair::Applicationsubclass with
typed per-environment config, singleton instance,rescue_fromexception
mapping, and a middleware pipeline (Logger+Staticwith path-traversal
protection). - Router — compile-time DSL (
get/post/put/patch/delete,
namespace,resources,root) with typed references to controller
actions, path helpers as real methods, 404/405 handling, and a wave of
post-launch additions:resourcesblocks withmember/collectionroutes and nesting- singular
resource :profile(six id-less routes, no-argument helpers) - glob segments (
/files/*path) and permanentredirect "/old", to: "/new" - per-route
constraints: { id: /\d+/ }and the implicit.{ext}format
suffix (/posts/5.json→params["format"]) - smarter pluralization (
notes,courses,addresses)
- Controllers — per-request instances,
render(html/text/json),
redirect_to,head, merged typed params (fetch/require/permit),
send_file/stream,_methodoverride. - Views — compile-time
.ecrtemplates with typed locals (a wrong local
is a compile error), auto-escaping by default, layouts withyield,
partials, helpers (including 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 (configurable) answers
413
before the body is read.
Altair::Record — the ORM
Shipped across three waves:
- Foundation — adapter interface with SQLite3 and PostgreSQL, pooled
connections, transactions and savepoints, migrations DSL + runner with a
schema_migrationstable and auto-regenerateddb/schema.cr,on_query
instrumentation. - Models —
tablemacro with compile-time 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. - Associations —
belongs_to/has_many/has_onewith batched
eager loading viaRelation#includes,dependent: :destroy/
:delete_all/:nullify, plus dirty tracking with partial updates and
JSON / decimal / bigint columns. - Performance and safety — lock-free connection lookup, fiber-safe
transaction state, single-statement saves for callback-free models, and a
configurable pool warm-up; the contract suite runs against both SQLite and
PostgreSQL.
CLI, generators and installers
altair new <name>scaffolds a runnable project (src/,db/,
public/,bin/altair+bin/altair.cmd).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.- Inside a project,
bin/altair server,bin/altair routes,
bin/altair db:migrateandbin/altair db:rollbackdrive the app. altair installcopies the binary onto yourPATH(~/.local/bin
on Unix,%USERPROFILE%\.altair\binon Windows), prints its SHA-256
digest, is idempotent and refuses to clobber an unrelated file without
--force.- Distributed installs —
release.yml(triggered by av*tag) builds
Linux/macOS/Windows binaries (amd64 + arm64) withSHA256SUMS, and the
fail-safescripts/install.sh/install.ps1/install.cmddownload,
verify and install in one command.
Website
A documentation site at https://arab-open-source.github.io/Altair/ —
landing page, install, usage, features and CLI reference — generated from
markdown in website/ and deployed to GitHub Pages.
Fixes
shards installinside a generated project no longer fails looking for a
prebuilt executable.altair newwrites a real executablebin/altairlauncher, so the
documented commands work exactly as written.- Running app commands through the global binary inside a project now points
you at the launcher instead of a bareUnknown command.
Try it
curl -fsSL https://github.com/Arab-Open-Source/Altair/releases/latest/download/install.sh | sh
altair new blog
cd blog && shards install && altair server