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.

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
View Cloud Providers Guide โ†’

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

View Examples on GitHub โ†’

Key Concepts

Dependency Injection

Services are automatically injected based on field types.

Learn more โ†’

Module System

Organize your application into reusable modules.

Learn more โ†’

Decorators (Macros)

Use Rust macros for clean, declarative code.

Learn more โ†’

Guards & Middleware

Apply cross-cutting concerns like auth and logging.

Learn more โ†’

Ready to build?

Get started with Armature in minutes.