Skip to content

System

Data Model

Postgres, Prisma, on-disk assets, and TypeScript session types.

Data Model

Veyra keeps authoritative project and planner data in PostgreSQL through Prisma. The schema is prisma/schema.prisma; the TypeScript logical shape of a loaded session (what the UI and APIs pass around) is PlannerSession in src/types/planner-session.ts.

Layers

LayerRole
Prisma / PostgresOne Project row per song/upload; 1:1 (or 1:n where needed) step tables for inputs, concept, locations, filming style, generate notes/chat, etc. See models named Step*, Project, chat/message tables, etc. Accessibility AD scripts use AccessibilityNarration + AccessibilityNarrationCue (master WAV on disk).
TypeScriptPlannerSession mirrors the step keys the Video Plan uses (e.g. step_inputs, step_filming_style, step_generate, …) so the client can work with a single JSON-like object even though the DB is normalized.
DiskAudio, environment ref images, and generated stills / MP4s under public/projects/<project-id>/.... The DB stores paths and public URLs, not BLOBs.
Static JSONsrc/data/filming_styles.json — catalogue of global filming-style options (ids, labels, prompt text). Shipped with the app; not user-edited at runtime.

Projects and mixSrc

Each project has a UUID directory under public/projects/. The browser’s canonical mix URL is /projects/<id>/audio.<ext>; that value is the mixSrc string throughout the studio.

Migrations

Schema changes are applied with Prisma migrations in prisma/migrations/. For local dev:

npx prisma migrate dev

Historical note

Earlier revisions of this documentation described only hand-edited JSON files under src/data/ for shots and staging. The Video Plan flow and persistence are now database-backed; if you see old copies of cast_continuity.json / shot_staging.json in discussions, treat them as legacy. The concepts (cast locks, per-shot prompts, sections) still exist in the planner model under different table names.