| Crates.io | nestrs-cli |
| lib.rs | nestrs-cli |
| version | 0.1.1 |
| created_at | 2026-01-17 23:55:32.969475+00 |
| updated_at | 2026-01-17 23:59:32.346489+00 |
| description | NestRS CLI - generate a NestJS-like Rust web API structure |
| homepage | https://github.com/SantiagoLopezDeharo/nestrs-cli |
| repository | https://github.com/SantiagoLopezDeharo/nestrs-cli |
| max_upload_size | |
| id | 2051439 |
| size | 37,183 |
NestRS is a lightweight, single-thread async Rust web API starter with a NestJS-like folder structure. This repository contains the CLI (nestrs) used to generate new NestRS projects.
Generate a new NestRS project:
nestrs new my-app
This will create a new folder with the full base structure and files.
src/
bin/
scaffold_entity.rs
domain/
dog/
controller.rs
service.rs
repo.rs
dto.rs
mod.rs
mod.rs
primitives/
http/
request.rs
response.rs
mod.rs
mod.rs
routing/
init.rs
mod.rs
main.rs
cargo run
The server listens on 127.0.0.1:8080.
init(init_routes()).routes() method returning Route definitions.Response, which is written back to the client.Use the scaffold CLI to generate a new domain entity:
cargo run --bin scaffold_entity -- Dog
This will:
src/domain/dog/ with controller/service/repo/dto files.src/domain/mod.rs.src/routing/init.rs.Routes are declared inside each controller’s routes() method using the route! macro:
Route::new("GET", &["dog"], route!(DogController::get_all))
Handlers receive:
RequestRouteParams (path params like :id are available via params.get("id"))curl http://127.0.0.1:8080/dog
The default Dog controller responds with:
Woof
Content-Length and Connection: close if not provided.