项目作者: ariellephan

项目描述 :
Nestjs template with TypeScript, TypeORM, GraphQL, Apollo and many more
高级语言: TypeScript
项目地址: git://github.com/ariellephan/nestjs-typescript-graphql-typeorm-template.git


Description

WIP Nestjs template with Typescript, TypeORM, GraphQL, Apollo and OpenAPI Swagger.

REST Swagger

/api

GraphQL

/graphql

  1. Do model change in entity.ts and use migration to push changes to db
  2. Update .graphql and run yarn type to update types
  3. Schema first as decorator for type-graphql does not play well with TypeORM atm
  4. Possible alternative: Prisma

Create migrations

yarn migration:generate — -n NameOfMigration

Run all pending migrations

yarn migration:run

Revert

yarn migration:revert

Push db update to upstream DO NOT RUN BEFORE CHECKING IN WITH LEAD DEV

yarn migration:push // TODO - env config for what env push is going to

Installation

  1. $ yarn

Running the app

  1. # development
  2. $ yarn start
  3. # watch mode
  4. $ yarn start:dev
  5. # production mode
  6. $ yarn start:prod

Test

  1. # unit tests
  2. $ yarn test
  3. # e2e tests
  4. $ yarn test:e2e
  5. # test coverage
  6. $ yarn test:cov