Files
youtube-studio-flow/backend
devil ba409ca53b fix(backend): compiled output was nested under dist/src, not dist/
api container crashed on boot: Cannot find module '/app/dist/main.js'.
Root cause: tsconfig.json had no rootDir, and prisma/make-admin.ts (run
separately via ts-node, never part of the Nest build) was swept into
the nest build compilation since there was no exclude either - so tsc
inferred the output root as the project root and nested everything
under dist/src/ instead of the flat dist/main.js the Dockerfile,
package.json scripts, and compose's worker command all assume.

Also excludes tsconfig.tsbuildinfo from the Docker build context - a
stale local incremental-build cache file was leaking in via `COPY . .`
(only dist/node_modules were dockerignored) and made nest build skip
emitting .js files entirely on a from-scratch container build once the
rootDir fix invalidated its cached signature.
2026-08-11 16:10:44 +02:00
..

StudioFlow — Backend (API & Worker)

Übersicht

Dieses Projekt enthält die gesamte Geschäftslogik, die API-Endpunkte und den Hintergrund-Worker für StudioFlow. Es basiert auf NestJS und nutzt Prisma als ORM.

Technologie-Stack

  • Framework: NestJS 10 (TypeScript)
  • ORM: Prisma 6
  • Datenbank: PostgreSQL 16
  • Queue: BullMQ (via Redis 7)
  • Auth: Passport.js + Google OAuth 2.0
  • Validierung: class-validator + zod
  • Dokumentation: Swagger (@nestjs/swagger)

Kernmodule

  1. Render-Engine: Wandelt Video-Konfigurationen in finale Beschreibungen um.
  2. Quota-Management: Überwacht und plant YouTube API-Units (Hash-basierter Diff).
  3. Bulk-Jobs: Verarbeitet Massenänderungen asynchron via BullMQ.
  4. Linting: Validiert Metadaten gegen vordefinierte Regeln.
  5. Sync-Service: Kommuniziert mit der YouTube Data API v3.

Setup & Start

  1. npm install
  2. Prisma-Client generieren: npx prisma generate
  3. Server starten: npm run start:dev (Main Entry: src/main.ts)
  4. Worker starten: npm run start:worker (Worker Entry: src/worker.ts)

Verzeichnisstruktur

  • src/main.ts: Entrypoint für die REST API
  • src/worker.ts: Entrypoint für den BullMQ Worker
  • src/shared/render-engine/: Die zentrale Rendering-Logik
  • src/modules/: Alle fachlichen Module (Videos, Blocks, Templates, etc.)
  • prisma/: Datenbank-Schema und Migrationen