allframe-core 0.1.16

AllFrame core - complete web framework with HTTP/2 server, REST/GraphQL/gRPC, DI, CQRS
docs.rs failed to build allframe-core-0.1.16
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: allframe-core-0.1.17

allframe-core

The composable Rust API framework

Crates.io Documentation License Rust

AllFrame is a protocol-agnostic Rust web framework built with Test-Driven Development. Write your handler once, expose it via REST, GraphQL, and gRPC.

Features

  • Protocol-Agnostic Routing - One handler, multiple protocols (REST, GraphQL, gRPC)
  • CQRS + Event Sourcing - Production-ready CQRS infrastructure with 90% less boilerplate
  • Compile-time DI - Dependency injection resolved at compile time
  • Auto Documentation - OpenAPI 3.1, GraphQL schemas, and gRPC reflection
  • Zero Runtime Dependencies - Just Tokio and Hyper
  • 100% TDD - Every feature has tests before implementation

Quick Start

[dependencies]
allframe-core = "0.1"
tokio = { version = "1.48", features = ["full"] }
use allframe_core::router::Router;

#[tokio::main]
async fn main() {
    let mut router = Router::new();

    router.register("get_user", |user_id: String| async move {
        format!("User: {}", user_id)
    });

    // Handler now available via REST, GraphQL, or gRPC!
}

Protocol-Agnostic Example

use allframe_core::router::{Router, RestAdapter, GraphQLAdapter, GrpcAdapter};

let mut router = Router::new();
router.register("get_user", get_user_handler);

// REST
let rest = RestAdapter::new();
rest.route("GET", "/users/:id", "get_user");

// GraphQL
let graphql = GraphQLAdapter::new();
graphql.query("user", "get_user");

// gRPC
let grpc = GrpcAdapter::new();
grpc.unary("Users", "GetUser", "get_user");

Features

Default Features

allframe-core = "0.1"
# Includes: di, openapi, router, otel

All Features

allframe-core = { version = "0.1", features = [
    "di",              # Dependency injection
    "openapi",         # OpenAPI documentation
    "router",          # Protocol-agnostic routing
    "router-graphql",  # GraphQL support
    "router-grpc",     # gRPC support
    "router-full",     # All protocols
    "cqrs",            # CQRS + Event Sourcing
    "otel",            # OpenTelemetry tracing
] }

Optional CQRS Features

allframe-core = { version = "0.1", features = [
    "cqrs",            # Core CQRS infrastructure
    "cqrs-sqlite",     # SQLite event store (WAL mode, zero network deps)
    "cqrs-allsource",  # AllSource Core event store
] }

Offline-First Features (NEW in v0.1.15)

allframe-core = { version = "0.1", features = [
    "offline",         # Full offline bundle (cqrs + sqlite + di + security)
] }

The offline feature enables SQLite-backed event sourcing, lazy DI initialization, and security utilities with zero network dependencies. Ideal for desktop apps, embedded systems, and LLM wrappers that need to work without internet.

CQRS Example

use allframe_core::cqrs::{CommandBus, Event, EventStore};

#[derive(Command)]
struct CreateUser {
    name: String,
    email: String,
}

#[derive(Event)]
struct UserCreated {
    id: Uuid,
    name: String,
}

// 90% less boilerplate with automatic dispatch!
let mut bus = CommandBus::new();
bus.register(create_user_handler);
bus.execute(CreateUser { /* ... */ }).await?;

Documentation

Examples

# REST API
cargo run --example rest_api

# GraphQL API
cargo run --example graphql_api

# gRPC API
cargo run --example grpc_api

# Multi-protocol
cargo run --example multi_protocol

Why AllFrame?

Feature AllFrame Actix Axum Rocket
TDD-First ✅ 100%
Protocol-Agnostic
Built-in CQRS
Compile-time DI
Offline-First
Zero Runtime Deps

Contributing

Contributions welcome! See CONTRIBUTING.md.

License

Licensed under either of:

at your option.

Resources