The Rust Web Framework
Armature
Build production-ready, Enterprise grade APIs with type-safe routing, dependency injection, and modular architecture inspired by Angular & NestJS.
use armature::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
struct User { id: u32, name: String }
// Injectable service with business logic
#[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() }))
}
#[post("")]
async fn create(req: HttpRequest) -> Result<Json<User>, Error> {
let user: User = req.json()?;
Ok(Json(user))
}
}
// 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();
} Why Armature?
Everything you need to build fast, reliable web APIs in Rust.
Type-Safe
Catch errors at compile time. Path parameters, query strings, and request bodies are fully typed.
Dependency Injection
Services are automatically injected into controllers. No manual wiring required.
Modular Architecture
Organize your app into modules with clear boundaries and dependencies.
High Performance
Built on Tokio for async I/O. Zero-cost abstractions mean no runtime overhead.
Built-in Security
JWT, OAuth2, and SAML authentication. Security headers and middleware included.
Powerful CLI
Generate controllers, services, and modules. Dev server with hot reloading.
Quick Start
Get up and running in seconds.