/bookLibrary

Sample NestJS demo code using Postgres

Primary LanguageTypeScript

Nest_Book_Library API

Table of Contents

Prerequisites

Project configuration

  1. Clone the repository
$ git clone https://github.com/nishit-trootech/bookLibrary.git
  1. Install dependencies
$ cd bookLibrary/

$ npm install
  1. Configure variables

This project uses environment variables for configuration. To configure your environment, follow these steps:

Locate the .env.example file in the root of the project and create a copy of .env.example and name it .env.

$ cp .env.example .env
  1. To run migration
  • Install and run PostgreSQL on your machine through a Docker container
$ npm run migrate
  1. Running the app
# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

File Structure

.
├── README.md
├── package.json
├── database
│   └── migrations
│       └── ... all migration files
├── models
│   └── ... all model files
├── src
│   ├── main.ts
│   ├── app.controller.spec.ts
│   ├── app.controller.ts
│   ├── app.module.ts
│   ├── app.service.ts
│   ├── books
│   │   ├── dto
│   │   │   ├── create-book.dto.ts
│   │   │   └── update-book.dto.ts
│   │   │── books.controller.spec.ts
│   │   └── ... # feedback controller and service file
├── tsconfig.json

API Documentation

Navigate to localhost:3000/api-docs for Swagger