Organizations Scope

1. Break Down the Feature Lifecycle

1.1 Define the Feature Goals

  • Purpose: Establish a persistent data structure to store organizational access, integration, and library configuration for customers on the platform.

  • Desired Outcomes:

    • Save the organization's domain where modules will be embedded

    • Allow platform to send webhook reports to the org’s systems (e.g., LRS or analytics)

    • Assign and manage access to modules in the platform’s global module library

  • Core User Interactions:

    • Platform Admin:

      • View or manage org-level metadata (domain, webhook, etc.)

    • Organization Admin:

      • Create an organization account by signing up

      • Provide integration settings: domain and webhook

      • Use default starter library

      • Create custom library/sections for internal use


1.2 Establish Key Milestones

  • Data Creation:

    • Organization created via signup or admin form

    • Default starter modules assigned

    • Admin configures domain/webhook

  • Data Storage:

    • Store in Firestore (or other persistent DB) under /organizations/{orgId}

  • Data Retrieval:

    • Fetch org details on auth

  • Data Updates:

    • Org Admin updates domain/webhook

  • Automation (future):

    • Auto-assign modules based on signup context

    • Webhook retries, LRS reporting


1.3 Prioritize MVP

MVP Goals:

Knowledge Gaps:

  • What does the webhook need to send? (ask integration partner or dev working on LRS)

  • How will org signup be handled in production (manual vs. self-serve)?


2. Identify Relevant Entities

2.1 List Entities

  • Organization

  • Module

  • API Key

  • Library

  • Webhook Integration

2.2 Define Relationships

Entity
Relationships

Organization

Has a domain Has one webhook URL

Module

Linked in platform library and referenced by library/sections

API Key

Linked to org_id/apiKeys

Library

Modules the org has access to

Webhook

Receives events (e.g., xAPI statements) for LRS integration


3. Plan API Routes

3.1 CRUD Operations

Organizations

Method
Route
Purpose

POST

/organizations

Create a new organization (signup or admin)

GET

/organizations/:id

Get organization details

PATCH

/organizations/:id

Update org info (domain, webhook)

DELETE

/organizations/:id

Archive or delete org


3.2 Validate Input/Output

Validation Highlights:

  • Validate domain format (must be a valid hostname)

  • Ensure API key is authorized when modifying organization routes


4. Feature Breakdown with Example Usage

4.1 Define User Scenarios

Organization Admin: Create Account & Setup

  1. Signs up with email + org name

  2. Gets default starter module library

  3. Updates integration settings via PATCH /organizations/:id with:

{
  "domain": "org-example.com",
  "webhook": "https://org-example.com/xapi"
}

5. Use Flowcharts for Clarity

Example: Org Signup + Default Library Flow

[User Signup]

[Create Org Record]

[Assign Starter Modules to Library]

[Generate API Key]

[Org Ready for Integration]

Last updated