https://github.com/tkosminov/nestjs-example
NestJS example with using GraphQL (schema stitching, schema reload, dataloader, upload files, subscriptions, response cache), RabbitMQ, Redis, Websocket, JWT authentication, ESLint 9
https://github.com/tkosminov/nestjs-example
amqp dataloader graphql graphql-yoga jwt-authentication nestjs redis schema-reload schema-stitching socket-io typeorm
Last synced: 7 months ago
JSON representation
NestJS example with using GraphQL (schema stitching, schema reload, dataloader, upload files, subscriptions, response cache), RabbitMQ, Redis, Websocket, JWT authentication, ESLint 9
- Host: GitHub
- URL: https://github.com/tkosminov/nestjs-example
- Owner: tkosminov
- License: mit
- Created: 2019-03-17T13:34:06.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-28T07:12:57.000Z (11 months ago)
- Last Synced: 2025-05-10T19:02:56.460Z (8 months ago)
- Topics: amqp, dataloader, graphql, graphql-yoga, jwt-authentication, nestjs, redis, schema-reload, schema-stitching, socket-io, typeorm
- Language: TypeScript
- Homepage:
- Size: 1.45 MB
- Stars: 386
- Watchers: 6
- Forks: 68
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# NestJS-Example
NestJS example with using GraphQL (schema stitching, schema reload, dataloader, upload files, subscriptions, response cache), RabbitMQ, Redis, Websocket, JWT authentication, ESLint 9
## Dependencies
* [NodeJS 22](https://nodejs.org/download/release/latest-v22.x/)
* [Redis 7](https://redis.io/download/)
* [PostgreSQL 13+](https://www.postgresql.org/download/)
* [RabbitMQ](https://www.rabbitmq.com/download.html)
## Run locally
### Installation
```bash
npm ci
```
### Run
```bash
npm run start:dev
```
### REPL
```bash
npm run repl:dev
```
## Run with Docker on host
### Build
```bash
sudo docker build -t nestjs-example . --build-arg env=development
```
### Run
```bash
sudo docker run -d --network host nestjs-example:latest
```
### Get CONTAINER_ID
```bash
sudo docker ps -a | grep nestjs-example
```
### Open container
```bash
sudo docker exec -it $CONTAINER_ID sh
```
### Show logs
```bash
sudo docker logs $CONTAINER_ID
```
### Stop container
```bash
sudo docker stop $CONTAINER_ID
```
### Remove container
```bash
sudo docker rm $CONTAINER_ID
```
## Run with Docker Compose
### Create network
```bash
sudo docker network create nestjs-example-network
```
### Run
```bash
sudo docker compose up --build
```
## Dependencies graph
### Full
```bash
npm run madge:full
```
### Circular
```bash
npm run madge:circular
```
## Typeorm
### Creating a migration file from modified entities
```bash
npm run typeorm:generate
```
### Create an empty migration file
```bash
npm run typeorm:create
```
### Run migrations
#### Development
```bash
npm run typeorm:run:dev
```
#### Build
```bash
npm run typeorm:run:build
```