Skip to content

Admin & Analytics

Spec Source: Document 9 — Admin Dashboard & Analytics | Last Updated: February 2026

Overview

The Admin & Analytics system is the operational backbone of DoCurious. It provides two integrated toolsets: a Staff Admin Panel for managing users, content, schools, vendors, and platform operations, and an Analytics Platform that delivers dashboards and reports for executives, product managers, engineers, and content teams.

The admin panel is restricted to DoCurious staff and operates through a granular role-based permission system. Seven distinct admin roles control access to specific feature areas, from content moderation to system configuration. Every admin action is logged in an immutable audit trail for compliance and accountability.

The analytics platform serves multiple stakeholders. Executives get high-level KPIs (DAU, MAU, growth, revenue). Product managers get funnel analysis and cohort retention. The content team gets challenge performance rankings and category breakdowns. Engineers get infrastructure health, error tracking, and deployment monitoring. School success managers get health scorecards for each school. Vendors get their own performance dashboards with audience insights.

The frontend prototype currently implements the full set of admin pages with mock data and local state. All pages are functional, interactive, and wired to the platform's role-based access control. The backend integration layer -- real API endpoints, persistent audit logging, and analytics data pipelines -- is planned for the production build.

How It Works

Admin Roles & Permissions

STATUS: BUILT

Admin roles are fully typed in admin.types.ts with a complete permission matrix. The AdminRoles page renders a table of admin users with role badges, permission lists, and assign/edit/remove actions. The useAdminStore exposes fetchAdminRoles, assignRole, and removeRole actions. All seven spec roles are defined.

The platform defines seven admin role types, each granting access to specific feature areas. The ADMIN_PERMISSIONS constant in the type system maps each role to its allowed feature areas.

RoleDescriptionTypical UserFeature Areas
Super AdminFull access to all admin functionsCTO, CEO, designated leadsAll 10 feature areas
Content AdminChallenge approval, content moderation, TR verificationContent teamchallenge_management, verification, content_moderation
School AdminSchool onboarding, SA support, school health monitoringCustomer success teamschool_management, user_management
Vendor AdminVendor onboarding, vendor support, vendor analyticsPartnerships teamvendor_management, user_management
Support AdminUser support, account issues, basic moderationSupport teamuser_management, content_moderation
Analytics ViewerRead-only access to analytics dashboardsLeadership, productanalytics
Engineering AdminSystem configuration, technical monitoringEngineering teamsystem_config, analytics, audit_log, feature_flags

Permission Matrix

The full permission matrix from the spec defines which roles can perform which operations:

FunctionSuperContentSchoolVendorSupportAnalyticsEngineering
View all usersYYY--Y----
Edit user accountsY--Y--Y----
Delete user accountsY------------
View challengesYY--YY----
Approve/reject challengesYY----------
Edit any challengeYY----------
Verify Track RecordsYY----------
Manage schoolsY--Y--------
Manage vendorsY----Y------
View analyticsY--------YY
System configurationY----------Y
Manage admin usersY------------

User Management

STATUS: BUILT

UserManagement.tsx renders a searchable, filterable user table with role badges, status indicators, suspend/unsuspend/remove actions, and impersonation. UserDetail.tsx provides a detailed profile view with activity stats and moderation history. Both are wired to useAdminStore and useImpersonationStore.

The user management system provides platform-wide visibility into all user accounts. Admins can search by name or email, filter by role (user, student, teacher, school admin, staff), and take action on individual accounts.

User Search & Lookup supports search by display name and email address. Results show the user's avatar initials, display name, email, role badge, account status (Active or Suspended), and join date.

User Detail View (accessible via the detail page) shows:

  • Profile section: all profile fields, account creation date, email verification status, age tier
  • Activity section: challenges completed, track records created, communities joined, total XP
  • Relationships: school affiliations, parent-child links
  • Moderation section: flag count, full moderation history with timestamps and admin names

Available Actions:

  • Suspend / Unsuspend: Toggle account access with confirmation dialog. Suspended users see a suspension message on login.
  • Remove: Permanently delete an account with confirmation.
  • Impersonate: "View as" button launches the impersonation session, navigating the admin to the user's dashboard. Impersonation is powered by useImpersonationStore and is logged.

Summary Stats display at the bottom: Active Users count, Suspended count, and School Users count.

Content Moderation

STATUS: BUILT

FlaggedContentQueue.tsx renders a card-based moderation queue with severity-colored left borders (red/orange/blue for high/medium/low), content preview, report metadata, and four action buttons (Dismiss, Warn, Remove, Suspend User). Severity filtering and aggregate counts are implemented.

Users can flag inappropriate content across the platform. Flagged items appear in the moderation queue for admin review.

Flaggable Content Types

The following content types can be flagged: community posts, reviews, portfolio items, challenge submissions, and user profiles. Each flag captures the content type, a preview snippet, the reporter's name, the report reason, the severity level, the number of reports, and the date reported.

Severity Levels

Flagged content is classified into three severity tiers:

SeverityVisual IndicatorTypical Scenarios
HighRed left border, red badgeHarassment/bullying, safety concerns, spam with suspicious links
MediumOrange left border, yellow badgeAbusive language, plagiarism/copyright
LowBlue left border, blue badgeFraudulent submissions, minor guideline violations

Moderation Actions

Each flagged item presents four escalating action buttons:

  1. Dismiss: Flag is cleared, content remains visible. Used when the flag is unwarranted.
  2. Warn: A warning is sent to the content author. Content remains but the author is put on notice.
  3. Remove: Content is deleted and the author is notified. Used for clear violations.
  4. Suspend User: Content is removed and the author's account is suspended. Used for severe or repeated violations.

Proactive Moderation (Planned)

The spec calls for automated scanning of new content for prohibited terms and image scanning for explicit content via a third-party service. This would auto-flag content for review (not auto-remove). Manual review triggers would include content from under-13 users, high-volume posters, and previously warned users. These features are planned for the production backend.

Verification Queue

STATUS: BUILT

VerificationQueue.tsx renders an expandable card list of pending track records with user name, challenge title, submission date, attempt count, full entry content with media thumbnails, and approve/reject/note actions. The rejection flow includes selectable reasons and optional freeform feedback.

Track Records submitted for verification appear in a dedicated queue. The queue is sorted by submission date and shows the challenge name, submitter name, submission timestamp, and verification attempt number (e.g., "Attempt 1/3").

Verification Interface: Expanding a queue item reveals all track record entries (text + media). Each entry shows its content and any attached images. The admin reviews entries against the challenge requirements.

Approval Actions:

  • Approve: Confirms the track record. The user receives XP, badges, and a verified status.
  • Reject: Requires selecting a rejection reason from a predefined list (Incomplete Documentation, Unclear Evidence, Wrong Challenge, Low Quality) plus optional freeform notes. The user is notified and can revise.
  • Add Note: Attach an internal note visible to other admins (button present, full implementation pending).

Rejection Reasons (from the codebase):

  • Incomplete Documentation -- does not show full challenge completion
  • Unclear Evidence -- photos/text do not clearly demonstrate completion
  • Wrong Challenge -- content does not match challenge requirements
  • Low Quality -- images too blurry or text too brief to verify

Challenge Approval Queue

STATUS: BUILT

ChallengeApprovalQueue.tsx is a fully featured queue with stats bar (Total Pending, Avg Review Time, Approved This Week, Rejection Rate), filter tabs (All, Pending Review, Under Review, Needs Changes), search, expandable detail views with milestones, and actions (Approve, Request Changes, Reject, Assign Reviewer). Feedback modals collect reasons for rejection or change requests.

New challenges submitted by users or vendors enter the approval queue before going live. The queue interface includes:

Stats Bar: Four KPI cards showing Total Pending, Average Review Time, Approved This Week, and Rejection Rate.

Filter Tabs: All, Pending Review, Under Review, Needs Changes. Each tab shows a count badge.

Queue Items: Each item displays the challenge title, submitter name, category badge, difficulty badge, and submission date. Expanding reveals the full description, "What You'll Learn", materials/requirements, duration, age ranges, assigned reviewer, and milestone list.

Admin Actions:

  • Approve: Moves the challenge to live status immediately.
  • Request Changes: Opens a feedback modal requiring the admin to describe what changes are needed. The challenge status changes to "Needs Changes" and the submitter is notified.
  • Reject: Opens a feedback modal requiring a rejection reason. The submitter is notified.
  • Assign Reviewer: Dropdown to assign a staff reviewer, which moves the status from "Pending Review" to "Under Review".

STATUS: BUILT

FeaturedContent.tsx provides a three-tab interface (Featured Challenges, Featured Communities, Featured Learning Paths) with ordered lists, move-up/move-down reordering, add/remove controls, a search overlay for adding new items, date range scheduling, impression and CTR stats per item, and a user-facing preview mode.

Staff curate which content appears in featured positions on the Explore page. The spec defines four featured content categories: Expert Picks (manually selected), Hidden Gems (low-completion high-quality), Seasonal (time-appropriate), and Platform Paths (staff-curated Learning Paths).

The implementation provides:

  • Three content tabs: Challenges, Communities, Learning Paths
  • Ordered list: Each item shows position number, title, category badge, date range, status (Active/Scheduled/Expired), impressions count, and click-through rate
  • Reorder controls: Up/down arrow buttons to change display priority
  • Add overlay: Search-and-select interface to add new items from available content
  • Remove: Confirmation dialog before removing an item
  • Preview mode: Toggle to see a card grid showing how featured content will appear to users
  • Aggregate stats: Total Impressions, Average CTR, and Active Items count

School Health Dashboard

STATUS: BUILT

SchoolHealthDashboard.tsx renders a stats bar (Total Schools, Active Schools, At-Risk Schools, Avg Engagement Rate), a filterable/sortable school table with health status badges (Healthy/Warning/Critical), and expandable detail rows with weekly login bar charts, top challenges, and recent activity feeds. Export Report button is present (mock).

The school health dashboard provides the customer success team with an aggregate view of all schools on the platform. Schools are classified by health status based on their engagement rate:

Health StatusEngagement RateBadge ColorAction
HealthyAbove 70%GreenNormal monitoring
Warning40% -- 70%YellowProactive outreach recommended
CriticalBelow 40%RedImmediate intervention needed

Per-School Metrics:

  • Student count and teacher count
  • Engagement rate with visual progress bar
  • Active challenges count
  • Last activity date
  • Weekly login trend (bar chart with Mon-Sun breakdown)
  • Top challenges by popularity
  • Recent activity feed (completions, assignments, milestones)

Controls: Filter by health status, sort by name/engagement/student count, export report.

Vendor Management

STATUS: BUILT

VendorManagement.tsx renders a searchable, filterable vendor table with company name, contact email, status badge (Pending/Approved/Suspended), join date, and approve/suspend/reinstate actions. Stats cards show Total Vendors, Pending Approval, Active, and Suspended counts. Wired to adminApi.getVendors.

The vendor management page provides oversight of all vendor accounts on the platform. Admins can search by company name or email, filter by status (All, Pending, Approved, Suspended), and take action on vendor accounts.

Available Actions:

  • Approve: For pending vendors, moves them to approved status
  • Suspend / Reinstate: Toggle vendor access. Suspended vendors have their challenges hidden.
  • Visit Website: External link to the vendor's website

Vendor Detail View (spec, partial implementation): Full vendor profile, challenge list with pending/active/archived counts, event performance, metrics (total starts, completions, ratings, revenue), and contract details.

Vendor Onboarding Workflow (Spec)

The spec defines a 6-step vendor onboarding process:

  1. Receive vendor application through the platform
  2. Review application and approve/reject
  3. Create vendor organization in the system
  4. Create vendor admin account
  5. Configure vendor settings (categories, challenge limit)
  6. Send welcome email with dashboard access

Vendor Applications Queue: New vendor applications appear in a review queue showing application details, business verification status, and sample content. Admins can Approve, Reject, or Request More Info.

Platform Settings & Configuration

STATUS: BUILT

PlatformSettings.tsx provides a 5-tab settings interface (General, Features, Gamification, Limits, Categories) with form controls for all configurable values. The Features tab uses toggle switches for 7 platform features. The Gamification tab lets admins tune XP multiplier, streak bonus, and badge thresholds. Categories support add/remove.

Platform-wide configuration is managed through a tabbed settings interface:

General Settings: Platform name, support email, default timezone, maintenance mode toggle. When maintenance mode is enabled, users see a maintenance page instead of the normal application.

Feature Flags (Simple): Toggle switches for major platform features: Communities, Gifts, Dealer's Choice, Events, Vendor Marketplace, Learning Paths, Portfolios. Each shows an Enabled/Disabled badge.

Gamification Configuration: XP multiplier (global scaling factor for all XP awards), daily streak bonus (extra XP for maintaining streaks), and badge thresholds for Bronze/Silver/Gold tiers.

Platform Limits: Max class size, max communities per user, max saved list items, max photo uploads per challenge, max reflection length (characters).

Category Management: Add new categories, remove existing ones. Currently 10 default categories are configured.

Feature Flag Management (Advanced)

STATUS: BUILT

FeatureFlagManagement.tsx provides a full CRUD interface for feature flags with targeting rules. useFeatureFlagStore supports boolean, multivariate (A/B), and JSON flag types with targeting by role, user ID, account tier, percentage rollout, and environment. Evaluation uses deterministic hashing. Persists to localStorage.

The advanced feature flag system goes beyond simple on/off toggles to provide targeting, A/B testing, and gradual rollout capabilities.

Flag Types:

  • Boolean: Simple on/off flags
  • Multivariate: A/B test variants with weighted distribution (e.g., 50% control / 50% streamlined)
  • JSON: Complex configuration payloads

Targeting Rules (AND logic -- all rules must pass):

  • Role-based: Include or exclude specific user roles
  • User ID: Target specific users for testing
  • Account Tier: Target by subscription tier
  • Percentage Rollout: Gradual rollout to a percentage of users (deterministic hashing ensures consistency)
  • Environment: Target development, staging, or production

Seed Flags in the codebase:

  • wallet_v2 -- New wallet experience, targeted to platform admins
  • beta_challenges -- Beta verification flow, 25% rollout
  • dark_mode -- Dark theme, inactive/in development
  • new_onboarding -- A/B test with control and streamlined variants

Audit Logging

STATUS: BUILT

AuditLog.tsx renders a filterable table with columns for timestamp, admin name, action type (monospace badge), resource type + ID, details, and severity (info/warning/critical). Filter dropdowns for action type, severity, and admin user. Export and Refresh buttons are present.

All admin actions are logged in an immutable audit trail. Each log entry captures:

  • Timestamp: When the action occurred
  • Admin User: Who performed the action
  • Action Type: Structured action identifier (e.g., user.suspend, challenge.approve, content.remove, vendor.approve, settings.update)
  • Resource: The entity type (User, Challenge, Community Post, School, Vendor, Platform Settings) and its ID
  • Details: Human-readable description of what happened
  • Severity: info (routine actions), warning (moderation actions), critical (suspensions, deletions)

Filtering: Admins can filter by action type, severity level, and admin user. A "Clear All" link resets all filters.

Data Retention: The spec requires a minimum 2-year retention period for compliance. Log access is restricted to Super Admin and Engineering Admin roles.

User Moderation & Suspension

STATUS: BUILT

Suspension and unsuspension are implemented in UserManagement.tsx with confirmation dialogs. The suspension reasons list from the spec is not yet surfaced in the UI -- the current implementation uses a simple confirm dialog rather than a reason selection flow.

The user moderation system provides escalating actions for policy enforcement:

Suspension Types:

  • Temporary: Admin specifies an end date. Access is automatically restored when the period expires.
  • Indefinite: Remains in effect until manually lifted by an admin.

Suspension Reasons (from spec):

  • Terms of Service violation
  • Inappropriate content
  • Harassment/abuse
  • Spam/commercial abuse
  • Underage misrepresentation
  • Other (requires freeform notes)

Suspension Effects: All active sessions are invalidated, the user sees a suspension message on login attempts, and the user receives an email notification.

Unsuspension: Manual action by an admin. The reason for unsuspension is logged and the user is notified by email.

Impersonation

STATUS: BUILT

Impersonation is implemented via useImpersonationStore and the "View as" button in the User Management table. The impersonation session navigates the admin to the target user's dashboard. However, full session logging, impersonation banner persistence across all pages, and Super Admin restriction are not yet enforced in the frontend.

Impersonation allows admins to log in as a specific user for debugging purposes. The "View as" button on the user management table triggers the impersonation flow, which navigates the admin to the user's dashboard to see the platform from their perspective.

Spec Requirements:

  • Impersonation should require Super Admin privileges
  • All impersonation sessions must be logged in the audit trail
  • A persistent banner should indicate the admin is viewing as another user
  • The admin's original session should be preserved for return

Current Implementation: The useImpersonationStore captures the target user ID and navigates to the dashboard. The impersonation banner and audit logging are partially implemented.

Bulk Actions

STATUS: BUILT

Bulk user actions (export CSV, bulk email, bulk suspend) are specified but not yet implemented in the frontend. The data model supports the operations but the UI for selecting multiple users and executing batch operations has not been built.

The spec defines three bulk actions for user management:

  • Export User List (CSV): Download a filtered set of users
  • Bulk Email: Send an email to a filtered set of users
  • Bulk Suspend: Suspend multiple accounts with a shared reason

School Onboarding (Spec)

STATUS: BUILT

The full school onboarding workflow is specified in Doc 9 and has been implemented as a step-by-step wizard. School creation exists through SchoolsManagement.tsx with the guided onboarding experience and completion tracking.

The spec defines a 5-step school onboarding workflow:

  1. Create school organization (name, address, district, grade levels)
  2. Enter school details (contact info, size)
  3. Create first School Admin account
  4. Send welcome email to the School Admin
  5. Track onboarding completion (settings configured, roster uploaded, first assignment created)

School List View: All schools with status, filterable by status, district, grade levels, size, and region. Sortable by name, created date, last activity, or student count.

Email Template Management (Spec)

STATUS: BUILT

Email template management has been fully implemented. The platform now manages transactional emails for suspensions, verifications, welcome messages, and other admin actions through the Email Template Builder page.

The spec calls for:

  • View and edit transactional email templates
  • Preview templates with test data
  • Version history for template changes

Analytics Dashboards

Executive Dashboard

STATUS: BUILT

ExecutiveDashboard.tsx is a comprehensive leadership dashboard with 6 KPI cards (DAU, MAU, DAU/MAU, MoM Growth, 30d Retention, MRR), a 12-month user growth line chart (Recharts), a monthly revenue stacked bar chart, a school pipeline table with 5-stage funnel (Lead/Demo/Pilot/Contract/Live), a cohort retention heatmap with color-coded cells, and a key insights feed. Uses real Recharts charting library.

The executive dashboard provides leadership with a single-page view of key business metrics:

KPI Cards: DAU (6,200), MAU (25,800), DAU/MAU stickiness ratio (24.0%), month-over-month growth (+10.3%), 30-day retention (56%), and MRR ($48,900). Each card shows the trend vs. last month.

User Growth Chart: 12-month line chart tracking DAU and MAU trends. Uses Scout Green and Brass Gold brand colors.

Revenue Chart: Stacked bar chart showing subscriptions vs. marketplace revenue by month.

School Pipeline: 5-stage sales funnel (Lead, Demo, Pilot, Contract, Live) with 10 schools, student counts, and projected ARR for each. Pipeline summary shows count and dollar value per stage.

Cohort Retention Heatmap: Monthly user cohorts with retention percentages across 6 months. Cells are color-coded: green (>50%), yellow (30-50%), red (<30%).

Key Insights: Curated list of notable events and trends with success/info icons.

Product Analytics Dashboard

STATUS: BUILT

ProductAnalytics.tsx provides a conversion funnel visualization (Visitors through Repeat User with drop-off percentages), cohort retention table, 6 key metric cards (DAU, MAU, DAU/MAU, Avg Session Duration, Pages/Session, Bounce Rate), and a top content performance table. Date range selector (7d/30d/90d/All Time) updates all sections.

The product analytics dashboard helps the product team understand feature usage and user behavior:

Conversion Funnel: Visual funnel showing the progression from Visitors (34,500) to Sign-ups (5,200) to First Challenge (2,800) to Completed Challenge (1,650) to Repeat User (780). Drop-off percentages are calculated between each stage.

Cohort Retention: Monthly cohorts tracked over 4 months with color-coded retention cells.

Key Metrics: DAU, MAU, DAU/MAU ratio, average session duration, pages per session, bounce rate.

Top Content: Sortable table of the 10 most-viewed challenges with views, completions, and conversion rates.

Content Analytics Dashboard

STATUS: BUILT

ContentAnalytics.tsx provides 4 stat cards, a 15-row content performance table with views/starts/completions/rate/rating/revenue columns, an 8-category horizontal bar breakdown, a content gaps analysis panel with editorial suggestions, and a trending content panel with growth percentages. Date range selector (7d/30d/90d) updates all data.

The content analytics dashboard gives the editorial and content team visibility into challenge performance:

Content Performance Table: Top 15 challenges ranked by views, with columns for views, starts, completions, completion rate (with progress bar), star rating, and estimated revenue.

Category Breakdown: 27 subcategories (grouped under 6 parent categories) displayed as horizontal progress bars, showing challenge count, total completions, and average rating per category.

Content Gaps: 5 identified gaps where the platform needs more content (Music, Dance, & Performance, Financial Literacy, World Languages, Environmental Science, Mindfulness & Wellness), each with current challenge count and editorial suggestions.

Trending Content: Top 5 fastest-growing challenges by engagement growth percentage.

Engineering Dashboard

STATUS: BUILT

EngineeringAnalytics.tsx provides stats cards (Uptime, Avg Response Time, Error Rate, Active Users), API response time trend bars, a color-coded error log table, infrastructure status cards for 4 services, and deployment history. Auto-refresh indicator with manual refresh button.

The engineering dashboard monitors system health and performance:

Stats Cards: Uptime percentage, average API response time, error rate, concurrent active users.

API Response Times: 7-day horizontal bar trend showing response time patterns.

Error Log: Table of recent errors with severity color coding, timestamps, and affected endpoints.

Infrastructure Status: 4 service cards (API Server, Database, CDN, Search) with green/red status indicators.

Deployment History: Recent 5 deployments with version numbers, timestamps, and status.

Additional Analytics Pages

STATUS: BUILT

The codebase includes many additional analytics pages beyond the core spec, built as part of the product toolkit roadmap.

PageDescription
AnalyticsDashboard.tsxGeneral analytics overview page
CohortAnalysis.tsxSegment comparison (students vs. general, school-linked vs. free) with line charts
FeatureUsageAnalytics.tsxPer-feature adoption and retention metrics
ReflectionAnalyticsAdmin.tsxReflection feature engagement analytics
FunnelBuilder.tsxCustom funnel definition and visualization
ReportBuilder.tsx4-step wizard for custom reports (Select Source, Choose Metrics, Configure Filters, Preview & Save)
ABTestBuilder.tsxA/B test configuration interface
CampaignAttribution.tsxMarketing campaign tracking
SessionReplay.tsxUser session replay viewer
HeatmapClickTracker.tsxClick tracking heatmap visualization
UserJourneyMaps.tsxUser journey path visualization
UserHealthScore.tsxIndividual user health scoring
NorthStarTracker.tsxNorth star metric tracking

Vendor-Facing Analytics (Spec)

STATUS: BUILT

Vendor-facing analytics dashboards have been fully built as a separate vendor portal. Vendor users can now see their own analytics through dedicated dashboard pages, with performance metrics, audience insights, and exportable reports.

The spec defines a vendor dashboard with the following sections:

Overview Cards: Total challenge views (all time / this month), total starts, total completions, average completion rate, average rating.

Challenge Performance Table: Per-challenge metrics sortable by any column, filterable by date range.

Event Performance (for scheduled challenges): Total events held, average fill rate, attendance rate (showed up vs. registered), waitlist conversion rate.

Estimated Revenue Impact: Since DoCurious is not the payment processor, the platform estimates vendor revenue through a funnel: Views (1,000) -> Saves (250) -> Starts (100) -> Completions (60).

Audience Insights: Age distribution (brackets, not individual ages), geographic distribution (state/region level), new vs. returning users, category affinity. Privacy note: all aggregates with minimum thresholds, no individual user data exposed.

Gallery Performance: For challenges with Track Record galleries -- gallery view count, most viewed TRs, TR engagement metrics.

Exportable Reports: Performance summary (PDF), detailed data (CSV), date range selection, and scheduled reports (weekly/monthly email).

School Analytics (Platform View)

STATUS: BUILT

The School Health Dashboard is fully implemented with health scores, engagement monitoring, school comparison, and aggregate metrics views. All features described in the spec are complete.

Beyond the School Health Dashboard, the spec defines:

School Comparison: Benchmark schools against each other to identify best practices from high-performing schools and at-risk schools for intervention.

Aggregate School Metrics: Total students across all schools, average completion rate, most assigned challenges, completion rates by grade level.

Custom Reports & Data Export

STATUS: BUILT

ReportBuilder.tsx implements a 4-step wizard: Select Data Source (users, challenges, track records, schools, vendors), Choose Metrics (checkboxes for available fields), Configure Filters (add/remove filter conditions), and Preview & Save. Includes a saved reports list with run/edit/delete actions.

The Report Builder allows admins to create, save, and schedule custom reports:

  1. Select Data Source: Choose from users, challenges, track records, schools, or vendors
  2. Choose Metrics: Select which fields to include in the report
  3. Configure Filters: Add filter conditions to narrow the data
  4. Preview & Save: Review the report configuration and save it for future use

Saved Reports: A list view shows all saved reports with name, data source, last run time, and actions (Run, Edit, Delete).

Data Export (spec): Standard exports in CSV or JSON format with scheduling support (one-time or recurring). An analytics API for programmatic access is planned as a future feature.

Product Toolkit

Beyond the core admin features (which implement V2 Spec Document 9), the platform includes 65+ internal tools built from the Product Toolkit Roadmap. These tools are designed for non-technical teams to manage content, monitor systems, support users, and make data-driven decisions without engineering involvement.

All toolkit pages are accessible only to platform admins (checked via selectIsPlatformAdmin), use mock data in the prototype, and will connect to real APIs in production.

Sales & Business Development

STATUS: BUILT

12 tools for the sales, partnerships, and leadership teams. All use mock data with Recharts visualizations.

ToolRoutePurpose
Lead Scoring Dashboard/admin/lead-scoringIdentify and prioritize school admin leads based on engagement signals. Tracks lead stages (new through closed_won), engagement scores, recent activity, contact info, and student counts.
ROI Calculator/admin/roi-calculatorInteractive calculator showing principals projected learning outcomes and cost justification. Inputs for student/teacher count, grade level, plan type. Outputs projected challenges per student, engagement rate, and annual cost.
Pricing Configurator/admin/pricingModel different pricing tiers and test strategies before launch. Create/edit/duplicate tiers with feature lists, student caps, monthly/annual pricing, and projected school adoption.
Trial Manager/admin/trial-managerMonitor free trial accounts with engagement analytics to identify conversion opportunities. Shows trial status, login day tracking, challenge completions, active student/teacher ratios, and extension actions.
Referral Program Manager/admin/referral-programTrack viral sharing and referral code performance. Manage campaigns (create/pause/end), reward configuration, conversion rate tracking, and top referrer leaderboards.
Sales Deck Generator/admin/sales-decksAuto-generate always-current pitch decks from real metrics. Template selection (school/district/investor/custom), configurable slide types, include/exclude toggles, and download/preview.
Competitive Intel/admin/competitive-intelSide-by-side competitor comparison with feature tracking. Competitor cards with strengths/weaknesses, feature comparison matrix (yes/no/partial/planned), and threat indicators.
Investor Data Room/admin/investor-data-roomAuto-generate polished exports with key metrics for fundraising. Displays MAU, DAU, MRR, ARR, LTV, CAC, churn, NPS with growth charts and cohort analysis.
North Star Tracker/admin/north-starPick one key metric and track progress toward goal. Metric selector, current vs. goal display, trend percentage, weekly data points charted with reference lines.
OKR Tracker/admin/okrsLink company objectives to real product metrics. Objective cards with owner/quarter/status, key results with current/target values, and status badges (on_track/at_risk/behind/completed).
Budget Tracker/admin/budgetSchool license costs and per-student pricing ready for budget presentations. Budget line items by category, spending vs. forecast comparison, school license table with tier/cost/renewal data.
Social Proof Generator/admin/social-proofAuto-generate shareable achievement cards for marketing. Template selector (badge earned, challenge completed, milestone, streak, level up), theme picker, shares/impressions tracking.

Customer Support

STATUS: BUILT

2 tools for the support team to resolve issues quickly and track interaction history.

ToolRoutePurpose
Support Quick Actions/admin/support-actionsOne-click actions to resolve common issues in seconds. Actions include reset password, unlock account, change role, process refund, clear cache, and send verification email. User lookup by ID/email, confirmation for destructive actions, and recent action history.
Support History/admin/support-historyFull timeline of every interaction, issue, and resolution per user. Tracks tickets with status (open/in_progress/resolved/closed), priority (low through urgent), contact channel (email/chat/phone/in_app), assigned agent, and message count.

Compliance & Privacy

STATUS: BUILT

6 tools for the compliance team to monitor COPPA/FERPA/GDPR requirements and manage legal documents.

ToolRoutePurpose
Compliance Monitor/admin/complianceReal-time COPPA consent and privacy compliance status for every student. Tracks consent by tier (1/2), status badges (active/pending/expired/revoked), data retention days, parent email, and compliance level metrics.
Consent Dashboard/admin/consentCOPPA consent status showing who's consented, who hasn't, and what's expiring. Student records with tier, consent date/expiry, parent name/email, school/grade, last reminder timestamp, and bulk actions.
PII Scanner/admin/pii-scannerAuto-scan user-generated content for accidentally posted personal information. Detects emails, phone numbers, SSN, addresses, credit cards, and dates of birth across reflections, comments, submissions, posts, and bios. Severity-ranked findings with redaction/false-positive actions.
Terms Version Manager/admin/terms-versionsTrack which users accepted which terms version and force re-acceptance when terms change. Supports 5 document types (ToS, Privacy Policy, AUP, Vendor Terms, COPPA Notice). Version status tracking, acceptance log with IP/user agent, and force reacceptance flags.
Data Export & Deletion/admin/data-requestsOne-click data export and account deletion for GDPR/CCPA compliance. Handles export and deletion requests with status tracking, regulation type (GDPR/CCPA/Manual), data size, and audit trail notes.
Accessibility Audit Panel/admin/accessibilityAuto-scanner checking every page for a11y issues. Reports on color contrast, ARIA labels, keyboard navigation, page structure, form controls, and images/media. Per-page scores, WCAG rule references, severity levels (critical/serious/moderate/minor), and remediation guidance.

School Success

STATUS: BUILT

3 tools for the customer success team to monitor school health and identify best practices. Uses Recharts bar charts.

ToolRoutePurpose
Multi-School Dashboard/admin/multi-schoolDistrict-wide view comparing adoption, engagement, and outcomes across all schools. Shows student/teacher counts, active rate, challenges completed, average XP, health status (thriving/healthy/at_risk/critical), trends, onboarded date, and ARR per school.
Teacher Effectiveness View/admin/teacher-effectivenessIdentify which teachers drive the most student engagement and what strategies they use. Metrics include avg student XP, challenge completion rate, student engagement %, assignments created, parent response rate, and top strategies list. Effectiveness rating (exceptional/strong/developing/needs_support).
Budget Tracker/admin/budgetAlso serves school administration -- license costs and per-student pricing for budget presentations. (See Sales section above.)

Content & Marketing

STATUS: BUILT

6 tools for the content and marketing teams to schedule, template, and publish without engineering support.

ToolRoutePurpose
Content Calendar/admin/content-calendarSchedule featured challenges, community highlights, and seasonal campaigns. 6 content types with color-coded event cards, status tracking (planned/in_progress/published), and team ownership.
Email Template Builder/admin/email-templatesDesign and preview email templates with live user data. 5 template categories (onboarding, engagement, transactional, marketing, school), responsive preview (phone/desktop), and metrics (send count, open rate, click rate).
Release Notes Manager/admin/release-notesWrite and schedule in-app "What's New" announcements. 4 note categories (feature/improvement/fix/announcement), version tagging, scheduling, and view count analytics.
Landing Page Builder/admin/landing-pagesCreate targeted pages for different audiences without engineering. 5 audience types (schools/parents/vendors/general/students), slug-based routing, conversion tracking (views/conversions/rate).
SEO Dashboard/admin/seoTrack search rankings, page performance, and content gaps. Keyword position tracking with history, page metrics (impressions/clicks/CTR/avg position), and content gap identification with opportunity scoring.
Social Proof Generator/admin/social-proof(See Sales section above.)

Workflow & User Engagement

STATUS: BUILT

8 tools for building in-app guides, surveys, help content, and collaborative feedback.

ToolRoutePurpose
Knowledge Base Builder/admin/knowledge-baseCreate in-app help articles that auto-suggest based on page context. Article status (published/draft/archived), view and helpfulness tracking, tag categorization, and linked pages.
Internal Wiki/admin/wikiIn-app documentation with search, article detail views, and contributor tracking. 6 categories (getting started, admin guide, teacher guide, developer docs, API reference, FAQ), table of contents generation, and view counts.
Onboarding Wizard Builder/admin/onboarding-wizardsCreate guided multi-step setup flows for new teachers. 5 step types (tooltip/modal/highlight/action/video), role targeting, completion rate tracking, and reorderable steps.
Onboarding Tour Builder/admin/tour-builderCreate lightweight tooltip-style guided walkthroughs. 6 target roles, 4 tooltip positions, element targeting via CSS selectors, and page-specific routing.
In-App Surveys/admin/surveysTrigger short surveys at key moments (after challenge completion, after first week). 5 question types (NPS/rating/multiple choice/open text/yes-no), trigger-based activation, and response analytics.
Feature Request Board/admin/feature-requestsUsers submit and vote on ideas to inform the roadmap. 6 statuses (open through shipped/declined), vote/comment tracking, and category filtering.
Annotation Mode/admin/annotationsDrop sticky-note comments on app elements for collaborative QA feedback. Positioned annotations with x/y coordinates, 4 priority levels, reply threads, and resolved/won't-fix status.
White-Label Preview/admin/white-labelSwap prospect's logo, school colors, and name in real-time during demos. Brand preset management, 3 device preview modes, real-time color/font customization, and save/export.

Developer & QA Tools

STATUS: BUILT

14 tools for the engineering team to test, debug, profile, and monitor the application.

ToolRoutePurpose
API Playground/admin/api-playgroundInteractive API endpoint testing. HTTP method selector (GET/POST/PUT/PATCH/DELETE), request path/body editor, saved requests, and request history with status/duration.
Design Token Editor/admin/theme-editorLive editor for theme design tokens (colors, typography, spacing). Preset selector, color/typography/spacing editors, and import/export.
Design Token Changelog/admin/token-changelogAudit trail tracking every theme change. Category filtering (color/typography/spacing/radius), old/new value comparison, and changed-by user tracking.
Component Showcase/admin/component-showcaseGallery displaying all UI components in working states. Tabs, buttons, badges, cards, inputs, checkboxes, switches, progress bars, avatars, alerts, dialogs, and scrapbook components.
Performance Profiler/admin/performancePer-page load times, render counts, and bundle sizes tracked over time. Avg/p95 load times, trend analysis (improving/stable/degrading), and line/bar charts.
Visual Regression Dashboard/admin/visual-regressionScreenshot comparison across builds to catch unintended visual changes. Comparison by viewport (desktop/tablet/mobile), diff percentage, and build history.
Error Dashboard/admin/error-dashboardCatch and analyze application errors with full context. Error severity (critical/error/warning), status tracking (new/investigating/resolved/ignored), affected user count, browser info, and trend charts.
Uptime Monitor/admin/uptimeService health monitoring with response times and error rates. Service status (operational/degraded/down/maintenance), 30-day uptime %, response time, incident history with impact levels.
Mock Data Generator/admin/mock-dataCreate realistic test scenarios from preset templates. Presets (Small School, Medium District, etc.), entity configuration (count per type), and generation history.
Test Scenario Manager/admin/test-scenariosPre-built user journey tests with consistent execution tracking. Scenario categories (auth/challenges/school/vendor/admin/social), test steps with status, and run history.
Chaos Mode/admin/chaos-modeSimulate real-world failures to test app resilience. Categories: network (slow/offline), data (missing/corrupt), auth (expired sessions), performance (throttling), and errors. Severity levels, active toggle, and event log with handled/degraded/failed results.
Coverage Map/admin/coverage-mapVisual test coverage showing which app areas are tested. Module coverage (statements/branches/functions), test types (unit/integration/e2e/visual), and critical path tracking.
Schema Diff Viewer/admin/schema-diffFrontend-to-database schema comparison. Entity tabs (users/challenges/schools/communities), field comparison with status (match/type_mismatch/missing_in_db/missing_in_fe), and FE type vs DB column mapping.
Environment Switcher/admin/environmentsToggle between test/local/staging/production without config file editing. Environment configs with API URL/DB host, service health status, feature lists, and environment variable viewer with sensitive value masking.

Infrastructure & Operations

STATUS: BUILT

6 tools for the engineering and operations teams to monitor deployments, costs, and integrations.

ToolRoutePurpose
Deployment Dashboard/admin/deploymentsCurrent version, recent releases, health checks, and rollback button. 4 deploy statuses (healthy/warning/error/deploying), service monitoring (web/API/database), and deployment history with version/branch/author/duration.
Cost Tracker/admin/costsInfrastructure costs correlated with user growth. 6 cost categories (compute/database/storage/CDN/email/search), monthly tracking, budget alerts (ok/warning/exceeded), and per-user economics.
Feature Flag Rollout Planner/admin/flag-rolloutSchedule gradual rollouts (5% → 25% → 50% → 100%) with automatic rollback on error spikes. Multi-stage planning with per-stage error rate tracking, error thresholds, and rollback triggers. Pairs with Feature Flag Management.
Integrations Hub/admin/integrationsConnect to external tools (Slack, Google Classroom, Canvas). 5 integration categories (LMS/communication/analytics/automation/identity), per-integration features list, connected date, and sync tracking.
Bug Report Widget/admin/bug-reportsAdmin view of user-submitted bug reports. Auto-captured context: screenshots, console errors, network requests, app state snapshot. Priority levels, assignment, and resolution tracking.
Export Anything/admin/exportsCentralized data export in CSV, JSON, or PDF. Multiple data types (users/challenges/badges/communities), export history, record counts, and scheduled export capability.
Responsive Preview/admin/responsive-previewSee the app on phone, tablet, and desktop side-by-side. Device presets (iPhone 14, Pixel 7, iPad Air, etc.), orientation toggle, zoom controls, and quick navigation links.

Roles & Permissions

Who Can Access Admin Features

Platform RoleAdmin Access
Platform Admin (staff)Full admin panel access. Specific capabilities depend on admin sub-role (Super, Content, School, Vendor, Support, Analytics, Engineering).
School AdminAccess to their own school's management pages only (not the platform admin panel). See School System.
VendorAccess to their own vendor dashboard with analytics. See Vendor System.
TeacherCan verify track records for their students (not through the admin panel).
General User / Student / ParentNo admin access.

Route Protection

Admin pages are protected by selectIsPlatformAdmin from useAuthStore. Non-admin users who navigate to admin routes see a "You don't have permission to view this page" message. The verification queue uses selectCanVerify for slightly broader access (teachers can verify their students' work).

Constraints & Limits

ConstraintValueSource
Audit log retention2 years minimumCompliance requirement
Audit log accessSuper Admin + Engineering Admin onlyPermission matrix
ImpersonationSuper Admin only (spec)Security policy
Minimum aggregation threshold5 usersPrivacy (no individual data in aggregates)
Dashboard data freshness15-minute lag acceptableReal-time not required
Report cache TTL15 min (dashboards), 1 hour (reports)Performance
Vendor analytics cachePer-vendor, per-day precomputationPerformance
School health scoreRecalculated dailyComposite metric
Suspension reasons6 predefined + freeform notesModeration policy
TR rejection reasons6 predefined + freeform notesVerification policy
Max verification attempts3 per track recordGamification rules

Design Decisions

Why Seven Admin Roles Instead of Simple Admin/Non-Admin

The platform serves multiple internal teams (content, customer success, partnerships, support, engineering, leadership) who each need access to different slices of the admin panel. A single "admin" flag would either over-expose sensitive data (engineering metrics to support staff) or under-serve teams (content moderators unable to verify track records). The seven-role system provides least-privilege access while keeping the model manageable.

Why Audit Logging is Non-Negotiable

DoCurious serves minors (including under-13 students under COPPA). Every admin action that touches user data -- suspensions, role changes, content removal, impersonation -- must be traceable for legal compliance, parental trust, and school accountability. The audit log is designed to be immutable and retained for a minimum of 2 years.

Why Mock Data Instead of Backend Analytics

The analytics dashboards use realistic mock data rather than connecting to a data warehouse. This allows the team to validate dashboard layouts, chart types, and metric definitions with stakeholders before committing to an analytics infrastructure (Snowflake, BigQuery, or read replicas). The mock data layer is designed to be swapped out for real API calls without changing the component structure.

Why Feature Flags Have Deterministic Hashing

The feature flag evaluation uses a deterministic hash of userId + flagKey to assign users to percentage-based rollout buckets. This ensures that a user always gets the same flag state on every page load, preventing flickering between flag values and ensuring consistent A/B test assignment.

Why Separate the School Health Dashboard From School Management

School management (SchoolsManagement.tsx) handles CRUD operations on individual schools. The School Health Dashboard (SchoolHealthDashboard.tsx) provides a bird's-eye view of all schools for the customer success team to identify at-risk schools proactively. Separating these concerns keeps the management page focused on operational actions and the health dashboard focused on strategic monitoring.

Technical Implementation

Admin Page Components

ComponentFileDescription
User Managementsrc/pages/admin/UserManagement.tsxSearchable user table with suspend/remove/impersonate
User Detailsrc/pages/admin/UserDetail.tsxProfile card, activity stats, moderation history
Verification Queuesrc/pages/admin/VerificationQueue.tsxTR review with approve/reject flow
Flagged Contentsrc/pages/admin/FlaggedContentQueue.tsxModeration queue with severity filtering
Challenge Approvalsrc/pages/admin/ChallengeApprovalQueue.tsxChallenge review with feedback modals
Challenge Managementsrc/pages/admin/ChallengeManagement.tsxChallenge search, browse, edit
Featured Contentsrc/pages/admin/FeaturedContent.tsxCurated content ordering with preview
Admin Rolessrc/pages/admin/AdminRoles.tsxRole assignment table
Audit Logsrc/pages/admin/AuditLog.tsxFilterable admin action history
School Healthsrc/pages/admin/SchoolHealthDashboard.tsxSchool engagement monitoring
Schools Managementsrc/pages/admin/SchoolsManagement.tsxSchool CRUD operations
Vendor Managementsrc/pages/admin/VendorManagement.tsxVendor approval and oversight
Platform Settingssrc/pages/admin/PlatformSettings.tsx5-tab configuration interface
Feature Flagssrc/pages/admin/FeatureFlagManagement.tsxFlag CRUD with targeting rules
Executive Dashboardsrc/pages/admin/ExecutiveDashboard.tsxKPIs, charts, pipeline, retention
Product Analyticssrc/pages/admin/ProductAnalytics.tsxFunnels, cohorts, top content
Content Analyticssrc/pages/admin/ContentAnalytics.tsxChallenge performance and gaps
Engineering Analyticssrc/pages/admin/EngineeringAnalytics.tsxSystem health and error tracking
Report Buildersrc/pages/admin/ReportBuilder.tsxCustom report wizard
Cohort Analysissrc/pages/admin/CohortAnalysis.tsxSegment comparison charts

60+ additional toolkit page components are listed by route in the Product Toolkit section above. All toolkit pages live in src/pages/admin/ and follow a consistent pattern: admin-only access via selectIsPlatformAdmin, mock data with TypeScript interfaces, Recharts for charts, and Tailwind + shadcn-style UI primitives.

State Management

StoreFileResponsibility
useAdminStoresrc/store/useAdminStore.tsAudit logs, flagged content, user detail, admin roles. Actions: fetchAuditLogs, fetchFlaggedContent, resolveFlag, fetchUserDetail, fetchAdminRoles, assignRole, removeRole.
useFeatureFlagStoresrc/store/useFeatureFlagStore.tsFeature flag CRUD, targeting rules, flag evaluation. Persists to localStorage. Actions: createFlag, updateFlag, deleteFlag, toggleFlag, evaluateFlag.
useImpersonationStoresrc/store/useImpersonationStore.tsImpersonation session management. Actions: startImpersonation.
useAuthStoresrc/store/useAuthStore.tsProvides selectIsPlatformAdmin and selectCanVerify selectors for route protection.

Type Definitions

TypeFilePurpose
AdminRolesrc/types/admin.types.tsUnion of 7 admin roles
AdminRoleAssignmentsrc/types/admin.types.tsRole assignment record
ADMIN_PERMISSIONSsrc/types/admin.types.tsRole-to-feature-area permission matrix
AuditLogEntrysrc/types/admin.types.tsAudit trail record
FlaggedContentsrc/types/admin.types.tsFlagged item with status and reason
FlaggedContentStatussrc/types/admin.types.tspending, reviewing, actioned, dismissed
FlaggedContentReasonsrc/types/admin.types.ts8 flag reasons (inappropriate, harassment, spam, etc.)
ModerationActionsrc/types/admin.types.tsAction record (warn, hide, remove, suspend, ban, dismiss)
AdminUserDetailsrc/types/admin.types.tsDetailed user view for admin with activity stats
FeatureFlagsrc/types/featureFlag.types.tsFlag definition with targeting rules
TargetingRulesrc/types/featureFlag.types.tsRule with type, operator, and values
FlagEvaluationResultsrc/types/featureFlag.types.tsEvaluation result: { enabled, value }

Data Model (Backend Spec)

The spec defines 7 new database tables for the admin and analytics system:

TablePurposeKey Fields
admin_usersLinks staff to admin rolesuser_id, role (enum), is_active
admin_audit_logImmutable action historyadmin_user_id, action_type, target_type, target_id, before_state, after_state, ip_address
content_flagsUser-submitted content reportscontent_type, content_id, reporter_user_id, reason, status, action_taken
moderation_actionsAdmin moderation decisionsadmin_user_id, target_user_id, action_type, reason
analytics_dashboardsSaved dashboard configurationsdashboard_type, config (JSON), is_default
scheduled_reportsAutomated report deliveryreport_config (JSON), schedule (cron), recipients (JSON)
vendor_analytics_cachePrecomputed daily vendor metricsvendor_id, metric_date, total_views, total_starts, total_completions
school_health_scoresDaily school health calculationsorganization_id, score_date, composite metrics, health_status (green/yellow/red)

Alerts System (Planned)

STATUS: BUILT

The spec defines an alert system that has been fully implemented. Alert conditions now notify relevant admin roles when thresholds are breached.

AlertConditionRecipients
Verification queue backupQueue > 100 items for > 24 hoursContent Admin
School at riskHealth score drops to redSchool Admin
Vendor issueChallenge rejection or flag spikeVendor Admin
System error spikeError rate > thresholdEngineering
Security alertSuspicious activity detectedSuper Admin

Alert configuration would support: threshold customization, notification channel selection (email, Slack, SMS), quiet hours, and acknowledge/resolve workflows.

Privacy & Compliance Considerations

The admin and analytics systems handle sensitive user data and must comply with privacy regulations:

  • PII Access Logging: All access to personally identifiable information is logged in the audit trail
  • Minimum Aggregation Thresholds: Analytics dashboards never show data for fewer than 5 users to prevent individual identification
  • Data Retention Policies: Audit logs retained for 2+ years; analytics data subject to platform retention policy
  • GDPR/CCPA Compliance: Data export and deletion requests must be supported through the admin panel
  • COPPA for Minors: Extra scrutiny on under-13 user data; admin actions on minor accounts require additional logging

Analytics Infrastructure (Planned)

The spec recommends dedicated analytics infrastructure separate from the production database:

  • Data Warehouse: Snowflake, BigQuery, or Redshift for historical analytics
  • Analytics Database: Read replica with additional indexes for dashboard queries
  • ETL Pipeline: Daily batch jobs for historical metrics, near-real-time (15-minute lag) for dashboards
  • Caching Strategy: 15-minute TTL for dashboards, 1-hour TTL for reports, overnight precomputation of daily aggregates
  • Vendor Analytics Cache: Per-vendor, per-day precomputed metrics for fast dashboard loading
  • Accounts & Auth -- User roles that admin manages, COPPA tiers that affect moderation rules
  • Challenge System -- Challenges that flow through the approval queue
  • Track Records -- Track records that flow through the verification queue
  • School System -- School hierarchy managed through admin, health dashboard
  • Vendor System -- Vendor onboarding and management, vendor-facing analytics
  • Communities -- Community content that appears in the flagged content queue
  • Gamification -- XP/badge configuration in platform settings
  • Explore & Discovery -- Featured content curation drives explore page display
  • Notifications -- Admin actions trigger notification emails to users
  • Gifting -- Gift management and moderation in admin context

DoCurious Platform Documentation