Skip to content

Latest commit

 

History

History
60 lines (36 loc) · 1.75 KB

File metadata and controls

60 lines (36 loc) · 1.75 KB

Tickets REST API

Description

A simple CRUD REST api used to manage tickets from travel agency built with NestJS, Prisma and PostgreSQL. The app can be tested using Postman or any rest api client of your choice.

Routes implemented :

  • POST /tickets - Creates a ticket record
  • POST /tickets/upload - creates a ticket record from a ticket file
  • POST /tickets/upload/batch - creates the corresponding ticket record for each ticket file upload in the batch
  • GET /tickets - Get all ticket records stored in the database
  • GET /tickets/:id - Get a ticket record by its id
  • PATCH /tickets/:id - Update information of a ticket record
  • DELETE /tickets/:id - deletes a single ticket record

Note : The files aren't stored in the database. Informations related to each ticket are extracted and stored in the database. For ticket samples see folder /ticket-samples

1. Setup / Installation

PostgreSQL

  • Docker (Needed)
    • PostgresSQl will run in a docker container using docker compose, as a result docker desktop is required since it includes docker compose.
    • Docker Desktop is available for Mac,Windows and Linux (Skip this step if you have docker desktop)
    • Once Docker desktop installed, pull PostgreSQL image from Docker hub using docker desktop

Install Project dependencies

$ npm install

2. Running the app

step 2 : Run Postgres Container

$ npm run db:dev:start

step 3: Run the app

# development mode
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod