/NestJs-Graphql-Grocery-Store

A simple NestJS app for a grocery store using GraphQL, it will connect to a PostgreSQL database using TypeORM.

Primary LanguageTypeScript

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

A simple and easy to use GraphQL based API with NestJS.

In the src directory, there are 4 CSV files, the application will on runtime read and build tables in the database for products, categories, subcategories and sellers information from three CSV files: cats.csv, subcats.csv, sellers.csv. A fourth file, Aljazera_Stores_Products.csv corresponds to products for that particular seller.

The information had been scrapped from the web for learning purposes only.

Sample

Installation

Firstly run a:

$ npm install

Add a .env file and place the following properties line by line:

  • DB_PORT=5432
  • DB_HOST=localhost
  • DB_NAME=postgres or <Your DB Name>
  • DB_USERNAME=postgres or <Your DB Username>
  • DB_PASSWORD=<LOCAL DB SERVER PASSWORD>

The NestJS app will use the .env file to pick up the development environment properties.

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.