demo-data-buttonrun.md01_define/output/spec.mdThere is no fast way to fill a tenant with realistic, end-to-end data so the platform can be visualised the way it actually behaves. Demoing the product to prospective vendors, screenshotting the dashboards, and developing UI against the real DB all currently require hand-creating leads one by one — and a single lead only exercises one stage of the service journey. To show the kanban board, lead detail, proposals, quotes, milestones and invoices populated across the whole funnel, you need many leads spread across every stage with their supporting records present.
This directly serves the Build the Bridge initiative (proving the service journey runs end-to-end) and the Q2 objectives around establishing product–market fit and credibility with vendor partners (Objectives 1 and 4) — a one-click populated tenant makes the platform demonstrable and visually complete for sales and internal review. It is explicitly a demo/visualisation aid, not a production data path.
Add a Populate demo data button in the admin section of apps/web (the real, DB-backed
platform). Clicking it generates a batch of leads in the admin's current tenant (the active Clerk
org), distributed across every lead stage with multiple leads per stage, and creates the
supporting records each stage implies so that every view renders realistically:
lead.status workflow): pending, backlog, quotation_process (bid
process started), awaiting_confirmation (quote review), work_in_progress, delivered,
survey_sent/completed, plus a few qualified_out. Several leads land in each.work_in_progress/delivered leads;The generation logic lives in @sustentus/services/server (a demo-data service that composes the
existing lead/proposal/quote/milestone/invoice/user/activity services), invoked by an admin server
action in apps/web. After it runs, the generated leads appear in /service-leads (kanban + table)
and each opens to a populated detail view.
apps/web; non-admins
cannot reach or invoke it (role-gated like other admin actions).pending, backlog, quotation_process, awaiting_confirmation, work_in_progress,
delivered, survey_sent/completed, qualified_out), with multiple leads in each stage./service-leads/[id]
detail view renders realistically rather than showing empty sections./service-leads kanban board (distributed
across the stage columns) and in the table view, with valid sequential requestIds and valid
workflow statuses.isDemo/production guard or tenant allow-listing — the button runs against the current
tenant unconditionally (per decision); choosing a safe tenant is the operator's responsibility.apps/dashboards app (it is self-contained on lib/mock/ and unaffected).02_build/output/notes.mdfeat: demo-data-button — admin button to populate a tenant with leads across every stagepackages/services/src/db/services/demo-data/{index.ts,instance.ts}: new
demoDataService.populateDemoLeads(tenantId, createdBy). Generates a fresh batch of
demo leads spread across every lead stage (pending, backlog, quotation_process,
awaiting_confirmation, work_in_progress, delivered, survey_sent, completed,
qualified_out) with multiple leads each, plus the supporting graph per stage:clerkUserId (the (clerkUserId, tenantId) index is not sparse);CREATE activity; reference data (service/industry/
product/skills) reused from the tenant when present;qualifyOutReason + a QUALIFIED_OUT activity.leadService.create) so it allocates the
real per-tenant requestId counter but raises no notifications/emails/external side
effects. Re-running appends (new batch tag → unique emails/clerk ids; no deletes).packages/services/src/db/services/index.ts: export demoDataService, DemoDataService,
DemoDataResult.apps/web/app/(app)/admin/demo-data/actions.ts: populateDemoData server action — admin-only
via resolveActionContext({ allowedRoles: ["admin"] }), calls the service for the current
tenant, revalidates /service-leads.apps/web/app/(app)/admin/demo-data/_components/demo-data-button.tsx: client button with a
confirm dialog, pending state, success/failure toast, and an inline summary of what was created.apps/web/app/(app)/admin/demo-data/page.tsx: the admin page hosting the button.apps/web/lib/nav.ts: "Demo data" item under the admin Configure section.apps/web/lib/route-policies.ts: /admin/demo-data restricted to admin.apps/web admin; non-admins blocked — nav item
under admin Configure, route policy admin only, action gated to allowedRoles: ["admin"].STAGE_PLAN covers all
nine lead statuses, ≥2 leads per stage (25 total)./service-leads kanban + table with valid sequential requestIds and valid
workflow statuses — statuses are the canonical workflow names; requestId via
allocateNextLeadRequestId; list filters by status only.pnpm --filter @sustentus/web typecheck passes locally; @sustentus/services builds (DTS) clean.isDemo guard, no clear/reset). Demo users get synthetic clerkUserIds
and are DB records for display only, not real Clerk logins.03_release/output/changelog.mdPersonas: admin
You can now populate a tenant with example leads spread across every stage of the journey — from new requests through bidding, delivery and completion — so the dashboards, lead board and lead details all show realistic data to explore or demo.
Live entry: apps/help/app/changelog/2026-06-18-demo-data-button/
03_release/output/investor-update.mdWho it's for: Admins, and the team running vendor demos What shipped: A one-click admin tool that fills a tenant with leads across every journey stage, plus their proposals, quotes, milestones and invoices. Why it matters: Makes the platform instantly demo-ready for vendor conversations — supporting product–market fit with vendor partners.
Every lead stage is represented with its supporting records, so all dashboards and lead views render realistically.
Dig deeper: <merged-PR URL> · <changelog entry URL>