Feature guide

Campaigns, pilots and product insights

Pilot invitations, feedback, reminders, product events, campaign capacity, and staff reporting.

← Technical overview

What this domain owns

Operational experiments and measurement; it must not change learning state directly.

Feature flow diagram

Campaign or pilot invitation
        │
        v
Participant context ──> app experience
        │                         │
        ├──> consented product events
        ├──> feedback / activity / reminders
        v
Admin campaign and pilot reporting

This diagram shows the normal direction of control and data. Follow it before changing a boundary or adding a dependency.

Class and relationship diagram

┌───────────────┐ events ┌────────────────────┐ reports ┌──────────────┐
│ Pilot participant│──────▶│ Insights/Campaigns │──────▶│ Admin views  │
└───────────────┘          ├────────────────────┤       └──────────────┘
                           │ + track()          │
                           │ + feedback()       │
                           │ + reminders()      │
                           └──────────┬─────────┘
                                      ▼
                            ┌──────────────────┐
                            │ Consent + storage│
                            └──────────────────┘

Boxes show the important data types or services. Their fields and main methods are listed inside; arrows show the primary dependency or data relationship.

Sequence diagram

Participant
App
Campaign service
Events/Pilot API
API
Storage
Staff
Admin reporting
enter pilot/campaign context
resolve eligibility/context
participant context
consent to analytics or give feedback
send permitted event or feedback
save operational record
record saved
view campaign/pilot data

Read this from top to bottom: each arrow is the next interaction in the normal successful path.

Start here in the code

Choose any filename to open it directly in VS Code.

How it works

  1. Campaign grants pilot context.
  2. App records consented events.
  3. Pilot routes collect feedback/activity/reminders.
  4. Staff pages query reporting data.

Read this code

src/contexts/product-insights/public.tsOpen in VS Code — Record an allowed product event

export function track(event: ProductEvent) {
  if (!hasAnalyticsConsent()) return;
  navigator.sendBeacon('/api/events', JSON.stringify(event));
}

What each part is doing

  1. Events are optional when the learner has not given consent.
  2. sendBeacon lets navigation continue instead of delaying the learner for analytics.
  3. Keep event payloads product-focused; do not place answers or sensitive personal data in them.

This is a deliberately short excerpt of the real pattern, with unrelated details omitted. Read the named file for the complete implementation.

Related API and server boundaries

  • /api/pilot/*
  • /api/admin/campaigns/*
  • /api/admin/pilot
  • /api/events

Tests to read and run

Implementation notes

This is the home for detailed explanations, decision records, request examples, and diagrams for this feature. Add new feature-specific documentation here instead of expanding the platform overview.