Factorizer/Cluster ERP WikiCluster ERP Türkçe
Home / Operations

Reference

Demo and staging data

The demo company seeder demo_data.py and the staging test-account command staging_fixtures.py, with their options, phases, and guards.

Two operator commands put non-customer data into a database: python -m cluster_erp.server.demo_data fills one database with an invented manufacturing company, and python -m cluster_erp.server.staging_fixtures creates the accounts that the browser battery signs in with on a staging node. This page lists their options, what they create, and the guards in their code. Account names and passwords are omitted under the security disclosure policy.

Scope and source

  • Defined in: src/cluster_erp/server/demo_data.py (main, run, seed) and src/cluster_erp/server/staging_fixtures.py (main, assert_staging_node, accounts_with_passwords, ensure_accounts).
  • Count: ten demo phases, counted from the _phase(...) calls in seed (src/cluster_erp/server/demo_data.py:1176-1187); four staging accounts, counted from the ACCOUNTS tuple (src/cluster_erp/server/staging_fixtures.py:54-59).

Demo company seeder

Options

Option Meaning Source
--db-name <name> Database to fill; the configured database when omitted. src/cluster_erp/server/demo_data.py:1222
--create Create the database and replay the Alembic history first. src/cluster_erp/server/demo_data.py:1223, src/cluster_erp/server/demo_data.py:1201-1203
--company <name> Display name of the demo company; the default is the constant DEFAULT_COMPANY. src/cluster_erp/server/demo_data.py:44, src/cluster_erp/server/demo_data.py:1224
--license-file <file> A vendor-signed licence document to install before seeding. src/cluster_erp/server/demo_data.py:1225-1228

Phases

The seeder boots the real application against the database and then runs each phase through the modules' own service layer, with the bootstrap administrator as the actor (src/cluster_erp/server/demo_data.py:6-14, src/cluster_erp/server/demo_data.py:1194-1217). Each phase commits on its own (src/cluster_erp/server/demo_data.py:1110-1121).

Phase Function Source
company seed_company src/cluster_erp/server/demo_data.py:84
partners seed_partners src/cluster_erp/server/demo_data.py:185
products seed_products src/cluster_erp/server/demo_data.py:313
inventory seed_inventory src/cluster_erp/server/demo_data.py:443
engineering seed_engineering src/cluster_erp/server/demo_data.py:536
sales seed_sales src/cluster_erp/server/demo_data.py:693
supply seed_supply src/cluster_erp/server/demo_data.py:849
fleet seed_fleet src/cluster_erp/server/demo_data.py:966
intranet seed_intranet src/cluster_erp/server/demo_data.py:1033
home seed_home src/cluster_erp/server/demo_data.py:1094

At the end the command prints one count per created kind of record (src/cluster_erp/server/demo_data.py:1239-1241).

Guards

Guard Behaviour Source
Synthetic data The module states that the data is invented and must never be run against a customer's database. src/cluster_erp/server/demo_data.py:4-19
Bootstrap administrator The run stops when the bootstrap administrator does not exist; the node must have booted once. src/cluster_erp/server/demo_data.py:1151-1153
Idempotency A database that already holds a live party with the demo company's name is left alone; only the administrator's home screen is set. src/cluster_erp/server/demo_data.py:75-82, src/cluster_erp/server/demo_data.py:1162-1168
Licensing A given licence is installed through the app store service; without one on a node with licensing armed, the run logs that sold apps stay unlicensed. The seeder does not bypass the licence check. src/cluster_erp/server/demo_data.py:1124-1161
Phase failure Earlier phases stay committed; the log asks to drop and recreate the demo database before the next run. src/cluster_erp/server/demo_data.py:1110-1119

Staging test accounts

Behaviour

Step Behaviour Source
Role check Refuses with exit code 2 unless the node's role record says exactly staging. src/cluster_erp/server/staging_fixtures.py:92-105, src/cluster_erp/server/staging_fixtures.py:191-195
Passwords Reads the passwords from CLUSTER_STAGING_BOT_PASSWORD and CLUSTER_STAGING_ADMIN_PASSWORD; refuses with exit code 3 when a value is missing or shorter than twelve characters. src/cluster_erp/server/staging_fixtures.py:44-52, src/cluster_erp/server/staging_fixtures.py:66-85, src/cluster_erp/server/staging_fixtures.py:196-200
Database --db-name points the command at a tenant database on a multi-tenant node. src/cluster_erp/server/staging_fixtures.py:185-189
Accounts Creates each of the four accounts (one bot administrator, one administrator, two operators) or resets its password and names. src/cluster_erp/server/staging_fixtures.py:135-158
Home screen Copies the bootstrap administrator's home screen layout to each account. src/cluster_erp/server/staging_fixtures.py:159-172

The command boots the application against the database, so the bootstrap administrator and the roles must exist (src/cluster_erp/server/staging_fixtures.py:120-138). The battery reads the same passwords through its own variables (src/cluster_erp/server/staging_fixtures.py:44-49).

Constraints and validation

  • The staging guard is tested by tests/test_staging_fixtures_guard.py (six tests, counted as def test_ lines).
  • The seeder is tested end to end by tests/test_demo_data_live.py, which also checks that a second run changes nothing (tests/test_demo_data_live.py:1-7).
  • The node role is written by install.sh at the first install and never changes (deploy/install.sh:122-128). See environments and promotion.

Terms introduced

Term Code identifier Definition Turkish term Source
demo seeder demo_data The command that fills one database with an invented company through the modules' services. demo tohumlayıcı src/cluster_erp/server/demo_data.py:1-19
staging fixtures staging_fixtures The command that creates the battery's sign-in accounts on a node recorded as staging. staging fikstürleri src/cluster_erp/server/staging_fixtures.py:1-15

Verified against commit 92f8051 on 2026-11-13.

Verified against commit 92f8051 · 2026-11-13