Leave Localhost logoLeave LocalhostDocs
Multi-tenancy

Removing the Workspace Demo

Remove the optional Workspace Records CRUD demo while retaining the organization's multi-tenancy infrastructure.

The Workspace Records feature is optional demo code. This checklist removes it without removing organizations, workspace switching, memberships, invitations, workspace settings, billing, or /admin/workspaces. The admin route manages real organizations and must remain.

1. Replace the Home Page

Replace apps/app/src/app/[locale]/(dashboard)/page.tsx with a static empty state before deleting the demo component. This keeps the Home route useful and avoids a blank dashboard:

export const metadata = {
  title: "Home",
};

export default function Page() {
  return (
    <div className="flex flex-1 flex-col gap-4 p-4 sm:p-6">
      <div className="mx-auto w-full max-w-5xl">
        <p className="text-sm text-muted-foreground">
          Your dashboard is ready for product content.
        </p>
      </div>
    </div>
  );
}

Delete these demo-owned frontend files:

  1. apps/app/src/app/[locale]/(dashboard)/_components/workspace-demo.tsx
  2. apps/app/src/app/[locale]/(dashboard)/_components/workspace-record-dialog.tsx
  3. apps/app/src/lib/workspace-record-form.ts

Delete the dashboard.records and dashboard.dialog blocks from all three locale files:

  1. apps/app/src/locales/en.ts
  2. apps/app/src/locales/es.ts
  3. apps/app/src/locales/fr.ts

2. Remove the Backend Demo Blocks

  1. Delete packages/backend/convex/workspaceRecords.ts and packages/backend/convex/workspaceRecords.test.ts.

  2. In packages/backend/convex/schema.ts, delete the complete block between:

    // === DEMO CODE START: Workspace records ===
    // === DEMO CODE END: Workspace records ===
  3. In packages/backend/convex/permissions/policy.ts, delete both clearly marked Workspace records blocks: the workspaceRecord Better Auth statement and the workspace.records.* permission catalog entries.

  4. Confirm packages/backend/convex/users.ts has no dashboard-layout record field, permission decision, or records query. The current starter keeps the demo query at the Home-page boundary only; removing the Home-page integration in step 1 removes that boundary.

Run the normal Convex codegen workflow after deleting the public function. Do not edit packages/backend/convex/_generated/** manually.

3. Remove Demo Documentation

Delete or rewrite every demo reference. The current manifest includes:

  • docs/multi-tenancy/workspace-demo.md and its workspace-demo entry in docs/multi-tenancy/meta.json
  • docs/multi-tenancy/overview.md
  • docs/multi-tenancy/roles-and-permissions.md
  • docs/reference/permissions.md
  • docs/delete-before-launch.md
  • docs/architecture/convex-backend.md
  • docs/architecture/data-model.md
  • docs/architecture/server-actions-and-functions.md
  • docs/architecture/overview.md
  • docs/ui/customizing-the-dashboard.md

Keep documentation and code for organization creation, switching, settings, memberships, invitations, billing, and /admin/workspaces.

4. Verify the Removal

Run the normal repository checks:

bun run lint
bun run typecheck
bun run test
bun run build

Finish with the removal manifest search:

rg -n 'workspace_records|workspaceRecord|WorkspaceRecord|workspace\.records'

A remaining match is a removal bug unless it is an intentional migration note.

On this page