This is the backend of the application Book Finder, built with Nest.js.
Before running the application, you need to install its dependencies:
$ npm install
Make sure you have the following tools installed on your machine:
Before running the application, copy the .env.example
file to a new .env
file in the project root:
$ cp .env.example .env
Before running the Nest.js application, you need to start the PostgreSQL database using Docker Compose. Make sure you have Docker running, and run:
$ docker-compose up
We are using Prisma ORM, so if it's the first time you're running the application, you will need to run Prisma commands to set up the database schema and apply migrations. Here are the common commands:
# install Prisma
$ npm install prisma@latest @prisma/client
# apply database migrations
$ npx prisma migrate dev
# generate Prisma client
$ npx prisma generate
The server should be on port 3333 after you run one of the following commands:
# 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
Book Finder is MIT licensed.