Skip to content

Tutorial of api rest backend using NestJs framework

Notifications You must be signed in to change notification settings

v-cardona/bookstore_api

Repository files navigation

Description

A Simple CRUD Web API with JWT authentication, creation of users with differents roles to add and fetch books

Built With

Installation

$ git clone https://github.com/v-cardona/bookstore_api.git

Running the app

  • cd into bookstore_api
  • run npm install
  • create a docker container with postgres image docker run -d -p DOCKER_PORT:5432 --name bookstore_container -e POSTGRES_PASSWORD=password postgres
  • set up your postgres database
  • create a firebase project and a storage bucket
  • rename .env.sample to .env and populate the parameters
  • rename .orm.config.json.sample to .orm.config.json and populate the parameters
  • run databse migration npm run migration:run
  • run npm run start:dev
# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Access to documentation API

Database migration

  • generate migration npm run migration:generate --name
  • run migration npm run migration:run
  • revert migration npm run migration:revert