Armature Documentation
Armature is a batteries-included, enterprise-grade web framework for Rust, inspired by NestJS and Angular.
98%
Feature Complete
150+
Features
8-15x
Faster than Node.js
100%
Type Safe
Quick Start
Terminal
# Install the CLI
$ cargo install armature-cli
# Create a new project
$ armature new my-api
$ cd my-api
# Start the dev server
$ armature dev
โ Server running at http://localhost:3000
Documentation Index
Explore the complete documentation organized by topic.
Core Guides
Authentication & Security
- Authentication Password hashing, JWT, guards, RBAC
- OAuth2 Providers Google, Microsoft, GitHub, Discord, and more
- Security Best Practices CORS, CSP, HSTS, request signing
- Advanced Security 2FA, WebAuthn, API keys
- Session Management Redis-backed sessions, cookies
- Rate Limiting Token bucket, sliding window algorithms
Routing & Controllers
API Features
Real-Time & Networking
GraphQL & OpenAPI
Background Processing
Caching & Data
Cloud Providers
Observability
Testing
Cloud Provider SDKs
First-class integrations with major cloud providers. Dynamic service loading, DI integration, and feature-flag based compilation.
| Crate | Provider | Services |
|---|---|---|
armature-aws | Amazon Web Services | S3, DynamoDB, SQS, SNS, SES, Lambda, KMS, Cognito |
armature-gcp | Google Cloud Platform | Storage, Pub/Sub, Firestore, Spanner, BigQuery |
armature-azure | Microsoft Azure | Blob, Queue, Cosmos, Service Bus, Key Vault |
Dynamic Loading โ Only compile services you need
DI Integration โ Register once, inject everywhere
Lazy Initialization โ Services created on first access
Emulator Support โ LocalStack, GCP emulators, Azurite
Code Example
A complete REST API in just a few lines of code.
use armature::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
struct User { id: u32, name: String }
// Injectable service
#[injectable]
#[derive(Default, Clone)]
struct UserService;
impl UserService {
fn find_by_id(&self, id: u32) -> Option<User> {
Some(User { id, name: "Alice".into() })
}
}
// Controller with routes
#[controller("/api/users")]
#[derive(Default, Clone)]
struct UserController;
impl UserController {
#[get("")]
async fn list() -> Result<Json<Vec<User>>, Error> {
Ok(Json(vec![User { id: 1, name: "Alice".into() }]))
}
#[get("/:id")]
async fn get_user(req: HttpRequest) -> Result<Json<User>, Error> {
let id: u32 = req.param("id").unwrap().parse().unwrap();
Ok(Json(User { id, name: "Alice".into() }))
}
}
// Module wires everything together
#[module(
providers: [UserService],
controllers: [UserController]
)]
#[derive(Default)]
struct AppModule;
#[tokio::main]
async fn main() {
let app = Application::create::<AppModule>().await;
app.listen(3000).await.unwrap();
} Examples
Working code samples in the examples/ directory.
crud_api.rs Complete REST API with CRUD operations
auth_api.rs JWT authentication flow
realtime_api.rs WebSocket/SSE real-time communication
dependency_injection.rs DI patterns and best practices
websocket_chat.rs WebSocket chat room
Key Concepts
Ready to build?
Get started with Armature in minutes.