questionnaire docs
Architecture

Architecture Overview

High-level system architecture of the Questionnaire platform.

Architecture Overview

The Questionnaire platform is a multi-tenant, theme-gated content monetization system built on Next.js 16 App Router.

System diagram

Core concepts

ConceptDescription
TenantA domain/client with its own branding, ads, and pixels
CategoryA content page with sections, cards, and a theme overlay
ThemeInteractive overlay (questionnaire, WhatsApp, guide) that gates content
ArticleFull editorial page with display ads and apply links
KV waterfallTiered ad pricing via Google Ad Manager key-values

Request flow summary

  1. User visits a URL on a tenant domain
  2. proxy.js resolves tenant from hostname → sets x-tenant-id header
  3. Server page fetches tenant + content from MongoDB via services
  4. Client component renders theme overlay + ad components
  5. User completes theme → rewarded ad → content unlocks
  6. Conversion pixels fire at each milestone

Sections

On this page