Database
The Postgres schema and its core entities.
VerseBill stores data in Supabase Postgres and accesses it through Prisma. The schema is defined in prisma/schema.prisma.
Entities
- User — one row per Privy user, holding the role and wallet address
- Merchant — business profile, payment wallet, and invoice sequence
- Invoice — the bill itself, with status, amount, line items, and payment target
- Payment — a submitted transaction hash and its verification outcome
- AuditLog — an append-only record of key events
Relationships
- A User has one Merchant (merchant.userId is unique)
- A Merchant has many Invoices
- An Invoice has many Payments
- AuditLog optionally references a User and an Invoice
Database credentials and service-role keys are server-side only and are never exposed to the client.