nestjs-boilerplate

Command Line Interface (CLI)


Table of Contents


Generate resource

Generate resource with the following commands:

For document oriented database (MongoDB + Mongoose)

npm run generate:resource:document -- --name=ResourceName

Example:

npm run generate:resource:document -- --name=Category

For relational database (PostgreSQL + TypeORM)

npm run generate:resource:relational -- --name=ResourceName

Example:

npm run generate:resource:relational -- --name=Category

Video guideline for relational database (PostgreSQL + TypeORM)

https://github.com/user-attachments/assets/f7f91a7d-f9ff-4653-a78a-152ac5e7a95d

For both databases

npm run generate:resource:all-db -- --name=ResourceName

Example:

npm run generate:resource:all-db -- --name=Category

Add property to resource

Property for document oriented database (MongoDB + Mongoose)

npm run add:property:to-document

Property for relational database (PostgreSQL + TypeORM)

npm run add:property:to-relational

Video guideline how to add property for relational database (PostgreSQL + TypeORM)

https://github.com/user-attachments/assets/95b9d70a-70cf-442a-b8bf-a73d32810e0c

Property for both databases

npm run add:property:to-all-db

Previous: Architecture

Next: Working with database