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 reportingThis 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
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
- Campaign grants pilot context.
- App records consented events.
- Pilot routes collect feedback/activity/reminders.
- 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
- Events are optional when the learner has not given consent.
- sendBeacon lets navigation continue instead of delaying the learner for analytics.
- 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.