| Crates.io | allframe-core |
| lib.rs | allframe-core |
| version | 0.1.12 |
| created_at | 2025-12-05 01:59:28.225115+00 |
| updated_at | 2025-12-15 01:35:32.112584+00 |
| description | AllFrame core - complete web framework with HTTP/2 server, REST/GraphQL/gRPC, DI, CQRS |
| homepage | https://all-source-os.github.io/all-frame |
| repository | https://github.com/all-source-os/all-frame |
| max_upload_size | |
| id | 1967446 |
| size | 781,625 |
The composable Rust API framework
AllFrame is a protocol-agnostic Rust web framework built with Test-Driven Development. Write your handler once, expose it via REST, GraphQL, and gRPC.
[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!
}
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");
allframe-core = "0.1"
# Includes: di, openapi, router, otel
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
] }
allframe-core = { version = "0.1", features = [
"cqrs", # Core CQRS infrastructure
"cqrs-allsource", # AllSource Core event store
] }
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?;
# 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
| Feature | AllFrame | Actix | Axum | Rocket |
|---|---|---|---|---|
| TDD-First | ✅ 100% | ❌ | ❌ | ❌ |
| Protocol-Agnostic | ✅ | ❌ | ❌ | ❌ |
| Built-in CQRS | ✅ | ❌ | ❌ | ❌ |
| Compile-time DI | ✅ | ❌ | ❌ | ❌ |
| Zero Runtime Deps | ✅ | ❌ | ✅ | ❌ |
Contributions welcome! See CONTRIBUTING.md.
Licensed under either of:
at your option.