/nest-graphql-prisma

⚛️ GraphQL API template with advanced filtering & pagination on top of a PostgreSQL database, powered by NestJS & Prisma 搭配了全套增删查改,过滤参数以及带有订阅数据功能的 GraphQL API

Primary LanguageTypeScript

img

🌱 NestJS + GraphQL + Prisma + PostgreSQL Template

Description

GraphQL API template that supports:

  1. All CRUD purposes with advanced filtering capabilities across all data types for all columns
  2. Disallowing & prohibiting updates on system fields such as createdAt and updatedAt
  3. Offset-based Pagination on Payment table
  4. Subscription for the latest updated/created Payment

Other features:

API in action

image

Installation

$ yarn install

Running the app

# build
$ yarn run build

# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod

Database-related

Hosted DB provider: Supabase

Sadly Heroku will take down all free-tier services from Oct 2022, so I had to find alternative solutions to Heroku Postgres

# Create postgres database in local docker container
1. Download Docker
2. Open it
3. In project root folder run the following command
$ yarn docker:db

# Initialise the database (setting up schema & seeding) - once it has been created in docker
$ yarn db:init

# seeding database
$ npx prisma db seed