Expand description
Blixt is a Rust web framework built on Axum, Askama, and SQLx.
It provides compile-time safety for templates and SQL queries, SSE-based interactivity via Datastar, and automatic Tailwind CSS integration — with zero JavaScript build steps.
§Quick start
use blixt::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
init_tracing()?;
let config = Config::from_env()?;
App::new(config).router(Router::new()).serve().await
}Modules§
- app
- Application builder and server.
- auth
- Authentication: JWT, password hashing, extractors. Authentication and authorization primitives.
- cache
- Caching with in-memory and optional Redis backends. Caching abstraction with pluggable backends.
- config
- Environment-aware configuration.
- context
- Shared application state.
- datastar
- Datastar SSE responses and signals.
- db
- Database connection pools.
- error
- Error types and HTTP status mapping.
- flash
- Flash messages and redirects.
- form
- Form extraction with CSRF validation.
- health
- Health check endpoints.
- jobs
- Background job runner. Persistent job queue backed by Postgres or SQLite.
- logging
- Structured logging setup.
- mailer
- SMTP email sending.
- middleware
- HTTP middleware (CSRF, rate limiting, security headers).
- paginate
- Pagination support for database queries. Pagination support for database queries.
- prelude
- Common re-exports for Blixt applications.
- redact
- Secret-safe wrapper that redacts values in logs.
- storage
- File storage with local filesystem and optional S3 backends. File storage abstraction with local filesystem and optional S3 backends.
- testing
- Test utilities for Blixt applications.
- upload
- Multipart file upload handling with validation. Multipart file upload handling with validation and Storage integration.
- validate
- Input validation. Input validation with a fluent, type-safe builder API.
Macros§
- query
- Parameterized SQL query that only accepts string literals.
- query_
as - Parameterized SQL query with struct deserialization. Only accepts string literals.
- query_
scalar - Parameterized scalar query. Only accepts string literals.
- render
- Renders an Askama template and wraps it in an HTML response.
- require_
test_ db - Skips the current test if
TEST_DATABASE_URLis not set.