Skip to main content

Workspaces

What is a Workspace?

A Workspace is a personal space for an actor, separate from any center. It serves as the actor’s home base for managing their cross-center activities.

Workspace vs Center

AspectWorkspaceCenter
OwnerIndividual actorOrganization
Data scopePersonalShared among members
DetectionisPersonalWorkspaceDomain()Domain/subdomain lookup
MembersOwner onlyMultiple actors

Actor-Workspace Data Isolation

Instructors

Instructors have complete isolation between workspace and center data:
  • Workspace: personal schedule, notes, portfolio
  • Center: assigned students, center schedule, reports
  • Must explicitly “enter” a center via center.id

Parents

Parents can view data across all centers where their children are enrolled:
  • Workspace: aggregated view of all children’s activities
  • Uses basePrisma for cross-center queries
  • Scoped by authorized center IDs from membership

Workspace Detection

import { isPersonalWorkspaceDomain } from '@/lib/auth';

if (isPersonalWorkspaceDomain(domain)) {
  // Workspace context — show personal dashboard
} else {
  // Center context — show center dashboard
}
Workspace detection is the SSOT for determining if an actor is in personal or center context. Never check center.type for this purpose.