ROAR DocumentationROAR Documentation
  • Databases
  • Workflows
  • Application
  • GitHub Actions
  • Dashboard Components
  • Firebase App Check
  • Cloud Functions
  • Backend Architecture
  • Internationalization
  • Integrating New Apps
  • Optimizing Assets
  • ROAR Redivis Instance
  • Logging and Querying
  • Emulation
  • Data Guidelines
  • Data Organization
  • Data Requests
GitHub
  • Databases
  • Workflows
  • Application
  • GitHub Actions
  • Dashboard Components
  • Firebase App Check
  • Cloud Functions
  • Backend Architecture
  • Internationalization
  • Integrating New Apps
  • Optimizing Assets
  • ROAR Redivis Instance
  • Logging and Querying
  • Emulation
  • Data Guidelines
  • Data Organization
  • Data Requests
GitHub
  • Databases
    • Database Information
    • gse-roar-admin
    • gse-roar-assessment
  • BigQuery
    • Querying Assessment Data
    • BigQuery schema: classes
    • BigQuery schema: districts
    • BigQuery schema: families
    • BigQuery schema: groups
    • BigQuery schema: schools
    • BigQuery schema: user_runs
    • BigQuery schema: user_trials
    • BigQuery schema: users
  • Workflows
    • Workflows
    • Creating an Assignment
    • Authentication
    • Creating new Users
    • User Roster Changes
    • How to Impersonate a Clever User on Localhost
  • Application

    • Auth
  • GitHub Actions
    • ROAR Apps GitHub Actions
      • GitHub Actions in ROAR Apps
      • firebase-deploy-preview.yml
      • firebase-hosting-merge.yml
      • publish-to-npm-create-new-release.yml
      • submit-dashboard-pr.yml
    • ROAR Dashboard GitHub Actions
      • GitHub Actions in the ROAR Dashboard
  • Dashboard Components
    • Dashboard Components
    • Organization Score Reports
  • Firebase App Check
    • Firebase App Check Configuration for roar-firekit and roar-dashboard
  • Backend Architecture
    • Architecture
      • Backend Architecture in ROAR
      • Data Models
      • Database Implementations
      • Error Handling Architecture in ROAR
      • Repository Layer Architecture
      • Service Layer Architecture
    • API
      • Classes
        • Class: AdministrationServiceError
        • Class: FirebaseClientError
        • Class: FirebaseImplementationError
        • Class: FirestoreAdministrationRepository
        • Class: FirestoreAdministrationRepositoryError
        • Class: abstract FirestoreBaseRepository<T>
        • Class: FirestoreFilterAdapter
        • Class: FirestoreIdentityProviderRepository
        • Class: FirestoreIdentityProviderRepositoryError
        • Class: FirestoreOrgRepository
        • Class: FirestoreOrgRepositoryError
        • Class: FirestoreRepositoryError
        • Class: FirestoreUserClaimRepository
        • Class: FirestoreUserClaimRepositoryError
        • Class: FirestoreUserRepository
        • Class: FirestoreUserRepositoryError
        • Class: IdentityProviderServiceError
        • Classes
      • Enumerations
        • Enumeration: CollectionType
        • Enumeration: IdentityProviderType
        • Enumeration: Operator
        • Enumerations
      • Functions
        • Functions
        • Function: chunkOrgs()
        • Function: createAdministrationService()
        • Function: createFirestoreImplementation()
        • Function: createIdentityProviderService()
        • Function: isEmptyOrgs()
      • Interfaces
        • Interface: Administration
        • Interface: AdministrationBaseRepository
        • Interface: AdministrationService
        • Interface: AssentConsent
        • Interface: Assessment
        • Interface: BaseModel
        • Interface: BaseRepository<T>
        • Interface: Claims
        • Interface: CompositeCondition
        • Interface: CompositeFilter
        • Interface: CreateAdministrationServiceParams<AdminRepo, OrgRepo, UserClaimRepo>
        • Interface: CreateParams
        • Interface: DeleteParams
        • Interface: EducationalOrgsList
        • Interface: FieldCondition
        • Interface: FilterAdapter<T>
        • Interface: FirestoreCreateParams
        • Interface: FirestoreDeleteParams
        • Interface: FirestoreFetchDocumentParams
        • Interface: FirestoreGetAllParams
        • Interface: FirestoreGetByIdParams
        • Interface: FirestoreGetByNameParams
        • Interface: FirestoreGetByRoarUidParams
        • Interface: FirestoreGetParams
        • Interface: FirestoreGetWithFiltersParams
        • Interface: FirestoreImplementation
        • Interface: FirestoreRunTransactionParams<T>
        • Interface: FirestoreUpdateParams
        • Interface: FutureParams
        • Interface: GetAdministrationIdsForAdministratorParams
        • Interface: GetAdministrationIdsFromOrgsParams
        • Interface: GetAllParams
        • Interface: GetByNameParams
        • Interface: GetByProviderIdParams
        • Interface: GetByRoarUidParams
        • Interface: GetParams
        • Interface: GetRoarUidParams
        • Interface: IdentityProvider
        • Interface: IdentityProviderBaseRepository
        • Interface: IdentityProviderService
        • Interface: Legal
        • Interface: OrgBase
        • Interface: OrgBaseRepository
        • Interface: OrgsList
        • Interfaces
        • Interface: Result<T>
        • Interface: RunTransactionParams<T>
        • Interface: SingleFilter
        • Interface: UpdateParams
        • Interface: User
        • Interface: UserBaseRepository
        • Interface: UserClaim
        • Interface: UserClaimBaseRepository
        • Interface: createIdentityProviderServiceParams<IDPRepo, UserClaimRepo, UserRepo>
        • Interface: getAdministrationIdsFromOrgsParams
        • Interface: _setAdministrationIdsParams
      • Type Aliases
        • Type Alias: BaseFilter
        • Type Alias: ComparisonOperator
        • Type Alias: Condition
        • Type Alias: DocumentCreatedEvent
        • Type Alias: DocumentDeletedEvent
        • Type Alias: DocumentUpdatedEvent
        • Type Alias: DocumentWrittenEvent
        • Type Alias: ParameterValue
        • Type Aliases
        • Type Alias: SelectAllCondition
      • Variables
        • Variable: FirebaseAppClient
        • Variable: FirebaseAuthClient
        • Variable: FirestoreClient
        • Variable: ORG_NAMES
        • Variables API Documentation
    • Examples
      • Examples
    • Guides
      • Guides
  • Cloud Functions
    • gse-roar-admin
      • Admin Database
      • appendToAdminClaims()
      • associateassessmentuid()
      • createAdministratorAccount()
      • createGuestDocsForGoogleUsers()
      • createLevanteGroup()
      • createLevanteUsers()
      • createnewfamily()
      • createstudentaccount()
      • mirrorClasses()
      • mirrorCustomClaims
      • mirrorDistricts()
      • mirrorFamilies()
      • mirrorGroups()
      • mirrorSchools()
      • removefromadminclaims()
      • saveSurveyResponses()
      • setuidcustomclaims()
      • softDeleteUserAssignment()
      • softDeleteUserExternalData
      • softDeleteUser()
      • syncAssignmentCreated()
      • syncAssignmentDeleted()
      • syncAssignmentUpdated()
      • syncAssignmentsOnAdministrationUpdate()
      • syncAssignmentsOnUserUpdate()
      • syncCleverOrgs()
      • syncCleverUser()
    • gse-roar-assessment
      • Assessment Database
      • organizeBucketLogsByDate()
      • setuidclaims()
      • softDeleteGuestTrial()
      • softDeleteGuest()
      • softDeleteUserRun()
      • softDeleteUserTrial()
      • syncOnRunDocUpdate()
  • Internationalization
    • ROAM Fluency
    • ROAR Letter
    • ROAR Phoneme
    • Internationalization of ROAR Apps
    • ROAR Sentence
    • ROAR Word
  • Integrating New Apps
    • Integrating Roar Apps into the Dashboard
    • Dashboard Integration
    • Monitoring and Testing
    • Preparing the App for Packaging and Deployment
    • Packaging and Publishing to npm
    • Secrets in the GitHub Repository
  • Assets Optimization
    • Optimizing Assets
    • Audio Optimization Guide
    • Image Optimization Guide
  • ROAR Redivis Instance
    • ROAR Redivis Instance
    • ROAR Data Validator Trigger
    • ROAR Data Validator
  • Logging and Querying
    • ROAR Logging
  • Emulation
    • Running the Emulator
      • Commands
    • Emulator Configuration Guide
      • Configuration
      • Cypress Configuration
      • Setup and Dependencies
      • Firebase CLI Configuration
      • Firebase Emulator Configuration
      • GitHub Secrets and Workflows
      • Importing and Exporting Data
      • Local Environment Variables
  • Clowder Implementation
    • Clowder Integration
    • Letter - Clowder
    • Multichoice - Clowder
    • Phoneme - Clowder
    • ARF & CALF - Clowder

gse-roar-admin

Admin Database

The admin database is a NoSQL database hosted by Google's Cloud Firestore. This database keeps information regarding administrations, organizations, and identifiable information for all users. The database is organized into collections of documents. Each document is able to have a subcollection, which itself is a collection of documents. Below is a schema for the structure of the database, as well as expected fields in each document. A '?' appended to the field name denotes an optional field.

The admin database (gse-roar-admin) is crucial for managing information about administrations, organizations, users, and legal compliance across various educational entities involved in the project.

Information stored

  • Administration metadata
  • Organization metadata
    • Districts
    • Schools
    • Classes
    • Groups
    • Families
  • Legal document versions
  • User metadata
    • User demographic information
    • User run information
    • User claims information

Database Schema Documentation

/administrations/

  • Purpose: Stores metadata about each administration including the sequence of tasks, involved organizations, and visibility control.
  • Fields:
    • name: Name of the administration.
    • createdBy: User ID of the person who created the administration.
    • sequential: Indicates if tasks are to be played in a specific order.
    • assessments: Array of tasks and their parameters.
    • districts, schools, classes, groups, families: Lists of IDs representing organizational involvement.
    • readOrgs: Defines which organizations have read access to the administration data.
    • dateCreated, dateOpened, dateClosed: Timestamps marking the administration lifecycle.

/districts/

  • Purpose: Manages information about districts, including associated schools and optional details such as contact and sync information.
  • Fields:
    • name, abbreviation, id: Basic identity and optional abbreviation.
    • schools: List of associated school IDs.
    • clever, districtContact, lastSync, launchDate, loginMethods, portalUrl, sisType: Optional fields primarily for districts integrating with external systems like Clever.

/schools/

  • Purpose: Contains data about schools, including their districts and optional location details.
  • Fields:
    • name, abbreviation, districtId: Essential identifiers.
    • classes: List of associated class IDs.
    • location, lowGrade, highGrade, mdrNumber, ncesId, phone, principal, schoolNumber, stateId: Optional detailed information.

/classes/

  • Purpose: Details about classes, including school affiliation and optional educational details.
  • Fields:
    • name, districtId, grade, schoolId, schoolLevel: Core class identifiers.
    • created, lastModified, subject, tags, clever, sectionId: Optional attributes for further classification and integration.

/groups/

  • Purpose: Manages group data, potentially representing subgroups within other organizational units.
  • Fields:
    • name, abbreviation: Basic identifiers.
    • parentOrgType, parentOrgId, familyId: Optional fields for hierarchical organization.

/families/

  • Purpose: Stores data on family units, useful for organizing user data and permissions.
  • Fields:
    • name: Identifier for the family.
    • createdAt, lastUpdated: Optional timestamps.

/legal/

  • Purpose: Tracks versions of legal documents using GitHub as a reference point.
  • Fields:
    • currentCommit, fileName, gitHubOrg, gitHubRepository: Identifiers linking to specific GitHub documents.
    • validFrom: Date from which a version is considered valid.

/users/

  • Purpose: Stores comprehensive user data including demographics, assignments, and organizational affiliations.
  • Fields: Extensive including demographics, legal compliance, assignment tracking, and organizational history.

/userClaims/

  • Purpose: Manages custom claims for users, facilitating access control based on administrative roles or organizational affiliations.
  • Fields:
    • claims: Stores administrative and assessment-related UIDs and organizational claims.
    • lastUpdated: Timestamp of the last update.

/deleted-users/

  • Purpose: Archives data of users who have been removed from the active users collection.
  • Fields: Mirrors /users/ with adjustments for assignment tracking.

Database Schema

/administrations/{administrationId}

{
  "name": "string",
  "createdBy": "string",
  "sequential": true,
  "assessments": [
    {
      "taskId": "string",
      "params": {
        "key": "value"
      }
    }
  ],
  "districts": ["string"],
  "schools": ["string"],
  "classes": ["string"],
  "groups": ["string"],
  "families": ["string"],
  "readOrgs": {
    "districts": ["string"],
    "schools": ["string"],
    "classes": ["string"],
    "groups": ["string"],
    "families": ["string"]
  },
  "dateCreated": "ISO8601-date-string",
  "dateOpened": "ISO8601-date-string",
  "dateClosed": "ISO8601-date-string"
}

/administrations/{administrationId}/stats/completion

{
  "total": {
    "assignment": {
      "assigned": 0,
      "started": 0,
      "completed": 0
    },
    "taskId": {
      "assigned": 0,
      "started": 0,
      "completed": 0
    }
  },
  "organizationId": {
    "assignment": {
      "assigned": 0,
      "started": 0,
      "completed": 0
    },
    "taskId": {
      "assigned": 0,
      "started": 0,
      "completed": 0
    }
  }
}

/districts/{districtId}

{
  "name": "string",
  "schools": ["string"],
  "abbreviation": "string",
  "id": "string",
  "clever": true,
  "districtContact": {
    "district": "string",
    "email": "string",
    "id": "string",
    "name": {
      "first": "string",
      "last": "string"
    },
    "title": "string"
  },
  "lastSync": "ISO8601-date-string",
  "launchDate": "ISO8601-date-string",
  "loginMethods": ["string"],
  "portalUrl": "string",
  "sisType": "string"
}

/schools/{schoolId}

{
  "name": "string",
  "abbreviation": "string",
  "districtId": "string",
  "classes": ["string"],
  "location": {
    "address": "string",
    "city": "string",
    "state": "string",
    "zip": "string"
  },
  "lowGrade": "string",
  "highGrade": "string",
  "mdrNumber": "string",
  "ncesId": "string",
  "phone": "string",
  "principal": {
    "email": "string",
    "name": "string"
  },
  "schoolNumber": "string",
  "stateId": "string"
}

/classes/{classId}

{
  "name": "string",
  "districtId": "string",
  "grade": "string",
  "schoolId": "string",
  "schoolLevel": "string",
  "created": "ISO8601-date-string",
  "lastModified": "ISO8601-date-string",
  "subject": "string",
  "tags": ["string"],
  "clever": true,
  "sectionId": "string"
}

/groups/{groupId}

{
  "name": "string",
  "abbreviation": "string",
  "parentOrgType": "string",
  "parentOrgId": "string",
  "familyId": "string"
}

/families/{familyId}

{
  "name": "string",
  "createdAt": "ISO8601-date-string",
  "lastUpdated": "ISO8601-date-string"
}

/legal/[{assent, consent, tos}]

The legal collection keeps track of which versions of the legal documents are current. For each form (assent, consent, terms of service), we store information to access the github document of the corresponding version.

{
  "currentCommit": "string",
  "fileName": "string",
  "gitHubOrg": "string",
  "gitHubRepository": "string",
}

/legal/[{assent, consent, tos}]/versions/{versionId}

{
  "validFrom": "ISO8601-date-string"
}

/users/{userId}

{
  "assessmentPid": "string",
  "assessmentUid": "string",
  "assignments": {
    "assigned": ["string"],
    "completed": ["string"],
    "started": ["string"]
  },
  "districts": {
    "all": ["string"],
    "current": ["string"],
    "dates": {
      "districtId": {
        "to": "ISO8601-date-string",
        "from": "ISO8601-date-string"
      }
    }
  },
  "schools": {
    "all": ["string"],
    "current": ["string"],
    "dates": {
      "schoolId": {
        "to": "ISO8601-date-string",
        "from": "ISO8601-date-string"
      }
    }
  },
  "name": {
    "first": "string",
    "middle": "string",
    "last": "string"
  },
  "studentData": {
    "dob": "ISO8601-date-string",
    "gender": "string",
    "grade": "string",
    "hispanic_ethnicity": "string",
    "race": ["string"],
    "schoolLevel": "string",
    "state_id": "string"
  },
  "userType": "string"
}

/users/{userId}/assignments/{assignmentId}

{
  "assessments": [
    {
      "taskId": "taskId_example",
      "allRunIds": ["runId1", "runId2"],
      "completedOn": "2024-04-15T00:00:00Z",
      "runId": "runId_example",
      "startedOn": "2024-04-15T00:00:00Z"
    }
  ],
  "assigningOrgs": {
    "districts": ["districtId1", "districtId2"],
    "schools": ["schoolId1", "schoolId2"],
    "classes": ["classId1", "classId2"],
    "groups": ["groupId1", "groupId2"],
    "families": ["familyId1", "familyId2"]
  },
  "completed": true,
  "dateAssigned": "2024-04-15T00:00:00Z",
  "dateOpened": "2024-04-15T00:00:00Z",
  "dateClosed": "2024-04-15T00:00:00Z",
  "id": "assignmentId_example",
  "readOrgs": {
    "districts": ["districtId1", "districtId2"],
    "schools": ["schoolId1", "schoolId2"],
    "classes": ["classId1", "classId2"],
    "groups": ["groupId1", "groupId2"],
    "families": ["familyId1", "familyId2"]
  },
  "started": true,
  "userData": {
    "assessmentPid": "assessmentPid_example",
    "assessmentUid": "assessmentUid_example",
    "dob": "2008-09-15T00:00:00Z",
    "email": "user@example.com",
    "gender": "female",
    "grade": "5",
    "hispanic_ethnicity": "no",
    "name": {
      "first": "Jane",
      "middle": "Q",
      "last": "Doe"
    },
    "race": ["White", "Hispanic"],
    "schoolLevel": "elementary",
    "state_id": "stateId_example",
    "username": "janeqdoe"
  }
}

/users/{userId}/externalData/clever

{
  "created": "2024-04-15T00:00:00Z",
  "district": "districtId_example",
  "email": "user@example.com",
  "id": "cleverUserId",
  "last_modified": "2024-04-15T00:00:00Z",
  "name": {
    "first": "John",
    "middle": "B",
    "last": "Doe"
  },
  "roles": {
    "student": {
      "dob": "2012-05-01",
      "gender": "male",
      "grade": "5",
      "hispanic_ethnicity": "yes",
      "state_id": "stateId123"
    }
  }
}

/userClaims/{userId}

{
  "claims": {
    "adminOrgs": {
      "adminUid": "adminUid_example",
      "assessmentUid": "assessmentUid_example"
    },
    "minimalAdminOrgs": {
      "roarUid": "roarUid_example"
    }
  },
  "lastUpdated": "2024-04-15T00:00:00Z"
}

/deleted-users/

The deleted users collection is a collection of users documents that have been deleted. The schema of this collection matches that of /users/ collection, with the sole exception that the /users/{userId}/assignments subcollection is changed to /deleted-users/{userId}/deleted-assignments.

Edit this page
Last Updated:
Contributors: Elijah Kelly, Kyle
Prev
Database Information
Next
gse-roar-assessment