Starter kit project made with Nest
- sequelize-typescript (ORM) + PostgreSQL
- JWT
- Jest
- Swagger
$ npm install
PostgreSQL database connection options are shown in the following table:
Option | Development | Test |
---|---|---|
Host | localhost | localhost |
Port | 5432 | 5432 |
Username | postgres | postgres |
Password | postgres | postgres |
Database | nest | nest_test |
# 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
# formatting code
$ npm run format
# run linter
$ npm run lint
# create database
$ npm run db:create
# run migrations
$ npm run db:migrate
# run seeders
$ npm run db:seed-dev
# reset database
$ npm run db:reset
# drop database
$ npm run db:drop
NODE_ENV=production \
DATABASE_HOST=db.host.com \
DATABASE_PORT=5432 \
DATABASE_USER=user \
DATABASE_PASSWORD=pass \
DATABASE_DATABASE=database \
JWT_PRIVATE_KEY=jwtPrivateKey \
ts-node -r tsconfig-paths/register src/main.ts