Starter kit project made with Nest that demonstrates CRUD user, JWT authentication, CRUD posts and e2e tests.
- 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
# e2e tests
$ npm run test
# 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
This project uses the Nest swagger module for API documentation. NestJS Swagger - www.swagger.io
Swagger docs will be available at localhost:3000/documentation