0.3.1 • Published 2 months ago

scaffold-nestjs v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Scaffold Nest.js

Description

This generator will help you create a Nest.js application. You just need to answer the questions and get a ready-made application template.

Project Overview

  • Nest.js 9
  • Eslint
  • Docker
  • Husky
  • Supports MongoDB, MySql, Postgres
  • Supports Mongoose, Prisma, TypeORM, MikroORM
  • Ability to select services: Keycloak, MinIO and Novu

Installation

First, generate your new project:

npx scaffold-nestjs

Run your generated application:

cd <project name>
docker-compose up -d

Options

OptionsDescriptionExample
skip-installThis option disables installation of dependencies after code generation.npx scaffold-nestjs --skip-install
no-interactiveThis option disables answering questions in interactive mode.npx scaffold-nestjs --no-interactive
projectThis option allows you to set the name of the project (default is nest-js-project).npx scaffold-nestjs --project-name=nest-js-project
should-overwriteThis option allows you to overwrite an existing folder.npx scaffold-nestjs --should-overwrite
databaseThis option allows you to set the database.Allowed values: mongo, mysql or postgres.npx scaffold-nestjs --database=mongo
ormThis option allows you to set the orm.Allowed values for MongoDB: mongoose or prisma.Allowed values for MySql and Postgres: prisma, mikroorm or typeorm.npx scaffold-nestjs --orm=mongoose
no-need-authThis option disables the generation of authorization components.npx scaffold-nestjs --no-need-auth
authThis option allows you to set the authorization option.Allowed values: jwt.npx scaffold-nestjs --auth=jwt
servicesThis option allows you to add various services to the project.Allowed values: keycloak, minio, novu.npx scaffold-nestjs --services=keycloak,minio

For example:

npx scaffold-nestjs --no-interactive \
  --should-overwrite \
  --project-name=nest-js-project \
  --database=mongo \
  --orm=mongoose \
  --services=keycloak,novu

App skeleton

├── src
│   ├── database
│   │   ├── migrations
│   │   │   └── ...
│   │   ├── database.config.ts
│   │   └── database-factory.service.ts
│   ├── decorators
│   │   ├── auth-bearer.decorator.ts
│   │   ├── auth.decorator.ts
│   │   ├── roles.decorator.ts
│   │   └── serialization.decorator.ts
│   ├── exceptions
│   │   └── validation.exceptions.ts
│   ├── filters
│   │   ├── all-exceptions.filter.ts
│   │   ├── bad-request-exception.filter.ts
│   │   ├── forbidden-exception.filter.ts
│   │   ├── index.ts
│   │   ├── not-found-exception.filter.ts
│   │   ├── unauthorized-exception.filter.ts
│   │   └── validation-exceptions.filter.ts
│   ├── guards
│   │   ├── jwt-access.guard.ts
│   │   ├── jwt-refresh.guard.ts
│   │   └── roles.guard.ts
│   ├── interceptors
│   │   ├── serialization.interceptor.ts
│   │   └── wrap-response.interceptor.ts
│   ├── interfaces
│   │   └── exception-response.interface.ts
│   ├── modules
│   │   ├── auth
│   │   │   ├── dtos
│   │   │   │   ├── jwt-token.dto.ts
│   │   │   │   ├── refresh-token.dto.ts
│   │   │   │   ├── login.dto.ts
│   │   │   │   └── signup.dto.ts
│   │   │   ├── interfaces
│   │   │   │   ├── decoded-user.interface.ts
│   │   │   │   ├── jwt-strategy-validate.interface.ts
│   │   │   │   ├── login-payload.interface.ts
│   │   │   │   └── validate-user-output.interface.ts
│   │   │   └── strategies
│   │   │   │   ├── jwt-access.strategy.ts
│   │   │   │   ├── jwt-refresh.strategy.ts
│   │   │   │   └── public.strategy.ts
│   │   │   ├── auth.controller.ts
│   │   │   ├── auth.module.ts
│   │   │   ├── auth.repository.ts
│   │   │   └── auth.service.ts
│   │   └── user
│   │       ├── dtos
│   │       │   ├── update-user.dto.ts
│   │       │   └── user-response.dto.ts
│   │       ├── user.entity.ts
│   │       ├── user.controller.ts
│   │       ├── user.module.ts
│   │       ├── user.repository.ts
│   │       └── user.service.ts
│   ├── shared
│   │   ├── services
│   │   │   ├── api-config.service.ts
│   │   │   ├── keycloak.service.ts
│   │   │   ├── minio.service.ts
│   │   │   └── novu.service.ts
│   │   └── shared.module.ts
│   ├── app.module.ts
│   └── main.ts
├── .dockerignore
├── .env
├── .eslintrc.js
├── .gitignore
├── .prettierrc
├── docker-compose.yml
├── Dockerfile
├── nest-cli.json
├── package.json
├── README.md
├── tsconfig.build.json
└── tsconfig.json

Links

Swagger documentation will be available on route:

http://localhost:3000/api
0.3.1

2 months ago

0.3.0

11 months ago

0.2.0

11 months ago

0.1.4

12 months ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago