Module graph
Declare imports, providers, controllers, and exports in Rust. The graph stays visible to source inspection.
Rust backend framework · 1.0.4
A modular Rust backend framework for explicit services: typed dependency injection, module graphs, Axum routes, Tower middleware, validation, OpenAPI, observability, testing, and installable adapters.
cargo install cargo-nidus --version 1.0.4
cargo nidus new hello-nidus
cd hello-nidus
cargo run
use nidus::prelude::*;
#[controller("/users")]
struct UsersController {
service: Inject<UsersService>,
}
#[module(
providers(UsersService),
controllers(UsersController)
)]
struct AppModule;
Evaluation path
Core model
Declare imports, providers, controllers, and exports in Rust. The graph stays visible to source inspection.
Register dependencies by type with singleton, transient, request-scoped, lazy, optional, and factory patterns.
Compose Axum routers, Tower layers, guards, validation pipes, OpenAPI metadata, and error envelopes.
Use CLI inspectors and TestApp to verify route shape, module graph, OpenAPI output, and request behavior.
Framework surfaces
Lean core
Nidus does not smuggle vendor dependencies into every app. SQLx and cache support live in official crates with direct access to the underlying ecosystem clients.
Examples
The examples move from a first controller to production-shaped services, adapter wiring, and external app templates. Use them as a guided tour of the public crates before choosing your own service shape.
View all exampleshello-world and launchpad-api show the first controller, module, and server loop.
realworld-api and production-api cover validation, health, metrics, guards, limits, events, and jobs.
sqlx-app, cache-app, and integrations-production show optional official crates without bloating core.
external-support-desk and external-commerce use crates.io-style manifests for app-shaped examples.
Release proof
CLI install, facade dependency, and adapter crates are separated in docs.
Request IDs, context, health, metrics, CORS, limits, timeouts, security headers, tracing.
launchpad-api and realworld-api exercise modules, validation, OpenAPI, health, metrics, events, and jobs.
Local dry-runs prove packageability; crates.io, docs.rs, and Pages deployment stay explicit external steps.