███╗ ██╗███████╗███████╗████████╗███████╗ ██████╗ ██████╗ ██████╗ ███████╗
████╗ ██║██╔════╝██╔════╝╚══██╔══╝██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝
██╔██╗ ██║█████╗ ███████╗ ██║ █████╗ ██║ ██║██████╔╝██║ ███╗█████╗
██║╚██╗██║██╔══╝ ╚════██║ ██║ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝
██║ ╚████║███████╗███████║ ██║ ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗
╚═╝ ╚═══╝╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
NestForge
NestForge is a high-performance backend framework designed for developers who crave the modularity and Dependency Injection (DI) of NestJS but want the memory safety and blazing speed of the Rust ecosystem.
[!IMPORTANT] Stable Release NestForge 1.0.0 is now published on crates.io.
What You Get
- Module system with
importsandexports - Dependency Injection with simple provider registration
- Controller macros (
#[controller],#[routes],#[get],#[post],#[put],#[delete]) - Request extractors (
Inject<T>,Param<T>,Body<T>,ValidatedBody<T>) - Built-in HTTP error type (
HttpException) - Guard and interceptor pipeline (global + route-level)
- Route versioning (
#[nestforge::version("1")]) - Global prefix support (
.with_global_prefix("api")) - Config module with env loading and schema validation
- Data layer crates (
nestforge-db,nestforge-orm,nestforge-data) - CLI for scaffolding, generators, DB migrations, docs skeleton, formatting
Workspace Layout
crates/nestforge: public crate users importcrates/nestforge-core: DI, module graph, route builder, validation, resource servicecrates/nestforge-http: app bootstrap factorycrates/nestforge-macros: framework macroscrates/nestforge-cli:nestforgeCLI binarycrates/nestforge-config: env/config loading and validationcrates/nestforge-db: DB wrapper and migrations supportcrates/nestforge-orm: relational ORM abstraction layercrates/nestforge-data: non-relational data abstractionsexamples/hello-nestforge: full example app
Quick Start (Repo)
Server runs on:
http://127.0.0.1:3000
Quick Start (CLI)
Install locally from this workspace:
Create an app:
Generate code:
DB commands:
Utilities:
Minimal App Bootstrap
use NestForgeFactory;
create?
.with_global_prefix
.
.
.listen
.await?;
Example App Features
examples/hello-nestforge demonstrates:
- Root controllers (
AppController,HealthController) at app root - Feature modules (
users,settings,versioning) in Nest-style folders - CRUD controllers + services with
ResourceService<T> - Validation via
ValidatedBody<T> - Guard/interceptor usage at route level
- Config loading with
ConfigModule::for_root - Versioned routes (
v1,v2)
Documentation
- Wiki: https://github.com/vernonthedev/nestforge/wiki
- Project docs: https://vernonthedev.github.io/nestforge/docs/Home.md
Contributing
See CONTRIBUTING.md.
License
Apache-2.0 (LICENSE).