Packages
One crate per package. What you do not enable is never compiled.
Everything optional is a feature flag on the rustlavel meta-crate. Add what
you need and nothing else reaches your binary:
cargo add rustlavel --features db,view,auth
Or take a single package on its own, the way you would composer require one
Illuminate component:
cargo add rustlavel-db
This matters more than it sounds. The benchmark in this repository found a comparable Loco application shipping an SMTP client and three cloud storage backends it never used, because they are unconditional dependencies there. 14 MB against 4 MB, for an application that has neither a mailer nor object storage.
The full list
| Crate | Feature | What it is |
|---|---|---|
| rustlavel | always | A Laravel-inspired full-stack web framework for Rust |
| rustlavel-ai | ai | Rustlavel AI: one API for Anthropic, OpenAI and Ollama, with streaming, tools and a fake provider; speech to text with the time of every word over Whisper (OpenAI or self-hosted faster-whisper) or Deepgram |
| rustlavel-auth | auth | Sessions, argon2 hashing, CSRF, signed URLs, encryption, API tokens, TOTP with a QR encoder, and impersonation |
| rustlavel-audit | audit | An audit trail: who did what, to which record, from where — written to the database beside the data it describes |
| rustlavel-billing | billing | Subscriptions paid by invoice rather than auto-debit: a charge each cycle, access extended when the callback says paid, grace, and the reminders to send |
| rustlavel-cache | cache | Memory, file and a from-scratch Redis driver that also speaks to Valkey (valkey://), rate limiting, and idempotency keys |
| rustlavel-chart | chart | Charts for Rustlavel: a typed builder that produces a Chart.js configuration, and the vendored library to draw it — no CDN, no inline script |
| rustlavel-cli | separate binary | The rustlavel command-line tool: new (with the auth starter kit), serve, make:*, migrate, doctor, build |
| rustlavel-client | client | Outbound HTTP on Tokio with TLS from rustls, transparent gzip, and a circuit breaker |
| rustlavel-core | always | Rustlavel application lifecycle, config, .env, and internal instrumentation |
| rustlavel-db | db | Drivers for PostgreSQL, MySQL and SQL Server with TLS; query builder, schema, migrations, ORM, pagination |
| rustlavel-debugbar | debugbar | A development overlay showing what the current request actually did: queries, cache, timing |
| rustlavel-discovery | discovery | A service registry and the client that uses it: register, resolve, replicate — Eureka-compatible on the wire |
| rustlavel-flags | flags | Runtime feature switches resolved per user, with an incident switch in .env |
| rustlavel-gateway | gateway | An API gateway: a route table, hop-by-hop headers dropped, X-Forwarded-* set, one health endpoint for every upstream |
| rustlavel-http | always | HTTP/1.1 server, router and middleware; CORS, compression, ETag, request ids, health probes, timeouts, API resources and versioning |
| rustlavel-i18n | i18n | Rustlavel translations and localization |
| rustlavel-ldap | ldap | LDAP for Rustlavel: bind, search, and authenticating a user against a directory |
| rustlavel-ledger | ledger | A double-entry ledger for credits: atomic debit and credit, holds that capture or release once, credits that expire by batch |
| rustlavel-macros | always | Derive macros for Rustlavel, notably #[derive(Model)] |
| rustlavel-mail | mail | Rustlavel mail: MIME messages, an SMTP client written on Tokio, and multi-channel notifications |
| rustlavel-mcp | mcp | Rustlavel Model Context Protocol support: server, client, stdio and HTTP transports |
| rustlavel-metrics | metrics | Prometheus metrics for Rustlavel, gathered from the instrumentation bus |
| rustlavel-model-cache | model-cache | A second-level cache for models: entities by key and query results, invalidated by a per-table generation, over memory, file, Redis or Valkey |
| rustlavel-oauth | oauth | OAuth 2.1 for Rustlavel: the shared protocol types, and the client half |
| rustlavel-oauth-provider | oauth-provider | Be an OAuth 2.1 provider: authorization code + PKCE, refresh rotation, revocation, introspection |
| rustlavel-openapi | openapi | Generate an OpenAPI document from a Rustlavel router |
| rustlavel-otel | otel | OpenTelemetry for Rustlavel: traces, metrics and logs exported over OTLP |
| rustlavel-payment | payment | Payment gateways behind one trait: VA, QRIS, e-wallet, retail, transfers; a webhook receiver that verifies and deduplicates |
| rustlavel-rbac | rbac | Roles and permissions for Rustlavel: assignment, checking, and route guards |
| rustlavel-queue | queue | Rustlavel queues: background jobs, workers, scheduling, and a dead-letter store |
| rustlavel-search | search | Elasticsearch and OpenSearch for Rustlavel: indexing, search, bulk operations, and log shipping |
| rustlavel-storage | storage | Rustlavel file storage: local disk and S3-compatible object stores |
| rustlavel-telescope | telescope | Rustlavel Telescope: an in-process debugging dashboard for requests, queries, and logs |
| rustlavel-validation | validation | Rustlavel validation: Laravel-style rules with 422 JSON error responses |
| rustlavel-vault | vault | Secrets from OpenBao or HashiCorp Vault: KV, dynamic database credentials, leases |
| rustlavel-view | view | Rustlavel templating: Blade-inspired layouts, sections, and automatic escaping |
| rustlavel-webauthn | webauthn | Passkeys for Rustlavel: WebAuthn registration and authentication, written on the W3C specification |
| rustlavel-ws | ws | Rustlavel WebSockets: RFC 6455 handshake and framing, plus channel broadcasting |
Not packages: the middleware in the box
Several things an API needs are not feature flags, because they live in
rustlavel-http and are always compiled. Nothing is on until you add it:
App::new()?
.middleware(TrustProxies::from_config(app.config()))
.middleware(RequestId::new())
.middleware(Cors::from_config(app.config()))
.middleware(Compress::new())
.middleware(ETag::new())
.middleware(Timeout::seconds(10))
.middleware(BodyLimit::kilobytes(64))
.plugin(Health::new())
TrustProxies is the one to reach for first behind a load balancer. Without
it req.ip() is the balancer’s address — true, but not useful. It is
opt-in on purpose: reading X-Forwarded-For from anyone who sends it does not
tell you where a request came from, it lets the sender choose, and the rate limiter keys on
exactly that value.
Two packages that are split on purpose
rustlavel-oauth holds the wire vocabulary — scopes, the RFC 6749 error codes,
PKCE, the token response — and the client half, the one you use to sign users in
through Google or GitHub. rustlavel-oauth-provider depends on it for those
types, so both ends of the protocol agree on the format by construction rather than by
review.
rustlavel-auth carries its own simpler Scopes type for API
tokens. That duplication is deliberate: personal access tokens must not drag an OAuth
dependency into the authentication crate.
The starter kit
rustlavel new app --with auth-kit is scaffolding rather than a feature flag.
It turns on the packages it needs — auth, db,
view, validation, rbac, webauthn,
cache, mail — and writes the controllers, views, routes and
migrations into the project, where they belong to you. The
guide covers what you get.
Databases
PostgreSQL, MySQL and SQL Server, each wire protocol written here, each with TLS. Oracle is deliberately excluded — its network protocol has never been published, so a driver means either wrapping the proprietary OCI library or a multi-year reverse-engineering effort, and neither fits a framework whose premise is that the protocols are written here.