Quick Start
Build and run a first NestForge application with the current CLI and framework APIs.
Create a new application
Section titled “Create a new application”The fastest path into NestForge is the CLI:
nestforge new demo-apicd demo-apicargo runThat gives you a runnable HTTP app with:
src/main.rssrc/app_module.rs- root controllers
- service, DTO, guard, interceptor, and environment scaffolding
Create transport-first variants
Section titled “Create transport-first variants”The CLI also supports transport-specific templates:
nestforge new demo-graphql --transport graphqlnestforge new demo-grpc --transport grpcnestforge new demo-bus --transport microservicesnestforge new demo-events --transport websocketsThese templates change the bootstrap files and generated folders so the project starts from the chosen runtime model instead of from plain HTTP.
Minimal bootstrap
Section titled “Minimal bootstrap”The core HTTP bootstrap pattern is:
use nestforge::{NestForgeFactory, NestForgeFactoryOpenApiExt};
NestForgeFactory::<AppModule>::create()? .with_global_prefix("api") .with_openapi_docs("My API", "1.0.0")? .listen(3000) .await?;This is the main equivalent of NestFactory.create(AppModule) in NestJS terms.
Minimal module
Section titled “Minimal module”NestForge applications are wired through a module:
use nestforge::module;
#[module( imports = [], controllers = [AppController], providers = [load_app_config()?], exports = [])]pub struct AppModule;Modules are where you make feature boundaries explicit. They also determine provider registration order and export visibility.
Add a feature module
Section titled “Add a feature module”The CLI can generate a feature module:
nestforge g module usersnestforge g resource users --module usersThat pattern creates a Nest-style folder layout under src/users/ and patches the
application module so the feature becomes part of the app.
What to inspect next
Section titled “What to inspect next”After your first app boots, inspect these files in the generated or example app:
src/main.rsfor runtime bootstrapsrc/app_module.rsfor module wiringsrc/users/or another feature folder for the module pattern.envand.env.examplefor configuration assumptions
If you prefer to learn from a maintained example instead of from generated output, read Hello NestForge.