Rustlavel

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

CrateFeatureWhat it is
rustlavelalwaysA Laravel-inspired full-stack web framework for Rust
rustlavel-aiaiRustlavel 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-authauthSessions, argon2 hashing, CSRF, signed URLs, encryption, API tokens, TOTP with a QR encoder, and impersonation
rustlavel-auditauditAn audit trail: who did what, to which record, from where — written to the database beside the data it describes
rustlavel-billingbillingSubscriptions 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-cachecacheMemory, file and a from-scratch Redis driver that also speaks to Valkey (valkey://), rate limiting, and idempotency keys
rustlavel-chartchartCharts for Rustlavel: a typed builder that produces a Chart.js configuration, and the vendored library to draw it — no CDN, no inline script
rustlavel-cliseparate binaryThe rustlavel command-line tool: new (with the auth starter kit), serve, make:*, migrate, doctor, build
rustlavel-clientclientOutbound HTTP on Tokio with TLS from rustls, transparent gzip, and a circuit breaker
rustlavel-corealwaysRustlavel application lifecycle, config, .env, and internal instrumentation
rustlavel-dbdbDrivers for PostgreSQL, MySQL and SQL Server with TLS; query builder, schema, migrations, ORM, pagination
rustlavel-debugbardebugbarA development overlay showing what the current request actually did: queries, cache, timing
rustlavel-discoverydiscoveryA service registry and the client that uses it: register, resolve, replicate — Eureka-compatible on the wire
rustlavel-flagsflagsRuntime feature switches resolved per user, with an incident switch in .env
rustlavel-gatewaygatewayAn API gateway: a route table, hop-by-hop headers dropped, X-Forwarded-* set, one health endpoint for every upstream
rustlavel-httpalwaysHTTP/1.1 server, router and middleware; CORS, compression, ETag, request ids, health probes, timeouts, API resources and versioning
rustlavel-i18ni18nRustlavel translations and localization
rustlavel-ldapldapLDAP for Rustlavel: bind, search, and authenticating a user against a directory
rustlavel-ledgerledgerA double-entry ledger for credits: atomic debit and credit, holds that capture or release once, credits that expire by batch
rustlavel-macrosalwaysDerive macros for Rustlavel, notably #[derive(Model)]
rustlavel-mailmailRustlavel mail: MIME messages, an SMTP client written on Tokio, and multi-channel notifications
rustlavel-mcpmcpRustlavel Model Context Protocol support: server, client, stdio and HTTP transports
rustlavel-metricsmetricsPrometheus metrics for Rustlavel, gathered from the instrumentation bus
rustlavel-model-cachemodel-cacheA second-level cache for models: entities by key and query results, invalidated by a per-table generation, over memory, file, Redis or Valkey
rustlavel-oauthoauthOAuth 2.1 for Rustlavel: the shared protocol types, and the client half
rustlavel-oauth-provideroauth-providerBe an OAuth 2.1 provider: authorization code + PKCE, refresh rotation, revocation, introspection
rustlavel-openapiopenapiGenerate an OpenAPI document from a Rustlavel router
rustlavel-otelotelOpenTelemetry for Rustlavel: traces, metrics and logs exported over OTLP
rustlavel-paymentpaymentPayment gateways behind one trait: VA, QRIS, e-wallet, retail, transfers; a webhook receiver that verifies and deduplicates
rustlavel-rbacrbacRoles and permissions for Rustlavel: assignment, checking, and route guards
rustlavel-queuequeueRustlavel queues: background jobs, workers, scheduling, and a dead-letter store
rustlavel-searchsearchElasticsearch and OpenSearch for Rustlavel: indexing, search, bulk operations, and log shipping
rustlavel-storagestorageRustlavel file storage: local disk and S3-compatible object stores
rustlavel-telescopetelescopeRustlavel Telescope: an in-process debugging dashboard for requests, queries, and logs
rustlavel-validationvalidationRustlavel validation: Laravel-style rules with 422 JSON error responses
rustlavel-vaultvaultSecrets from OpenBao or HashiCorp Vault: KV, dynamic database credentials, leases
rustlavel-viewviewRustlavel templating: Blade-inspired layouts, sections, and automatic escaping
rustlavel-webauthnwebauthnPasskeys for Rustlavel: WebAuthn registration and authentication, written on the W3C specification
rustlavel-wswsRustlavel 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.