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.
| File | Purpose |
|---|---|
src/prisma/db.ts | Shared client connection. |
src/prisma/sceneSync.ts | Scene revision reads, appends, and retention. |
src/prisma/roomAccess.ts | Room roles and membership. |
src/prisma/library.ts | Library item storage. |
src/prisma/contract.prisma | Schema contract snapshot. |
prisma.config.ts | Prisma tooling config. |
Dependencies
| Library | Version range | Why it is used here |
|---|---|---|
| Prisma ORM | 8.0.0-rc.11 | Typed query runtime behind the database client. |
| node-postgres | 8.23.1 | Postgres driver behind the database client pool. |
| dotenv | ^17.4.2 | Loads the database connection string locally. |
Development and tooling (6)
| Library | Version range | Why it is used here |
|---|---|---|
| @types/node | 26.4.1 | Type declarations for Node.js built-ins. |
| @types/pg | 8.23.1 | Type declarations for node-postgres. |
| tsx | ^4.23.13 | Runs and watches TypeScript sources for development and tests. |
| TypeScript | 7.0.2 | Compiles the workspace and type-checks every package. |
| Prisma CLI engine | ^0.3.0 | Engine behind the Prisma project config. |
| Prisma CLI | 8.0.0-rc.14 | Command line behind the database migration scripts. |
Dependencies as of commit b0026d9.
Laying out 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)