Skip to content

Arvo Web Framework

Named after Arvo Pärt—tintinnabuli for web software: pure compiler-verified domain logic paired with thin, capability-confined web edges in a single standalone binary (zero Node in production, zero Redis/Celery).

module Main
use Api
use Routes
api
port 8080
sqlite db from "app.sqlite"
static "/assets" from "public/assets"
auth Routes.Member via Routes.authenticate
get "/login" Routes.show_login
post "/login" Routes.post_login
post "/logout" Routes.post_logout
get "/" Routes.home
scope "/items"
post "" Routes.create_item
post "/:id/run" Routes.run_item
end
job "nightly_cleanup" Routes.cleanup every 24.hours
status Routes.Unauthenticated = 401
status Routes.Forbidden = 403
status Routes.NotFound(_) = 404
status Routes.Conflict(_) = 409
status Routes.BadInput(_) = 422
status Routes.ServerFailed(_) = 500
end
Module Responsibility
Arvo.Cookie RFC 6265 cookie parsing & injection-safe Set-Cookie builders (HttpOnly, Secure, SameSite).
Arvo.Session AES-256-GCM encrypted cookies backed by revocable SQLite arvo_sessions rows storing only SHA-256 token digests.
Arvo.Csrf Session-bound double-submit CSRF compatible with @inertiajs/react and Axios (XSRF-TOKEN / X-XSRF-TOKEN).
Arvo.Auth Email normalization, constant-time allowlists, scrypt password hashing, and login/logout helpers.
Arvo.Flash AEAD-sealed short-lived flash cookie across 303 See Other redirects.
Arvo.Form Bounded application/x-www-form-urlencoded and multipart/form-data parsers.
Arvo.Inertia Inertia v2 server protocol, Vite HMR dev vs. hashed manifest.json production shells, 409 Conflict & partial reloads.
Arvo.Changeset Ecto/Ash-style validation accumulator returning Inertia useForm().errors JSON payloads.
Arvo.Migrations Checksummed transactional SQLite migrations tracked in _arvo_migrations.
Arvo.Audit Append-only arvo_events audit log with ULID keys and optimistic concurrency checks.
Arvo.Jobs Durable SQLite background job queue (arvo_jobs) with BEGIN IMMEDIATE claiming and retries.
Arvo.WebTest Stateful cookie-jar, CSRF, and Inertia v2 test client running with zero sockets via ApiTest.send.