Auch verfügbar in: 🇩🇪 Deutsch

Development

Inhalt

🇩🇪 Deutsche Version


ITSWEBER Play is a pnpm monorepo. The dev stack runs in Docker (Postgres, Redis, MinIO), while the Next.js, Fastify, and BullMQ processes run locally for fast iteration.


Prerequisites

Tool Version Notes
Node.js 22 LTS Required. Install from nodejs.org
pnpm 9.x Managed via Corepack — see note below
Docker + Docker Compose Latest stable For the dev dependency services
Git Any recent

pnpm via Corepack

pnpm is managed by Node's built-in Corepack and may not be in your PATH directly.

Enable it once:

corepack enable

After this, pnpm works as a normal command. If your shell still can't find it, invoke it explicitly:


node $(which pnpm) install


node "C:\Program Files\nodejs\node_modules\corepack\dist\pnpm.js" install

Setup

git clone https://github.com/ITSWEBER-OFFICIAL/itsweber-play
cd itsweber-play
corepack enable
pnpm install
cp .env.example .env
docker compose -f docker-compose.dev.yml up -d
pnpm dev

pnpm dev starts all apps in watch mode concurrently using Turborepo. The default ports are:

App URL
Web (Next.js) http://localhost:3000
API (Fastify) http://localhost:3001
Prisma Studio http://localhost:5555 (on demand)

Project Structure

Directory App / Package Tech Default Port
apps/web Frontend Next.js 15 (App Router, RSC) 3000
apps/api Backend Fastify + tRPC + Better Auth 3001
apps/worker Video pipeline BullMQ + FFmpeg + yt-dlp — (background)
apps/remotion Demo rendering Remotion 3002 (on demand)
packages/db Database client Prisma 5 + Postgres 16
packages/theme Theme system Token JSON + TypeScript
packages/shared Shared types/enums TypeScript
packages/storage Object storage client MinIO SDK

Useful Commands


pnpm dev


pnpm --filter @play/api exec tsc --noEmit


pnpm typecheck


pnpm --filter @play/db exec prisma studio


pnpm --filter @play/db exec prisma migrate dev --name describe_your_change


pnpm --filter @play/db exec prisma migrate dev


docker compose -f docker-compose.dev.yml logs -f


docker compose -f docker-compose.dev.yml logs -f api


docker compose -f docker-compose.dev.yml restart


pnpm lint


pnpm test

Commit Conventions

Commits follow the Conventional Commits format:

type(scope): subject

Types:

Type When to use
feat New feature
fix Bug fix
chore Maintenance, dependency updates
docs Documentation changes
refactor Code restructuring without behavior change
test Adding or updating tests
ci CI/CD pipeline changes

Scopes map to the monorepo structure: web, api, worker, db, theme, shared, docker, docs.

Examples:

feat(api): add yt-dlp import endpoint
fix(web): correct signed URL expiry display
chore(db): update Prisma to 5.14
docs(wiki): add video pipeline reference

Contributing

See CONTRIBUTING.md in the repository root for full guidelines.

Key points:

  • All PRs target the main branch
  • TypeCheck (tsc --noEmit) must pass before merging
  • Prisma migration files must be included in the same commit as schema changes — never commit a schema change without its migration
  • Migration folder names use session_a_* / session_k_* prefixes — do not rename existing migration folders (it breaks tracking)
  • No private data (IPs, credentials, personal paths) in any committed file
  • AGPL-3.0 attribution (© Benjamin Weber · ITSWEBER) must remain intact in all derived works

Architecture Notes

The monorepo uses Turborepo for build orchestration and dependency caching. The key data flows:

  • apps/web calls apps/api via tRPC (type-safe end-to-end, no manual fetch wrappers)
  • apps/api enqueues jobs for apps/worker via BullMQ (Redis-backed)
  • packages/db exports the Prisma client — all apps that touch the database import it from here
  • packages/theme exports token JSON and semantic TypeScript — consumed by both apps/web (CSS vars) and apps/api (theme.update tRPC procedure)
  • File storage is abstracted in packages/storage — swap MinIO for any S3-compatible backend without touching app code

© Benjamin Weber · ITSWEBER — play.itsweber.net · GitHub