Skip to content

Add full demo seed mode, admin API, and dashboard demo button#12

Open
Spbd1 wants to merge 1 commit into
codex/prepare-parcel-society-for-vps-deploymentfrom
codex/create-demo-mode-for-parcel-society
Open

Add full demo seed mode, admin API, and dashboard demo button#12
Spbd1 wants to merge 1 commit into
codex/prepare-parcel-society-for-vps-deploymentfrom
codex/create-demo-mode-for-parcel-society

Conversation

@Spbd1

@Spbd1 Spbd1 commented May 10, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide a turnkey local demo mode so developers can spin up a complete experiment dataset for manual testing and UI previews without manual data entry.
  • Ensure admin workflows and dashboards display meaningful charts immediately after seeding by generating synthetic decisions and resolving early rounds through the engine.

Description

  • Added a deterministic demo seeding implementation at packages/db/src/demoSeed.ts that creates an admin user, four treatment demo servers, 10x10 maps, 20 anonymous participants per server, parcel assignments, an active 7-round season, synthetic decisions for rounds 1–3 (production, investments, safe assets, public contributions, contracts, lobbying, exits), resolves rounds 1–3 via the engine, and records contracts/events/treasury/player round states.
  • Exposed a runnable script and command: packages/db/scripts/seed-demo.ts and a new workspace script pnpm seed:demo that runs the demo seed (pnpm --filter @parcel-society/db seed:demo).
  • Added a development-only admin API endpoint POST /api/admin/demo at apps/web/app/api/admin/demo/route.ts and a dashboard action button labeled Create Demo Experiment (visible only when NODE_ENV === "development") in apps/web/app/admin/page.tsx which calls the endpoint and records an audit action.
  • Updated admin auth defaults and UI for local development and docs: default demo credentials set to ADMIN_EMAIL=admin@example.com and ADMIN_PASSWORD=changeme (.env.example, apps/web/lib/api/auth.ts, and admin login form), and README documentation describing pnpm seed:demo and demo login details.

Testing

  • Ran Prettier formatting checks with pnpm exec prettier --check ... which passed for the modified files.
  • Ran git diff --check to ensure no whitespace/patch issues; the check passed.
  • pnpm install / typecheck / lint / full pnpm seed:demo were attempted but blocked in this environment due to missing node_modules (registry 403 for @types/node) and missing runtime tsx, so full runtime/typecheck verification could not complete here.
  • Notes: the demo seed is deterministic and designed to be re-runnable (it replaces existing demo servers), but please run pnpm install, pnpm --filter @parcel-society/db db:generate, pnpm --filter @parcel-society/db db:migrate, then pnpm seed:demo locally to execute and verify end-to-end behavior.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant