Backend Development
This section covers building Stately backends with Rust, including entity definitions, state management, API generation, and plugin integration.
Core Crates
Plugin Crates
Macros
The stately-derive crate provides three main macros:
#[stately::entity]- Define entities with name traits#[stately::state]- Generate state management infrastructure#[stately::axum_api]- Generate HTTP API handlers
See Entities and State for detailed usage.
Core Types
EntityId- UUID v7 identifiersLink<T>- Entity relationships (see Links)Collection<T>- Entity collectionsSingleton<T>- Single-instance containers
Quick Reference
Minimal Entity
Minimal State
Minimal API
Feature Flags
Enable features in Cargo.toml: