Skip to content

Operator Panel

The operator panel is accessible only to Convertella staff, protected by Cloudflare Access (Zero Trust). Operators create organizations, provision projects, manage domains, invite users, and view the audit log.

All operator routes are behind Cloudflare Access:

  • Operators authenticate via Cloudflare Access (MFA-enforced)
  • JWT verification in src/lib/auth/cf-access.ts
  • Email allowlist via OPERATOR_ALLOWED_EMAILS env var
  • No Lucia session — stateless per-request auth
RoutePagePurpose
/operator/Operator dashboardOverview of organizations and projects
/operator/organizations/newCreate organizationRegister a new real estate developer
/operator/projects/newCreate projectProvision a new project with portal defaults
/operator/users/inviteInvite CRM userCreate users row + project access (see below)
/operator/domainsDomain managementManage portal domain registrations
/operator/auditAudit logView immutable audit trail

Inviting CRM users (/operator/users/invite)

Section titled “Inviting CRM users (/operator/users/invite)”

Uses provisionCrmUser() from src/lib/auth/provision-crm-user.ts:

  • Role is required: developer or agent
  • At least one project must be selected
  • Project list shows all projects platform-wide; each row shows the project name with organization as secondary text (not filtered to a single org)
  • Developers: must pick an organisation; selected projects must belong to that org (memberships + assignments)
  • Agents: no organisation field — assignments via agent_project_assignments only, including cross-org (same agent email can work on projects from different developers)

Invited users sign in at / (the CRM login page) with OTP (no password).

EndpointPurpose
GET /api/operator/projectsList all projects (operator-scoped)
POST /api/operator/projectsCreate project with portal

The operator panel manages platform infrastructure through these integrations:

  • Custom Hostnames — src/lib/cloudflare/custom-hostnames.ts wraps the Cloudflare for SaaS API for registering, polling, and removing client domains
  • Cloudflare Access — Creates/reuses Access apps and policies per client
  • Cloudflare Tunnel — Configures tunnel ingress routes for Directus admin (legacy, during migration)

All Cloudflare-specific functionality is wrapped in isolated modules:

ModulePurposeExit Strategy
src/lib/cloudflare/custom-hostnames.tsCustom hostname CRUDReplace with Caddy/CloudFront/Vercel API
src/lib/auth/cf-access.tsJWT verificationReplace with Auth0/Clerk/WorkOS module
src/lib/r2/Presigned URLsReplace endpoint, keep S3 SDK interface