Working with Modules

Customize Sample Data

Change the rows your sample data loads, replace sample bookings, and add your own sample business.

Sample data is a ready-made business: a menu, a floor plan, staff, services, customers. An admin loads it during business setup with Explore with sample data, which works only while the app holds no data of its own. A script or your agent can reload it at any time with POST /api/seed (body { "pack": "<sample business>" }), which wipes the data of every Module first and needs admin-panel:write. Each Module ships its own sample rows, and Stardeck updates them.

Settings → Danger zone in the app's admin only empties the app, in any environment, after you type RESET. Clear data keeps your kind of business and the features you switched on or off. Start over also puts the business type back to general with every feature on. Both keep the installed languages, currency, timezone and tax, and both delete the company and its locations, so the admin opens on business setup.

To make the sample data show your business instead, customize the tables you care about. Don't edit a Module's sample rows: they belong to Stardeck, the editing tools refuse them, and the next update replaces them.

Customize a table

From apps/web, run:

npm run seed:customize -- <module> <table> [<table>…]

For example npm run seed:customize -- pos menu_item menu_item_modifier_group. It copies the Module's current rows for those tables into a file your app owns, apps/web/src/seeds/<module>.ts, then you or your coding agent edit the rows there. Sample data now loads your rows for those tables and the Module's rows for the rest, which keep coming with updates.

Customize tables that point at each other together. If you replace the menu items but not the modifier groups that reference them, a removed row fails the load.

Replace sample bookings

Rows placed relative to the day the sample data loads, such as tomorrow's 14:00 booking, are a sample list, not table rows. Booking's is @bookings. When your services replace the Module's, customize the list too and point each entry at your rows:

npm run seed:customize -- booking @bookings

An empty list means no sample bookings. Loading reports every entry it couldn't place.

Seed only what you list

By default, a Module's tables you didn't customize keep the Module's rows. Mark a customization only: true and every table and sample list of that Module you didn't name starts empty, and the Module adds none of its own demo activity (closed days, staff shifts). seed:customize warns when a table still on the Module's rows points at rows you replaced.

Add your own sample business

Business setup offers several sample businesses (a restaurant, a spa, a clothing store and so on). Your app can add its own as SEED_OPTIONS in apps/web/src/seeds/index.ts: it starts from one of the built-in ones, lays your rows and lists on top, and is selected by default. It holds rows and lists only, never code.

What sample data never fills

Some tables hold what the running app writes: orders, payments, sessions, counters. No sample data may fill them, so a sample workspace opens on a clean service, not on somebody's test tickets. Workspace settings (languages, currency, tax, location defaults) are never reset.

After an update

A Module can add a required column to a table you customized. Stardeck's reset test, apps/web/src/lib/seed/__tests__/reset-and-seed.test.ts, runs the real reset against Postgres and fails on that table; the fix goes in your customized rows. Run it after each update. See Updates.

The rules your agent follows are in your app's AGENTS.md § "Modules (reusable capabilities)".