Database
MongoDB with Mongoose 9. Single shared database, multi-tenant via organizationId. 9 collections.
erDiagram
Organization ||--o{ User : organizationId
Organization ||--o{ Position : organizationId
Organization ||--o{ Candidate : organizationId
Organization ||--o{ Interview : organizationId
Organization ||--o{ InterviewReport : organizationId
Organization ||--o{ CreditLot : organizationId
Organization ||--o{ CreditLedger : organizationId
Organization ||--o{ Note : organizationId
Position ||--o{ Interview : positionId
Candidate ||--o{ Interview : candidateId
Interview ||--|| InterviewReport : interviewId
CreditLedger ||--o{ CreditLot : purchaseLedgerEntryId
CreditLot ||--o{ CreditLedger : lotId
Candidate ||--o{ Note : target
Interview ||--o{ Note : targetEvery tenant-scoped document carries organizationId. The API enforces isolation in queries; a few global unique keys exist for login and join links (users.email, organizations.slug, interviews.joinTokenHash).
Collections
| Collection | Purpose |
|---|---|
organizations | Tenant root — settings, branding, cached credit balances |
users | Team members, roles, invites, Firebase auth linkage |
positions | Job templates — skills, AI context, duration |
candidates | People records, resume metadata, recruiter profile fields |
interviews | Scheduled sessions — frozen snapshot, room/runtime, credits |
interviewreports | Post-interview AI report — scores, transcript (1:1 with interview) |
creditlots | Purchasable or granted credit pools with expiry |
creditledgers | Append-only credit movements and balance snapshots |
notes | Recruiter notes on a candidate or interview |
View complete schema → DBML