How tkosminov/nestjs-example works
Project type and purpose
• This is a monolithic backend application built with NestJS.
• It exposes GraphQL (with schema stitching, hot-reload, subscriptions, uploads, cache), REST endpoints (file uploads), WebSocket gateways, uses RabbitMQ for messaging, Redis for caching, JWT for auth, and PostgreSQL via TypeORM for persistence.
• There is no dedicated “frontend” code other than simple HTML samples; the focus is on demonstrating a robust NestJS server architecture.
File structure
• Top-level files: Dockerfile, docker-compose.yml, nginx.conf, config/.env, README, package.json, tsconfig → containerization, env management, build config.
• src/app.module.ts, main.ts → NestJS application bootstrap.
• src/graphql, src/upload/graphql, src/upload/rest, src/ws, src/oauth, src/jwt, src/rabbitmq, src/redis, src/typeorm, src/models → functional modules grouped by domain and integration.
• src/logger, src/cors, src/healthz → cross-cutting concerns (logging, CORS middleware, health check).
• config/, docker-related files → deployment and runtime configuration.
README for additional insights
• Describes required services: Redis, RabbitMQ, PostgreSQL.
• Commands for local and Docker usage.
• GraphQL features (stitching, reload), RabbitMQ, Redis, WebSocket, JWT, file upload, TypeORM migrations.
Final recommendations
• Be detailed: break the monolith into its constituent modules to show how each integrates.
• Cross-cutting middleware and global providers (logger, CORS, JWT).
• Flows (HTTP, WS, messaging) are visible with arrowheads and labels.