Skip to content

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 04 Aug 22:36
· 40 commits to main since this release

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 coreAltair::Application subclass 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 smarter resources pluralizer.
  • Controllers — per-request instances, render (html/text/json),
    redirect_to, head, merged typed params (fetch/require/permit),
    send_file / stream, _method override, and rescue_from exception
    mapping.
  • Views — compile-time .ecr templates with typed locals, auto-escaping
    by default, layouts with yield, partials, helpers (incl. block
    components), a form builder, and an optional htmx layer.
  • Smart error pages — debug-mode 404 with route suggestions, 405 with
    _method hints, and full 500 diagnostics; plain text in production.
  • Request hardening — a 2 MB body limit answers 413 before the body
    is read.
  • Middleware pipelineuse-based stack with Logger and Static
    (path-traversal protected).

Altair::Record — the ORM

  • Wave 1 — foundation: adapter interface with SQLite3 and PostgreSQL,
    pooled connections, transactions and savepoints, migrations DSL + runner
    with schema_migrations and auto-regenerated db/schema.cr, on_query
    instrumentation.
  • Wave 2 — models: table macro 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_one with
    batched eager loading via Relation#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 controller and the full
    altair g scaffold Post title:string body:text write ready-to-edit
    files with a seeded db/schema.cr.
  • altair install copies the binary onto your PATH, 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) with SHA256SUMS, and the fail-safe
    scripts/install.sh / install.ps1 / install.cmd download, 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