Legend · Colour Thread

Follow the colour thread to keep roles sharp

🔴🟢🔵🟠🟣🟡⚫ map every file to its responsibility so you can ship features without blurring boundaries.

🔴

Server Action

Mutations with validation, authorization, cache revalidation.

🟢

Type

Domain + boundary contracts; keep Prisma types out of the UI.

🔵

Input / Prop

Data passed into components; never trust raw user input.

🟠

Context

UI convenience only; no business logic or persistence.

🟣

Language / JS

Next.js app router, React 19, server-first patterns.

🟡

DB

Prisma client today; TypeORM coexists for legacy/alt engines.

Config

Env + prisma.config.ts; secrets stay in .env, not code.

Boilerplate snapshot

  • Full-stack Next 15 + React 19 with a colour-coded contract: follow the emoji to know each file's job.
  • Prisma 7 (adapter-ready) drives the primary schema; TypeORM is available for migrations or alt stores while we bridge models.
  • The boilerplate is tuned for private reuse: cards + study guide document the patterns you can plug assets/features into.

Architecture stance

Study-guide chapters in practice

  • Server pages stay read-only; they fetch promises and hand off to client components for interaction.
  • Entity actions are the only place Prisma/TypeORM live; they gatekeep validation + authorization.
  • Server actions own mutations and revalidation; client components stay UI-only.
  • Contexts are for UX state (layout/edit mode), never persistence or permissions.
  • Config belongs in env + prisma.config.ts; DB URLs are injected, not hardcoded.

Prisma → TypeORM bridge

Prisma 7 (see prisma.config.ts) is the primary client. TypeORM files remain for legacy entities and alternative engines; keep domain logic inside entity actions so swapping storage layers stays a mechanical change, not a rewrite.