slave-framework
The runtime behind applications created with
slave, a Laravel-inspired Rust framework for
MCP-first apps. You normally get it through slave new rather than adding it
by hand.
| Module | Provides |
|---|---|
server |
serve(router, host, port): an Axum server with graceful shutdown on Ctrl+C / SIGTERM |
env |
.env loading and typed settings (var_or, parse_or) |
logging |
tracing setup driven by RUST_LOG |
database (feature database) |
A SurrealDB connection over WebSocket (SURREAL_URL, default ws://127.0.0.1:8000; SURREAL_NS, SURREAL_DB, SURREAL_USER, SURREAL_PASS, SURREAL_AUTH_LEVEL), the transaction! macro (commit/cancel, retry on conflicts), and migrations: SurrealQL files applied in order, each in one transaction |
auth (feature auth) |
Passwordless sign-in: Auth::send_code / verify_code (a 6-digit code by email over SMTP, SMTP_URL and MAIL_FROM; logged in debug builds without SMTP), passkeys (WebAuthn via webauthn-rs, PASSKEY_RP_ID and PASSKEY_ORIGIN), and server-side sessions (create_session, session, end_session). Only hashes of codes and tokens are stored. Needs OpenSSL. |
testing (feature testing) |
TestDatabase: a fresh database per test on the SurrealDB server in TEST_SURREAL_URL |
database and auth are on by default. Template apps in a slave workspace use
default-features = false; the backend turns on auth and database, and its
tests add testing.
async
See the slave README for the full framework. License: MIT.