Expand description
ryuk: a Laravel-style full-stack framework on axum.
Every module is a Cargo feature (all on by default via full):
| feature | adds |
|---|---|
sessions | session layer |
inertia | Inertia protocol, Vite assets, flash/errors |
auth | argon2 passwords, Auth extractors |
validation | Form<T> extractor |
openapi | utoipa docs at /docs and /openapi.json |
db | SeaORM connect + migrations |
queue | database-backed jobs (needs db) |
api | web/api route groups, ApiAuth, JSON errors, CORS |
apikeys | API keys for machine clients |
oauth-server | OAuth2 authorization server |
social | social login (GitHub, Google) |
passkey | WebAuthn/FIDO2 passkeys (needs auth, db, sessions) |
push | device registry, FCM + APNs push notifications |
mail | log / SMTP mailer |
s3 mcp | S3-compatible disk, Model Context Protocol server |
storage http cache events schedule | disks, HTTP client, cache, events, scheduler |
gate crypt notifications lang | policies, encryption + signed URLs, notifications, localization |
csrf | CSRF middleware (Inertia/axios compatible) |
safety | login throttle, one-time tokens (needs db) |
sqlite postgres mysql | database drivers (URL scheme picks one) |
session-db session-file session-moka session-redis | session stores |
Modules§
- api
- The machine-facing route groups:
Principal,ApiAuth, JSONApiErrors,Corsand the rate limiter.App::api/App::publicwrap their routes with these (and never with sessions or CSRF). - apikey
- Machine-to-machine API keys (table
api_keys, self-created, SQLite/PostgreSQL/MySQL). - app
- Application builder and env-driven
Config. - auth
- Sessions, password hashing and the
Authextractors. - cache
- Application cache with a Laravel-style API: JSON values (serde), per-key TTL, atomic
addandincrement. - crypt
- Authenticated encryption and signed URLs, shaped like Laravel’s
CryptandURL::signedRoute. Both are keyed fromAPP_KEY(base64:+ 32 bytes, the same format as Laravel; make one withCrypt::generate_key). - csrf
- CSRF protection, compatible with axios / Inertia (they echo the
XSRF-TOKENcookie asX-XSRF-TOKEN). - db
- SeaORM connection and migrations.
- events
- Event dispatcher, shaped like Laravel’s events: listeners are keyed by event type and run in registration order.
- gate
- Authorization gates and policies, shaped like Laravel’s
Gate. - health
/healthz(liveness) and/readyz(readiness) endpoints.- http
- Outbound HTTP client, shaped like Laravel’s
Httpfacade, overreqwest. - inertia
- Inertia.js protocol for axum: JSON on
X-Inertiarequests, HTML shell otherwise. - lang
- Localization (feature
lang): translation files,:nameplaceholders, simple pluralization andAccept-Languagenegotiation. No extra dependencies. - Mail:
Mailbuilder +Mailerwith log (default) and smtp drivers. - mcp
- Model Context Protocol server (Laravel
laravel/mcpshaped): tools, resources and prompts served over Streamable HTTP (request/response JSON) or newline-delimited stdio. - notifications
- Laravel-style notifications: one message, delivered over several channels
(feature
notifications=mail+db). - oauth_
server - OAuth2 authorization server (RFC 6749 + PKCE 7636 + revocation 7009 + introspection 7662).
- openapi
- OpenAPI spec at
/openapi.jsonand Scalar UI at/docs. - passkey
- Passkey (WebAuthn/FIDO2) registration and discoverable sign-in (table
passkeys, self-created, SQLite/PostgreSQL/MySQL). Wraps Kanidm’swebauthn-rs: no hand-rolled CBOR/COSE/attestation parsing. Featurepasskeyneedsauth,db,sessions. - prelude
use ryuk::prelude::*;everything an app handler needs from the enabled features.- proxy
- Trusted proxies and the
ClientIpextractor. - push
- Push notifications: device registry (
push_devices, self-created), aNotificationbuilder and aPushservice with FCM HTTP v1 (Android) and APNs HTTP/2 (iOS) providers. - queue
- DB-backed background jobs (tables
jobs/failed_jobs, self-created). - s3
- S3-compatible storage disk: AWS S3, MinIO, Cloudflare R2, Backblaze B2, DigitalOcean Spaces,
Wasabi, Garage, RustFS. AWS Signature V4 is implemented here over
reqwest(no AWS SDK). - schedule
- Task scheduler, shaped like Laravel’s: declare tasks in code, tick once a minute.
- security
- Default hardening layers: security headers, body limit, timeout, panic catching, request ids.
- session
- Cookie sessions (tower-sessions 0.14). Inertia flash/errors and
authboth sit on this. - social
- Social login: an OAuth2 client for GitHub and Google (authorization code + PKCE S256 +
state). - storage
- Named filesystem disks, shaped like Laravel’s
Storagefacade. - tenancy
- Multi-tenancy: organizations, memberships with roles, and email invitations (tables
orgs,org_members,org_invites, self-created, SQLite/PostgreSQL/MySQL). Featuretenancy(theMemberextractor also needsauth). - throttle
- DB-backed login throttling (table
login_attempts, self-created, SQLite/PostgreSQL/MySQL). - tokens
- DB-backed single-use tokens for email verification and password reset
(table
one_time_tokens, self-created, SQLite/PostgreSQL/MySQL). - validation
- Validated request bodies.
Form<T>accepts urlencoded or JSON and runsvalidator.