Demo app that implements store and retrieve endpoints.
$ npm install
# postgres
$ docker compose up -d
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
- Setup store and retrieve endpoints
- Create demo controller:
nest generate controller demo
- Add store and retrieve endpoints.
- Create demo controller:
- Create demo service and crypto service.
- Create demo service:
nest generate service demo
. - Create crypto service:
nest generate service common/service/crypto --flat
. - Create module for demo:
nest generate module demo
- Create demo service:
- Create dtos
- Create store demo dto:
nest generate class demo/dto/store-demo.dto --flat --no-spec
- Create query params dto:
nest generate class demo/dto/query-param.dto --flat --no-spec
- Create store demo dto:
- Add data validation
- Add global valiadtion pipe
- Install
class-validator
andclass-transformer
npm package:npm install class-validator class-transformer
. - Add validation decorators to store and query dto.
- Add
docker-compose.yml
file and configurepostgres
- Run
postgres
:docker compose up -d
- Run
- Setup typeorm
- Install typeorm packages and postgres package:
npm install @nestjs/typeorm typeorm pg
- Configure database connection in
AppModule
. - Create
Demo
entity:nest generate class demo/entity/demo.entity --no-spec --flat
- Install typeorm packages and postgres package:
- Implement crypto service.