• Stars
    star
    471
  • Rank 93,216 (Top 2 %)
  • Language
    TypeScript
  • Created almost 4 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NestJS MVC boilerplate for rapid development with battle-tested standards.

NestJS Starter

CI

NestJS MVC boilerplate for rapid development with battle-tested standards.

Use this template

Deploy

Stack

It has

Usage

The deployments below are probably in sleep mode and will take a minute to come online when you open them.

Production

https://nestjs-starter-production.herokuapp.com/

Staging

https://nestjs-starter-staging.herokuapp.com/

Dev

cp .env.example .env
docker-compose up
docker-compose exec web yarn lint
docker-compose exec web yarn test
docker-compose exec web yarn test:request
docker-compose exec web yarn build
docker run -it -v $PWD:/e2e -w /e2e --entrypoint=cypress cypress/included:10.0.3 run --config-file cypress.docker.config.ts

Functionality

REST endpoint via Nest

JWT-protected REST endpoint via Nest

GraphQL playground (query WhoAmI is JWT-protected)

query Public {
  things {
    id
    name
  }

  users {
    id
    provider
  }
}

# Add Header: { "Authorization": "Bearer <token>" }
query Private {
  whoAmI {
    id,
    provider,
    providerId,
    username,
    name
  }

  orders {
    id

    alias
    thing {
      name
    }
  }
}

mutation createOrder {
  createOrder(alias: "myname", thingName: "this is a thing you can order") {
    id
    alias
  }
}

Cognito auth (redirects to hosted Cognito UI)

Google auth

Next.js page

JWT-protected Next.js page

Useful commands

Nest CLI:

docker-compose exec web yarn nest -- --help

TypeORM CLI:

docker-compose exec web yarn typeorm -- --help

Resources