Database architecture for Matchids: the Prisma schema, migrations, seed data and documentation that every other Matchids service builds against.
This repo does not run a server — it's the canonical source of truth for
the data model. matchids-backend consumes this schema directly (as a
git submodule, private npm package, or copied file, depending on how the
team wires up the monorepo/polyrepo split); matchids-content and
matchids-admin describe data in terms of these same entities.
prisma/
schema.prisma Canonical schema — see below for entities
seed.ts Seeds DEMO data only; refuses to run in production
demo-data/ Demo books/artwork used by the seed script
migrations/ Generated by `prisma migrate dev` — empty until first migration
docs/
ERD.md Entity relationship overview
CONVENTIONS.md Naming and modeling conventions
User, AdminInvite, Category, Book, UserLibrary, Artwork,
ArtworkLike, Order, OrderItem, Payment, PaymentTransaction,
DonationCampaign, Donation, VerifiedOrganization, ImpactReport.
See docs/ERD.md for how they relate.
npm install
cp .env.example .env # set DATABASE_URL
npx prisma generate
npx prisma db push # or: npx prisma migrate dev --name init
npx prisma db seed # demo content only, refuses to run in production- No
productioncredentials or connection strings anywhere in this repo. - No private user data, ever, including in seed files.
- Every schema change goes through a migration, not a manual
db pushin a shared environment. - Fields are added when the product needs them — see
docs/CONVENTIONS.mdfor the "don't over-engineer" rule this schema follows.