Resource Generation
Generate a complete backend resource with a single command:
neatnode g resource userNeatNode creates the full feature slice, updates route registration, and keeps the generated project coherent from the start.
Overview
Use resource generation when you want to add a new feature quickly without wiring each layer manually.
What gets generated
| File | Purpose |
|---|---|
user.controller.js | Request handlers |
user.service.js | Business logic |
user.route.js | Express routes |
user.validation.js | Input validation |
user.model.js | Database model |
Automatic Updates
Resource generation also updates the application wiring for you:
- Route registration in the central route index
- Import updates for the generated resource
Overwrite Protection
If the resource already exists, NeatNode stops instead of replacing files:
neatnode g resource user❌ Resource already exists.
Use --force to overwrite.Use --force when you want to regenerate the resource:
neatnode g resource user --forceRequirements
Resource generation is available only in supported templates and expects the standard NeatNode route markers to exist in the generated project.
- Supported templates only
- NeatNode route markers must be present
- A route registry must already exist
Generated Files
See the Generated Files page for a visual tree of the output and a short explanation of each file’s responsibility.