Admin Journeys

This document maps all user journeys for system administrators of the SCORM API.

Overview

User Type: System Administrators Entry Point: /admin (requires system admin privileges) Primary Goals: Monitor system health, manage tenants, oversee operations, track SaaS metrics


Journey 1: Admin Monitoring System Health

Persona: System administrator Task: Check overall system health and status Entry Point: /admin

Path

graph TD
    A[Sign In] --> B[Admin Dashboard /admin]
    B --> C[View System Health Section]
    C --> D[Check database status]
    D --> E[Check storage backends]
    E --> F[Check rate limiting]
    F --> G[View active sessions]
    G --> H[Check API key activity]
    H --> I{Issues found?}
    I -->|Yes| J[Investigate issue]
    I -->|No| K[Continue monitoring]
    J --> L[Take corrective action]

Detailed Steps

  1. Start: Admin signs in and navigates to /admin
  2. Admin Dashboard: /admin loads
  3. System Health Section: View health status:
    • Database Status: Connection health, response times
    • Storage Backends: R2 and Supabase storage accessibility
    • Rate Limiting: Distributed vs local rate limiting status
    • Active Sessions: Total and active session counts (24h, 7d)
    • API Key Activity: Total, active, and recently used API keys
    • System Metrics: Memory usage and uptime
  4. Auto-refresh: Metrics refresh every 30 seconds
  5. Status Indicators: Color-coded status (green/yellow/red)
  6. Action: If issues detected, investigate further or take corrective action

Buttons/Actions

  • "Admin Dashboard" link (navigation, admin-only)
  • Auto-refresh (every 30 seconds)
  • Status indicators (click for details)

Exit Point

/admin (continues monitoring) or issue resolution pages


Journey 2: Admin Viewing SaaS Metrics

Persona: System administrator Task: Review business metrics and revenue Entry Point: /admin

Path

graph TD
    A[Admin Dashboard /admin] --> B[Scroll to SaaS Metrics]
    B --> C[View revenue metrics]
    C --> D[MRR and ARR]
    D --> E[Average revenue per tenant]
    E --> F[Monthly churn rate]
    F --> G[View subscription metrics]
    G --> H[Total subscriptions]
    H --> I[Active, trialing, past due]
    I --> J[View revenue trends]
    J --> K[12-month MRR chart]
    K --> L[View usage metrics]
    L --> M[Package uploads, storage, sessions]

Detailed Steps

  1. Start: Admin on /admin dashboard
  2. SaaS Metrics Section: Scroll to SaaS metrics
  3. Revenue Metrics:
    • Monthly Recurring Revenue (MRR)
    • Annual Recurring Revenue (ARR)
    • Average Revenue per Tenant
    • Monthly Churn Rate
  4. Subscription Metrics:
    • Total subscriptions
    • Active, trialing, past due, cancelled, incomplete
    • Subscription tier distribution with MRR breakdown
    • Trial conversion rates
  5. Revenue Trends: MRR trends over last 12 months (chart)
  6. Usage Metrics:
    • Package uploads
    • Storage usage
    • Session activity
    • API key usage
  7. Analysis: Review trends and identify patterns

Buttons/Actions

  • Scroll to SaaS Metrics section
  • Chart interactions (if interactive)
  • Export data (if available)

Exit Point

/admin (metrics reviewed)


Journey 3: Admin Identifying At-Risk Tenants

Persona: System administrator Task: Identify tenants at risk of churning Entry Point: /admin

Path

graph TD
    A[Admin Dashboard /admin] --> B[Scroll to Tenant Activity]
    B --> C[View activity summary]
    C --> D[Total tenants]
    D --> E[Active tenants 7d/30d]
    E --> F[New tenants 7d/30d/90d]
    F --> G[Inactive tenants 30d/60d]
    G --> H[At-risk tenants count]
    H --> I[Click 'View Tenants']
    I --> J[Tenants Page /admin/tenants]
    J --> K[View tenant table]
    K --> L[Filter by risk level]
    L --> M[Review at-risk tenants]
    M --> N[Take action if needed]

Detailed Steps

  1. Start: Admin on /admin dashboard
  2. Tenant Activity Section: Scroll to tenant activity
  3. Activity Summary:
    • Total tenants
    • Active tenants (7d, 30d)
    • New tenants (7d, 30d, 90d)
    • Inactive tenants (30d, 60d)
    • At-risk tenants count
  4. Churn Indicators: View risk assessment:
    • Low risk
    • Medium risk
    • High risk
  5. Action: Click "View Tenants" or navigate to /admin/tenants
  6. Tenants Page: /admin/tenants loads
  7. Tenant Table: View all tenants with:
    • Tenant name
    • Risk level
    • Last activity
    • Subscription status
    • Package count
    • Storage usage
  8. Filter: Filter by risk level (high, medium, low)
  9. Review: Review at-risk tenants and take action if needed

Buttons/Actions

  • "View Tenants" link (tenant activity section)
  • "Tenants" link (admin navigation)
  • Filter dropdown (risk level)
  • Search input (tenant name)
  • Sort controls (table headers)

Exit Point

/admin/tenants (tenants reviewed)


Journey 4: Admin Managing Tenant API Keys

Persona: System administrator Task: View and manage API keys for all tenants Entry Point: /admin/api-keys

Path

graph TD
    A[Admin Dashboard /admin] --> B[Click 'API Keys All Tenants']
    B --> C[API Keys Page /admin/api-keys]
    C --> D[View all API keys]
    D --> E[Filter by tenant]
    E --> F[View key details]
    F --> G{Action needed?}
    G -->|Revoke| H[Click 'Revoke']
    G -->|View usage| I[View usage stats]
    G -->|No| J[Continue monitoring]
    H --> K[Confirm revocation]
    K --> L[Key revoked]

Detailed Steps

  1. Start: Admin on /admin dashboard
  2. Action: Click "API Keys (All Tenants)" in admin navigation
  3. API Keys Page: /admin/api-keys loads
  4. View All Keys: See API keys from all tenants:
    • Key name
    • Tenant name
    • Scopes
    • Created date
    • Last used date
    • Status (active/revoked)
  5. Filter: Filter by tenant using dropdown
  6. Key Details: Click key to view:
    • Full key information
    • Usage statistics
    • Recent activity
  7. Actions:
    • Revoke: Click "Revoke" to disable key
    • View Usage: See usage patterns and statistics
  8. Monitor: Continue monitoring key activity

Buttons/Actions

  • "API Keys (All Tenants)" link (admin navigation)
  • Filter dropdown (tenant selection)
  • "Revoke" button (key card)
  • "View Details" link (key card)

Exit Point

/admin/api-keys (keys managed)


Journey 5: Admin Viewing All Packages

Persona: System administrator Task: Browse and manage packages across all tenants Entry Point: /admin/packages

Path

graph TD
    A[Admin Dashboard /admin] --> B[Click 'Packages All Tenants']
    B --> C[Packages Page /admin/packages]
    C --> D[View all packages]
    D --> E[Filter by tenant]
    E --> F[Search packages]
    F --> G[Click package]
    G --> H[Package Details /admin/packages/[id]]
    H --> I[View package info]
    I --> J[View distribution]
    J --> K[View versions]
    K --> L[Manage package]

Detailed Steps

  1. Start: Admin on /admin dashboard
  2. Action: Click "Packages (All Tenants)" in admin navigation
  3. Packages Page: /admin/packages loads
  4. View All Packages: See packages from all tenants:
    • Package title
    • Tenant name
    • SCORM version
    • File size
    • Created date
  5. Filter: Filter by tenant using dropdown
  6. Search: Search packages by title or ID
  7. Package Details: Click package to view:
    • Full package information
    • Distribution settings
    • Version history
  8. Manage:
    • View distribution settings
    • View version history
    • Manage package metadata

Buttons/Actions

  • "Packages (All Tenants)" link (admin navigation)
  • Filter dropdown (tenant selection)
  • Search input (package search)
  • Package card (click to view details)
  • "View Distribution" link (package details)
  • "View Versions" link (package details)

Exit Point

/admin/packages/[id] (package details) or /admin/packages (package list)


Journey 6: Admin Generating Custom Reports

Persona: System administrator Task: Create custom reports across all tenants Entry Point: /admin/reports/custom

Path

graph TD
    A[Admin Dashboard /admin] --> B[Click 'Custom Reports All Tenants']
    B --> C[Custom Reports /admin/reports/custom]
    C --> D[Select data source]
    D --> E[Apply filters]
    E --> F[Select tenant filter]
    F --> G[Choose visualization]
    G --> H[Click 'Generate Report']
    H --> I[View results]
    I --> J[Export if needed]

Detailed Steps

  1. Start: Admin on /admin dashboard
  2. Action: Click "Custom Reports (All Tenants)" in admin navigation
  3. Custom Reports Page: /admin/reports/custom loads
  4. Select Data Source: Choose from:
    • All sessions (all tenants)
    • All packages (all tenants)
    • All xAPI statements (all tenants)
  5. Apply Filters:
    • Date range
    • Tenant (optional, can select multiple)
    • Package (optional)
    • Completion status
    • Other relevant filters
  6. Choose Visualization: Select report type:
    • Table view
    • Chart view
    • Summary statistics
  7. Generate: Click "Generate Report" button
  8. View Results: Review generated report
  9. Export: Export report if needed (CSV, PDF, etc.)

Buttons/Actions

  • "Custom Reports (All Tenants)" link (admin navigation)
  • Data source selector (dropdown)
  • Filter controls (date pickers, dropdowns, multi-selects)
  • Visualization selector (radio buttons or dropdown)
  • "Generate Report" button
  • "Export" button (if available)

Exit Point

/admin/reports/custom (report generated and viewed)


Journey 7: Admin Reviewing Audit Logs

Persona: System administrator Task: Review system activity and audit trail Entry Point: /admin/audit-logs

Path

graph TD
    A[Admin Dashboard /admin] --> B[Click 'Audit Logs']
    B --> C[Audit Logs Page /admin/audit-logs]
    C --> D[View log entries]
    D --> E[Filter by event type]
    E --> F[Filter by tenant]
    F --> G[Filter by date]
    G --> H[Search logs]
    H --> I[View log details]
    I --> J[Export logs if needed]

Detailed Steps

  1. Start: Admin on /admin dashboard
  2. Action: Click "Audit Logs" in admin navigation
  3. Audit Logs Page: /admin/audit-logs loads
  4. View Logs: See chronological list of system events:
    • Timestamp
    • Event type
    • Tenant (if applicable)
    • User (if applicable)
    • Action details
    • Result (success/failure)
  5. Filter: Apply filters:
    • Event type (package upload, session creation, API key creation, etc.)
    • Tenant
    • Date range
    • User
  6. Search: Search logs by keyword
  7. Log Details: Click log entry to view full details:
    • Complete event data
    • Request/response information
    • Error details (if applicable)
  8. Export: Export logs for compliance or analysis

Buttons/Actions

  • "Audit Logs" link (admin navigation)
  • Filter dropdowns (event type, tenant, user)
  • Date range picker
  • Search input
  • Log entry (click to view details)
  • "Export" button (if available)

Exit Point

/admin/audit-logs (logs reviewed)


Journey 8: Admin Managing Webhooks (All Tenants)

Persona: System administrator Task: Monitor webhook deliveries across all tenants Entry Point: /admin/webhooks

Path

graph TD
    A[Admin Dashboard /admin] --> B[Click 'Webhooks All Tenants']
    B --> C[Webhooks Page /admin/webhooks]
    C --> D[View all webhooks]
    D --> E[Filter by tenant]
    E --> F[View delivery status]
    F --> G[View delivery logs]
    G --> H[Identify failed deliveries]
    H --> I[Investigate failures]

Detailed Steps

  1. Start: Admin on /admin dashboard
  2. Action: Click "Webhooks (All Tenants)" in admin navigation
  3. Webhooks Page: /admin/webhooks loads
  4. View All Webhooks: See webhooks from all tenants:
    • Webhook URL
    • Tenant name
    • Event type
    • Status (active/inactive)
    • Last delivery status
    • Delivery count
  5. Filter: Filter by tenant using dropdown
  6. Delivery Status: View delivery statistics:
    • Success rate
    • Failed deliveries
    • Pending deliveries
  7. Delivery Logs: Click webhook to view delivery history:
    • Delivery attempts
    • Status codes
    • Error messages
    • Retry attempts
  8. Investigate: Identify and investigate failed deliveries

Buttons/Actions

  • "Webhooks (All Tenants)" link (admin navigation)
  • Filter dropdown (tenant selection)
  • Webhook card (click to view details)
  • "View Deliveries" link (webhook details)

Exit Point

/admin/webhooks (webhooks monitored)


Common Admin Navigation Patterns

Pattern 1: Daily Health Check

  1. Admin Dashboard → System Health → SaaS Metrics → Tenant Activity
  2. Time: 5-10 minutes
  3. Path: /admin → Review all sections

Pattern 2: Tenant Investigation

  1. Admin Dashboard → Tenant Activity → Tenants → Filter by Risk → Review
  2. Time: 10-15 minutes
  3. Path: /admin/admin/tenants → Filter → Review

Pattern 3: Package Oversight

  1. Admin Dashboard → Packages → Filter by Tenant → View Details
  2. Time: 5-10 minutes
  3. Path: /admin/admin/packages → Filter → Details

Pattern 4: Reporting Workflow

  1. Admin Dashboard → Custom Reports → Build Report → Generate → Export
  2. Time: 10-20 minutes
  3. Path: /admin/admin/reports/custom → Build → Generate

Navigation Elements Available

Admin Navigation (System Admin Only)

  • Admin Dropdown:
    • Admin Dashboard → /admin
    • Reports (All Tenants) → /admin/reports/learner-progress
    • Custom Reports (All Tenants) → /admin/reports/custom
    • Packages (All Tenants) → /admin/packages
    • Webhooks (All Tenants) → /admin/webhooks
    • Tenants → /admin/tenants
    • API Keys (All Tenants) → /admin/api-keys
    • System → /admin/system
    • Audit Logs → /admin/audit-logs

Technical Notes

  • Admin access requires system admin privileges (checked via requireClerkAdmin())
  • All admin pages show data from all tenants (no tenant isolation)
  • System health metrics auto-refresh every 30 seconds
  • Audit logs provide complete system activity trail
  • SaaS metrics calculated from subscription and usage data