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.
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
- Render-Engine: Wandelt Video-Konfigurationen in finale Beschreibungen um.
- Quota-Management: Überwacht und plant YouTube API-Units (Hash-basierter Diff).
- Bulk-Jobs: Verarbeitet Massenänderungen asynchron via BullMQ.
- Linting: Validiert Metadaten gegen vordefinierte Regeln.
- Sync-Service: Kommuniziert mit der YouTube Data API v3.
Setup & Start
npm install- Prisma-Client generieren:
npx prisma generate - Server starten:
npm run start:dev(Main Entry:src/main.ts) - Worker starten:
npm run start:worker(Worker Entry:src/worker.ts)
Verzeichnisstruktur
src/main.ts: Entrypoint für die REST APIsrc/worker.ts: Entrypoint für den BullMQ Workersrc/shared/render-engine/: Die zentrale Rendering-Logiksrc/modules/: Alle fachlichen Module (Videos, Blocks, Templates, etc.)prisma/: Datenbank-Schema und Migrationen