Application Developer
Learn how to build scalable server-side applications with NestForge. Get Started
Introduction to NestForge, the modular backend framework for Rust.
NestForge is a framework for building efficient, scalable Rust server-side applications. It uses a modular architecture inspired by NestJS, bringing familiar patterns like Dependency Injection, Modules, and Middleware to the high-performance world of Rust.
In recent years, the Rust ecosystem has seen incredible growth in web development. However, while crates like Axum, Tokio, and Tower provide amazing foundations, they often leave the developer to figure out their own architectural patterns. This can lead to fragmented codebases that are difficult to scale and maintain.
NestForge provides an out-of-the-box application architecture which allows developers and teams to create highly testable, scalable, loosely coupled, and easily maintainable applications. The architecture is heavily inspired by NestJS, but built from the ground up to leverage Rust’s unique strengths: Zero-cost abstractions, Memory safety, and Fearless concurrency.
#[get("/")] to define your API surface.#[nestforge::version("1")] and the factory version helper.If you’re coming from the NestJS world, you’ll feel right at home. Here’s how the concepts map:
| NestJS (TypeScript) | NestForge (Rust) |
|---|---|
@Module() | #[nestforge::module] |
@Controller() | #[nestforge::controller] |
@Injectable() | #[nestforge::provider] or plain structs registered in modules |
NestFactory.create() | NestForgeFactory::create() |
| Pipe / ValidationPipe | ValidatedBody<T> |
NestForgeFactory::<AppModule>::create()? .with_global_prefix("api") .with_version("v1") .listen(3000) .await?;The default HTTP scaffold keeps the application bootstrap files at the root of
src/:
src/ app_config.rs app_controller.rs app_service.rs app_module.rs health_controller.rs main.rs#[controller("/versioning")]pub struct VersioningController;
#[routes]impl VersioningController { #[nestforge::get("/hello")] #[nestforge::version("1")] async fn hello_v1() -> String { "Hello from API v1".to_string() }}We recommend following the documentation in this order:
Whether you’re building a new API or helping us build the framework, we’ve got you covered.
Application Developer
Learn how to build scalable server-side applications with NestForge. Get Started
Framework Contributor
Help us build the future of Rust backend development. View Internal Docs