NestJS TypeORM Schematics
@guachos/nestjs-typeorm-schematicsNestJS CLI schematics for generating custom resource scaffolding in projects with a TypeORM persistence layer. Speeds up the creation of modules, services, and repositories.
Installation
npm install @guachos/nestjs-typeorm-schematicsyarn add @guachos/nestjs-typeorm-schematicsWhy it exists
The standard `nest generate resource` command is great for basic CRUD, but as soon as you're using TypeORM with a repository pattern, you're back to manually writing the Entity class, the Repository provider, and the Data Access Object layer. These schematics extend the NestJS CLI to generate all that boilerplate wired together correctly — so you start from a fully functional scaffold instead of blank files.
Features
One `nest g` command creates a complete vertical slice: entity, repository, service, controller, and module — all correctly wired with TypeORM dependency injection.
Uses the Repository Pattern (inject `getRepositoryToken`) instead of active-record style, keeping your models clean and your services testable.
Highlights
- Generates Entity, Repository, Service, Controller, DTOs, and Module in one command
- Follows the Repository Pattern — TypeORM repository is injected, not extended
- Compatible with NestJS v9+ and NestJS v10+