1
GitHub - nhattien015/nest-graphql-typeorm-best-example: Nest + GraphQL + TypeORM...
source link: https://github.com/nhattien015/nest-graphql-typeorm-best-example
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Nestjs GraphQL TypeORM Best Example
NestJS (GraphQL + Typeorm) codebase containing real world examples.
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
- Clone repository
git clone https://github.com/nhattien015/nest-graphql-typeorm-best-example.git
- Cd into directory
cd nest-graphql-typeorm-best-example/
- Create .env
>.env
- 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
- Install dependencies using npm
npm install
Starting the Server
- Docker ( If use Docker. Run this code, Otherwise setup normally ).
docker compose up dev-db -d
- Sync schema to database
npm run db:sync
- Start in development mode (Default PORT: 3000)
npm run start:dev
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK