thisismydesign / nestjs-starter

NestJS MVC boilerplate for rapid development with battle-tested standards.
473 stars 80 forks source link
boilerplate nestjs nextjs typescript

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.

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 --network="host" --entrypoint=cypress cypress/included:12.2.0 run

Functionality

REST endpoint via Nest

JWT-protected REST endpoint via Nest

GraphQL playground (query WhoAmI is JWT-protected)

Add Header: { "Authorization": "Bearer " }

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)
- http://localhost:3000/auth/cognito

Google auth
- http://localhost:3000/auth/google

Next.js page
- http://localhost:3000/home

JWT-protected Next.js page
- http://localhost:3000/profile

### Useful commands

Nest CLI:

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


TypeORM CLI:

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



## Resources

- https://github.com/jmcdo29/testing-nestjs