npm install -g nestjs-app-schematicsOr, install from git:
git clone https://github.com/jamesblackjr/nestjs-app-schematics.git
cd nestjs-app-schematics
npm install && npm linkRun the Nest CLI generate command with the -c flag to import the nestjs-app-schematics collections from your project directory.
Generate a new NestJS application:
npm i -g @nestjs/cli
nest new <project-name>
cd <project-name>TODO: Generate config folder contents and TypeORM config file. Coming soon.
Generate the Authentication module (TODO: Fix pluralization of module import.):
nest generate -c nestjs-app-schematics auth-module [path]Install Dependencies with NPM:
npm install --save @nestjs/typeorm @nestjs/passport @nestjs/jwt typeorm pg bcryptjs config passport passport-jwt class-validator class-transformerInstall Dependencies with Yarn:
yarn add @nestjs/typeorm @nestjs/passport @nestjs/jwt typeorm pg bcryptjs config passport passport-jwt class-validator class-transformerGenerate a TypeORM module:
nest generate -c nestjs-app-schematics typeorm-module <model-name> [path]TODO: Wire up relationships between entities. (i.e. Model to User)
Start your application in DEVELOPMENT mode:
npm run start:dev
yarn start:devOther Generators (NOT Compatibile with Auth Module Out-of-the-Box):
nest generate -c nestjs-app-schematics graphql-module <model-name> [path]
nest generate -c nestjs-app-schematics mongoose-module <model-name> [path]
nest generate -c nestjs-app-schematics prisma-module <model-name> [path]
nest generate -c nestjs-app-schematics sequelize-module <model-name> [path]Note: Replace <model-name> with the singular form of your entity/data model name.
Credits:
- Some
schematicswere ported from https://github.com/ashinzekene/generator-nestjs-app. - Also, the
utilsfolder was cloned from https://github.com/nestjs/schematics.