Expand description
§Serenade
Serenade is a Symfony-oriented application framework for Rust: a kernel with bundles, a dependency-injection container, an event dispatcher, layered configuration, and optional components (HTTP, security, messaging, views, forms, …) that applications compose.
serenade-framework is the public entry point for normal Serenade consumers.
It re-exports a curated, stable surface of the serenade-* implementation
crates. Those crates stay independently published and usable; the facade
never owns their implementation.
Website: https://serenade.rs. Guides: https://docs.serenade.rs.
[dependencies]
serenade = { package = "serenade-framework", version = "1.0.0" }The package rename imports the crate as serenade instead of
serenade_framework (cargo add serenade-framework --rename serenade).
The executable named serenade is shipped by the separate serenade-cli
package. The crates.io package serenade is unrelated to this project.
§Features
The default build contains only the framework foundations (kernel,
config, di, event). It needs no web server, database, Leptos,
or Rangular.
| Feature | Module | Enables |
|---|---|---|
| (default) | kernel, config, di, event | Foundations |
console | console | serenade-console |
bundle | bundle | serenade-bundle |
http | http, http::client | serenade-http, serenade-http-client |
http-actix | http::actix | http + serenade-http-actix |
http-axum | http::axum | http + serenade-http-axum |
http-client-reqwest | http::client::ReqwestHttpClient | Reqwest outbound client |
session | session | serenade-session |
security | security | serenade-security |
security-oauth / security-ldap | security | OAuth / LDAP helpers |
validation | validator | serenade-validator |
lock | lock | serenade-lock |
rate-limiter | rate_limiter | serenade-rate-limiter |
scheduler | scheduler | serenade-scheduler |
scheduler-messenger | scheduler | Scheduler dispatch through the message bus |
messenger | messenger | serenade-messenger |
mailer | mailer | serenade-mailer (no transport backend) |
mailer-smtp / mailer-esp | mailer | SMTP / ESP transports |
notifier | notifier | serenade-notifier |
view | view | serenade-view (engine neutral) |
view-leptos-ssr / view-leptos-client | view | Leptos SSR / hydrate support |
form | form | view + serenade-form |
Integration features (*-reqwest, *-smtp, *-esp, *-oauth, *-ldap,
view-leptos-*, scheduler-messenger) are never implied by their base
feature.
Crates outside this surface (for example serenade-cache,
serenade-workflow, serenade-translation, serenade-testing) are used
directly by depending on them.
§Example
use serenade::prelude::*;
struct Shop;
impl BundleInterface for Shop {
fn name(&self) -> &'static str {
"shop"
}
}
let mut app = App::new(Environment::Test);
app.register_bundle(Shop).expect("register");
app.boot().expect("boot");
assert_eq!(app.kernel().bundle_names(), vec!["shop"]);
app.shutdown().expect("shutdown");Modules§
- bundle
- Bundle composition and framework bundle.
- config
- Layered configuration: dotenv, TOML/YAML packages, env overlays.
- console
- Console application (
bin/consoleanalogue). - di
- Dependency injection container.
- event
- Synchronous event dispatcher.
- form
- HTML forms: binding, CSRF, rendering, multipart.
- http
- Framework-agnostic HTTP foundation: request, response, routing, middleware, kernel.
- kernel
- Application kernel, bundles, environment, and lifecycle.
- lock
- Named locks.
- mailer
- Email messages and transports.
- messenger
- Command and event message bus.
- notifier
- SMS and push notifications.
- prelude
- Common imports for application code built on the default feature set.
- rate_
limiter - Rate limiting.
- scheduler
- Scheduling.
- security
- Authentication, authorization, CSRF, and password hashing.
- session
- Session bag, stores, flash messages, and middleware.
- validator
- Constraint validation for DTOs and commands.
- view
- HTML view helpers and document composition (template-engine neutral).
Functions§
- version
- Facade crate version (matches every
serenade-*crate in the same release).