Skip to content

Nest + GraphQL + TypeORM codebase. Let's contribute to it for the better. Thank you

License

Notifications You must be signed in to change notification settings

hnhattien/nest-graphql-typeorm-best-example

Repository files navigation

Nestjs GraphQL TypeORM Best Example

NestJS (GraphQL + Typeorm) codebase containing real world examples.

Coverage Status Known Vulnerabilities

Introduction

Why should you use this example for Nest + GraphQL + TypeORM ?

  • Scalable
  • Support for both GraphQL and traditional Rest API. You only need create a Controller file for Rest API implementation.
  • Clear Codebase, etc...

Table of Contents

Usage

  1. Clone repository
  git clone https://github.com/nhattien015/nest-graphql-typeorm-best-example.git
  1. Cd into directory
  cd nest-graphql-typeorm-best-example/
  1. Create .env
  >.env
  1. Add to .env
DB_HOST=localhost
DB_PORT=5000
DB_PWD=root
DB_USERNAME=root
DB_DATABASE=nestjs
JWT_ACCESS_TOKEN_SECRET=access_token_secret_key
JWT_ACCESS_TOKEN_EXPIRES_IN=15m
JWT_REFRESH_TOKEN_SECRET=refresh_token_secret_key
JWT_REFRESH_TOKEN_EXPIRES_IN=7d
  1. Install dependencies using npm
  npm install

Starting the Server

  1. Docker ( If use Docker. Run this code, Otherwise setup normally ).
  docker compose up dev-db -d
  1. Sync schema to database
  npm run db:sync
  1. Start in development mode (Default PORT: 3000)
  npm run start:dev

About

Nest + GraphQL + TypeORM codebase. Let's contribute to it for the better. Thank you

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published