Architecture
Data Models
MongoDB schemas and relationships for all content models.
Data Models
All models live in models/ and are tenant-scoped via tenantId.
Entity relationship diagram
Tenant
File: models/Tenant.js
| Field | Type | Purpose |
|---|---|---|
domain | String | Primary hostname |
platformName | String | Site branding |
adConfig | Object | Default ad units, KVs, provider |
pixelConfig | Object | Google/Meta/GA tracking |
taboolaConfig | Object | Taboola widgets |
pushAlertConfig | Object | Push notifications |
Category
File: models/Category.js
| Field | Type | Purpose |
|---|---|---|
slug | String | URL path (/jobs) |
questionnaireType | String | Theme: questionnaire, whatsapp, guide, nothing |
sections | Array | Cards + rows + HTML content |
adConfig | Object | Category-specific ad overrides |
Article
File: models/Article.js
| Field | Type | Purpose |
|---|---|---|
slug | String | URL path (/article/slug) |
content | String | HTML body |
applyLinks | Array | External CTA links |
adConfig | Object | Article-specific ad overrides |
ArticleHome
File: models/ArticleHome.js
Editorial content for homepage cards and /home/[slug] pages. No ad system.
Questionnaire
File: models/Questionnaire.js
| Field | Type | Purpose |
|---|---|---|
slug | String | Links to category |
questions | Array | Multi-step questions with options |
theme | String | Visual theme variant |
WhatsAppTheme
File: models/WhatsAppTheme.js
| Field | Type | Purpose |
|---|---|---|
categorySlug | String | Links to category |
profilePicture | String | Chat avatar URL |
name | String | Chat contact name |
steps | Array | Chat bubbles per step |
Data flow pattern
Services return JSON.parse(JSON.stringify(doc)) for safe RSC serialization.