Skip to main content

Crate arcature

Crate arcature 

Source
Expand description

Arcature — an opinionated full-stack Rust web framework.

One package, batteries included. cargo add arcature is enough for the canonical generated application: HTTP routing, native Inertia, database, auth, validation, cache, storage, mail, jobs, events, and the arc CLI.

§Quick start

use arcature::prelude::*;

#[arcature::main]
async fn main() -> Result<()> {
    Application::new()
        .routes(Routes::new([Route::get("/", index).name("home")]))
        .run()
        .await
}

async fn index() -> Result<Response> {
    Ok(text(StatusCode::OK, "hello"))
}

§Philosophy

Arcature integrates proven wheels (Axum, Tower, Tokio, SeaORM, SQLx, Inertia, OpenDAL, lettre, tracing) and owns the developer experience: the application lifecycle, conventions, integration, and a coherent vocabulary. The raw Axum/Tower/SeaORM escape hatches stay available for when the framework’s opinions run out.

Re-exports§

pub use application::Application;
pub use application::ApplicationBuilder;
pub use application::EngineError;
pub use application::Lifecycle;
pub use application::LifecycleState;
pub use application::Resources;
pub use http::json;api or inertia
pub use http::RedirectResponse;
pub use http::no_content;
pub use http::redirect;
pub use http::text;
pub use routing::IntoRoutes;
pub use routing::Middleware;
pub use routing::Next;
pub use routing::Route;
pub use routing::RouteGroup;
pub use routing::RouterState;
pub use routing::Routes;
pub use dx::Bound;api and database and dx
pub use dx::ApplicationGraph;dx
pub use dx::ControllerMetadata;dx
pub use dx::ControllerMethod;dx
pub use dx::Empty;dx
pub use dx::FieldShape;dx
pub use dx::GraphError;dx
pub use dx::Inject;dx
pub use dx::Json;dx
pub use dx::ModuleDescriptor;dx
pub use dx::ModuleNode;dx
pub use dx::Page;dx
pub use dx::Provider;dx
pub use dx::RequestCacheDescriptor;dx
pub use dx::RequestMetadata;dx
pub use dx::Resolve;dx
pub use dx::ResourceMetadata;dx
pub use dx::RouteDescriptor;dx
pub use dx::RouteMethod;dx
pub use dx::Service;dx
pub use dx::page;dx
pub use dx::Command;dx
pub use dx::CommandError;dx
pub use dx::CommandFuture;dx
pub use dx::CommandRegistry;dx
pub use dx::CommandBinding;dx
pub use dx::JobBinding;dx
pub use dx::DbFromState;database and dx
pub use dx::RouteModel;database and dx
pub use dx::RequestCache;dx
pub use dx::RequestCacheKey;dx
pub use inertia::AssetVersion;inertia
pub use inertia::Inertia;inertia
pub use inertia::InertiaConfig;inertia
pub use inertia::InertiaError;inertia
pub use inertia::InertiaLayer;inertia
pub use inertia::InertiaRequest;inertia
pub use inertia::RootDocument;inertia
pub use inertia::ScriptBody;inertia
pub use inertia::default_root_document;inertia
pub use inertia::vite_root_document;inertia
pub use database::DatabaseConfig;database
pub use database::Db;database
pub use auth::Auth;auth
pub use auth::AuthError;auth
pub use auth::AuthManager;auth
pub use auth::AuthUser;auth
pub use auth::AuthzError;auth
pub use auth::CsrfConfig;auth
pub use auth::CsrfConfigError;auth
pub use auth::CsrfError;auth
pub use auth::CsrfLayer;auth
pub use auth::CsrfToken;auth
pub use auth::Current;auth
pub use auth::Flash;auth
pub use auth::FlashError;auth
pub use auth::FlashLevel;auth
pub use auth::FlashMessage;auth
pub use auth::LoginBuilder;auth
pub use auth::OptionalAuth;auth
pub use auth::OptionalCurrent;auth
pub use auth::PasswordHashError;auth
pub use auth::PasswordHashString;auth
pub use auth::PasswordHasher;auth
pub use auth::PasswordSecret;auth
pub use auth::PasswordVerifyError;auth
pub use auth::Policy;auth
pub use auth::RehashOutcome;auth
pub use auth::SameSite;auth
pub use auth::Session;auth
pub use auth::SessionBuildError;auth
pub use auth::SessionConfig;auth
pub use auth::SessionConfigError;auth
pub use auth::SessionError;auth
pub use auth::SessionKey;auth
pub use auth::SessionLayer;auth
pub use auth::SigningKeyReason;auth
pub use auth::UserLoader;auth
pub use auth::verify_password;auth
pub use validation::Request;validation
pub use validation::Validated;validation
pub use validation::ValidatedForm;validation
pub use validation::ValidatedJson;validation
pub use validation::ValidatedPath;validation
pub use validation::ValidatedQuery;validation
pub use validation::validate_or_problem;validation
pub use validation::validation_problem;validation
pub use validation::rejection::from_form_rejection;validation
pub use validation::rejection::from_json_rejection;validation
pub use validation::rejection::from_path_rejection;validation
pub use validation::rejection::from_query_rejection;validation
pub use cache::Cache;cache
pub use cache::CacheConfig;cache
pub use cache::CacheConfigError;cache
pub use cache::CacheConnectError;cache
pub use cache::CacheError;cache
pub use cache::CacheHealthError;cache
pub use cache::Namespace;cache
pub use storage::Disk;storage-fs
pub use storage::FsConfig;storage-fs
pub use storage::S3Config;storage-fs
pub use storage::Storage;storage-fs
pub use storage::StorageBuilder;storage-fs
pub use storage::StorageConfig;storage-fs
pub use storage::StorageConfigError;storage-fs
pub use storage::StorageConnectError;storage-fs
pub use storage::StorageError;storage-fs
pub use storage::StoragePath;storage-fs
pub use storage::StoragePathError;storage-fs
pub use mail::Email;mail
pub use mail::EmailAttachment;mail
pub use mail::EmailError;mail
pub use mail::Mail;mail
pub use mail::MailBuilder;mail
pub use mail::MailConfigError;mail
pub use mail::MailSendError;mail
pub use mail::Mailable;mail
pub use mail::Mailer;mail
pub use mail::SmtpConfig;mail
pub use mail::SmtpCredentials;mail
pub use mail::TlsMode;mail
pub use jobs::ClaimedJob;jobs
pub use jobs::DEFAULT_MAX_PAYLOAD_BYTES;jobs
pub use jobs::EnqueueError;jobs
pub use jobs::EnqueuedJob;jobs
pub use jobs::Job;jobs
pub use jobs::JobError;jobs
pub use jobs::JobModel;jobs
pub use jobs::JobRequest;jobs
pub use jobs::JobStatus;jobs
pub use jobs::Jobs;jobs
pub use jobs::MigrateError;jobs
pub use jobs::RegisterError;jobs
pub use jobs::Registry;jobs
pub use jobs::RetryPolicy;jobs
pub use jobs::ScheduleBinding;jobs
pub use jobs::ScheduleCadence;jobs
pub use jobs::Scheduler;jobs
pub use jobs::SchedulerError;jobs
pub use jobs::Worker;jobs
pub use jobs::WorkerBuilder;jobs
pub use jobs::WorkerConfig;jobs
pub use jobs::WorkerError;jobs
pub use events::DispatchError;events
pub use events::Dispatcher;events
pub use events::Event;events
pub use events::ListenerBinding;events
pub use realtime::Broadcast;realtime
pub use realtime::SseEndpoint;realtime
pub use realtime::WebSocketEndpoint;realtime
pub use api::PROBLEM_JSON;
pub use api::Problem;
pub use api::ProblemBuilder;
pub use api::ProblemKind;
pub use observe::RequestId;observe
pub use axum;
pub use sea_orm;database
pub use validator;validation
pub use serde_json;

Modules§

api
API subsystem: RFC 9457 problem details and typed API responses.
application
The application composition root and lifecycle.
assets
Static assets: the Vite manifest, and serving public/.
authauth
Authentication, sessions, authorization policies, password hashing, and CSRF protection.
cachecache
Cache subsystem: Valkey/Redis key-value cache over one multiplexed connection, with the Cache::remember cache-aside facade.
clicli
The arc CLI entry point.
config
Application configuration.
databasedatabase
Database: one pool, two first-class paths (SeaORM + SQLx).
dev_proxydev-proxy
The one-TCP-port development proxy (AP2.1-3).
dxdx
The Arcature application DX layer.
eventsevents
In-process typed event dispatch.
http
HTTP response vocabulary and helpers shared by all subsystems.
inertiainertia
Native Inertia.js server protocol.
jobsjobs
Durable background jobs on PostgreSQL, SQLite, or MySQL.
mailmail
Mail subsystem: SMTP mail over lettre, with the Mail::to(...).send(...) facade.
observeobserve
Observability: request IDs, access logging, JSON logs, metrics, trace context, and the OpenTelemetry pipeline.
pagespages
Static pages, assets, and the root HTML document.
prelude
The curated Arcature prelude.
proxy
Pre-routing proxy — application-owned global request policy (engine spec §4/§5). One responsibility per file (AGENTS.md §1).
realtimerealtime
Realtime WebSocket + SSE wrappers over axum.
routing
HTTP routing.
storagestorage-fs
Storage subsystem: object/file storage over OpenDAL, with a named-disk registry and the Storage::disk(name).put(...) facade.
templatestemplates
The canonical application templates and generator.
uaguag
The Unified Application Graph.
validationvalidation
Request validation built on the validator crate, integrated with Axum and RFC 9457 problem responses.

Macros§

applicationdx and macros
application! { pub App { .. } } — see application/mod.rs.
inertiainertia
The inertia!() macro renders an Inertia page with named props.
moduledx and macros
module! { pub Accounts { .. } } — see module/mod.rs.
page_macrodx and macros
page_macro!(ShowUserPage { .. }) — see page_macro.rs. Named page_macro rather than page because attribute and function-like macros share one namespace, and #[page("name")] already owns page.
redirectdx and macros
redirect!(route::...) — see redirect.rs.
routesdx and macros
routes! { pub app { .. } } — see routes/mod.rs.

Structs§

ValidationError
A single validation failure, keyed by the offending field path.

Enums§

Error
The single error type returned by Arcature framework code and the Result<T> alias used across the public API.

Constants§

FRAMEWORK_VERSION
The Arcature framework version, as MAJOR.MINOR.PATCH.

Traits§

Deserializeapi or auth or database or events or inertia or jobs or pages or validation
A data structure that can be deserialized from any data format supported by Serde.
DxComponent
The base trait that gives a framework component (job, event, etc.) its static name, used for dispatch lookup and inspection. Always available; the #[job] and #[derive(Event)] macros generate impl DxComponent.
Serializeapi or auth or database or events or inertia or jobs or pages or validation
A data structure that can be serialized into any data format supported by Serde.

Functions§

any
Route requests with the given handler regardless of the method.
bad_request
Shorthand for a bad-request error.
delete
Route DELETE requests to the given handler.
forbidden
Shorthand for a forbidden error.
from_fn
Create a middleware from an async function.
get
Route GET requests to the given handler.
head
Route HEAD requests to the given handler.
not_found
Shorthand for a not-found error.
options
Route OPTIONS requests to the given handler.
patch
Route PATCH requests to the given handler.
post
Route POST requests to the given handler.
put
Route PUT requests to the given handler.

Type Aliases§

Result
The framework Result alias. Every public Arcature function that can fail returns Result<T> (the T varies), so a controller writes Result<Response>.

Attribute Macros§

commanddx and macros
#[command("name")] — see command.rs.
controllerdx and macros
#[controller] — see controller.rs.
job_handlerdx and macros
#[job_handler] — see job_handler.rs.
listenermacros
#[listener(Event)] — see listener.rs.
mainmacros
Marks async function to be executed by the selected runtime. This macro helps set up a Runtime without requiring the user to use Runtime or Builder directly.
middlewaredx and macros
#[middleware] — see middleware.rs.
modelmacros
#[model(table = "users")] — see model.rs.
pagedx and macros
#[page("users/show")] — see page.rs.
policydx and macros
#[policy(Model)] — see policy.rs.
providerdx and macros
#[provider] — see provider.rs.
requestmacros
#[request] — see request.rs.
request_cachedx and macros
#[request_cache(name = "...", key = "...")] — see request_cache.rs.
resourcedx and macros
#[resource] — see resource.rs.
route_modeldx and macros
#[route_model(entity = ..., key_type = ...)] — see route_model.rs.
servicedx and macros
#[service] — see service.rs.

Derive Macros§

Deserializeapi or auth or database or events or inertia or jobs or pages or validation
DxComponentdx and macros
#[derive(DxComponent)] — see component.rs.
Eventmacros
#[derive(Event)] — see event.rs.
Jobmacros
#[derive(Job)] — see job.rs.
Serializeapi or auth or database or events or inertia or jobs or pages or validation