Skip to content

Repository files navigation

Matchids Database

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.

What's here

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

Entities

User, AdminInvite, Category, Book, UserLibrary, Artwork, ArtworkLike, Order, OrderItem, Payment, PaymentTransaction, DonationCampaign, Donation, VerifiedOrganization, ImpactReport.

See docs/ERD.md for how they relate.

Local setup

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

Conventions

  • No production credentials 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 push in a shared environment.
  • Fields are added when the product needs them — see docs/CONVENTIONS.md for the "don't over-engineer" rule this schema follows.

About

Canonical Prisma schema, migrations and seed data for Matchids.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages