- Scalable
- Support for both GraphQL and traditional Rest API. You only need create a Controller file for Rest API implementation.
- Clear Codebase, etc...
- 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
- 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