Starter kit project made with Nest that demonstrates CRUD user, JWT authentication, CRUD posts.
- typeorm (ORM) + PostgreSQL
- JWT
- Swagger
$ yarn install
Copy .env-example to .env
$ cp .env-example .env
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
$ yarn start
# watch mode
$ yarn start:dev
# production mode
$ yarn start:prod
# formatting code
$ yarn format
# generate migrations {name-migration} - change the name for your migration
$ yarn migration:generate -- db/migrations/{name-migration}
# run migrations
$ yarn migration:run
# revert one migration from database
$ yarn migration:revert
NODE_ENV=development \
DB_HOST=127.0.0.1 \
DB_PORT=5432 \
DB_USERNAME=postgres \
DB_PASSWORD=password \
DB_NAME=nestjs_typeorm_template \
JWT_SECRET=jwtSuperSecret \
This project uses the Nest swagger module for API documentation. NestJS Swagger - www.swagger.io
Swagger docs will be available at localhost:3000/v1/docs
Hey there 👋 I'm a Senior Backend Developer specializing in blockchain projects. I work on the development of backend systems and DevOps in blockchain companies. I'm also passionate about growing the KnowYourBackend community.