Backend/Sample data

Sample data

Where the sample data lives, what reads it, and how to take it out before real customers arrive, without breaking empty screens.

Where it lives

All sample content is in src/lib/data. Each file holds the types for one area and its sample records; the types stay, the records go.

FileSample records
customers.tsCUSTOMERS
records.tsCONTACTS, CONTRACTS, INVOICES, TRANSACTIONS, CUSTOMER_DOCUMENTS
comms.tsTHREADS, NOTES, TASKS
leads.tsLEADS
meetings.tsSEEDED_MEETINGS, MEETING_NOTES
emails.tsSEEDED_EMAILS, SEEDED_SUGGESTIONS
documents.tsLIBRARY_DOCUMENTS
whiteboards.tsBOARDS
workflows.tsWORKFLOWS
admin.ts, workspace.tsThe sample workspace, its members and settings

Network and Invoices have no sample files of their own: they're worked out from the records above, so they empty out with them.

The demo date

The sample data is built around a fixed day, DEMO_TODAY in src/lib/data/records.ts, so it looks the same whenever someone opens the demo: the same invoices overdue, the same renewals coming up. Many screens use it for "today". Search the project for DEMO_TODAY and switch each use to the real date once your data is real.

Leaving DEMO_TODAY in place with real data makes renewal countdowns, overdue days and monthly charts wrong, without any error.

Remove it before launch

  1. Connect one module at a time (see Database): its provider loads from your backend instead of the sample array.
  2. When nothing imports a sample array any more, delete it. npm run typecheck lists anything still using it.
  3. Search for screens that import sample data directly instead of through a provider: some dashboard cards, the command palette, composer menus and the chart functions in trends.ts and growth.ts do. Database lists them.
  4. Open every screen with an empty workspace. Each list should show its illustrated empty state, and each dashboard card a zero or an empty message, not an error.
  5. Replace the sample team in admin.ts and workspace.ts with the signed-in person and their workspace (see Sign-in).
  6. Turn off the sample connections: start mailbox as null in DEFAULT_PREFERENCES, and keep only real integrations in the installed apps in shell-provider.tsx (the sample workspace has Google Meet, Zoom and Teams set up). Emails and Meetings then show their connect screens.

Keep a copy of the sample data for your own demo or tests: a seed script that writes it to a test database is often more useful than deleting it.

What saves in the browser

Some choices are saved in the browser under keys starting with accordion:, such as preferences, workspace settings, favorites, dashboards and saved views. Records aren't: they reset on reload. When you move a setting to your database, read it from there first so people don't see their old browser copy.