Hello NestForge
A walkthrough of the main example application and what each part demonstrates.
Example location
Section titled “Example location”The main HTTP reference application lives at:
examples/hello-nestforgeWhat this example demonstrates
Section titled “What this example demonstrates”This example is the best single entry point into the current framework because it shows:
- root module wiring in
src/app_module.rs - bootstrap flow in
src/main.rs - feature modules for
users,settings, andversioning - configuration loading and validation
- global prefix and OpenAPI mounting
- guards and interceptors
- DTO validation
- route versioning
- response serialization
Boot flow
Section titled “Boot flow”The runtime sequence in the example is:
main.rscreates the app withNestForgeFactory::<AppModule>::create()- the app sets a global
/apiprefix - generated docs are mounted through
with_openapi_docs(...) - a global guard and interceptor are attached
- the server listens on port
3000
AppModule
Section titled “AppModule”src/app_module.rs is the center of the example. It:
- imports feature modules
- registers root controllers
- creates app configuration through
ConfigModule::for_root - creates the database provider
- exports shared providers
Feature modules
Section titled “Feature modules”The users feature demonstrates CRUD routes, DTOs, validation, and service injection.
Settings
Section titled “Settings”The settings feature demonstrates a similar structure plus runtime config access.
Versioning
Section titled “Versioning”The versioning feature demonstrates version-specific routes such as:
/api/v1/versioning/hello/api/v2/versioning/hello
Why this example matters
Section titled “Why this example matters”If you are unsure how to structure a real NestForge app, this example is the current best-practice baseline because it combines multiple framework concepts in one runnable project.