learn
packages/

Database

The sole Prisma schema, database client, repositories, migration graph, and schema snapshots.

Durable room state is a versioned chain of scene revisions, each stamped with its actor. The flush worker appends new revisions only when the stored head is behind and prunes everything but the latest ones. Servers enforce owner, editor, and viewer permissions on every access.

What it owns

  • The only Prisma schema in the repo — nothing else may define models
  • Scene revision storage with retention of the latest revisions
  • Room access: roles, membership, and ownership checks
  • Library item storage
  • The shared database client every service connects through

Files

File list and purposes from the folder README.

FilePurpose
src/prisma/db.tsShared client connection.
src/prisma/sceneSync.tsScene revision reads, appends, and retention.
src/prisma/roomAccess.tsRoom roles and membership.
src/prisma/library.tsLibrary item storage.
src/prisma/contract.prismaSchema contract snapshot.
prisma.config.tsPrisma tooling config.

Dependencies

LibraryVersion rangeWhy it is used here
Prisma ORM8.0.0-rc.11Typed query runtime behind the database client.
node-postgres8.23.1Postgres driver behind the database client pool.
dotenv^17.4.2Loads the database connection string locally.
Development and tooling (6)
LibraryVersion rangeWhy it is used here
@types/node26.4.1Type declarations for Node.js built-ins.
@types/pg8.23.1Type declarations for node-postgres.
tsx^4.23.13Runs and watches TypeScript sources for development and tests.
TypeScript7.0.2Compiles the workspace and type-checks every package.
Prisma CLI engine^0.3.0Engine behind the Prisma project config.
Prisma CLI8.0.0-rc.14Command line behind the database migration scripts.

Dependencies as of commit b0026d9.

db package
BrowserAPIRealtimeCacheDatabaseShareddurableephemeral

Talks to

Sources: packages/db/README.md, packages/db/src/README.md, packages/db/src/prisma/README.md, packages/db/src/prisma/db.ts, packages/db/src/prisma/sceneSync.ts, packages/db/src/prisma/roomAccess.ts, packages/db/src/prisma/library.ts (documented at commit b0026d9)

On this page