From 082182ec9ece01f99bcd365df0036f873eee9489 Mon Sep 17 00:00:00 2001 From: ColinLi98 <111134421+ColinLi98@users.noreply.github.com> Date: Thu, 12 Mar 2026 01:57:37 +0000 Subject: [PATCH 1/5] Prepare separate demo showcase --- README.md | 15 + package.json | 1 + public/agent-detail.html | 1 + public/agents.html | 1 + public/agents.js | 6 +- public/audit.html | 1 + public/dlq.html | 1 + public/evidence.html | 1 + public/index.html | 1 + public/measurement.html | 1 + public/risk.html | 1 + src/demo-scenario.ts | 178 +++++++++++ src/demo-seed.ts | 623 +++++++++++++++++++++++++++++++++++++++ src/factory.ts | 28 +- src/index.ts | 6 +- src/server.ts | 10 +- src/store.ts | 3 +- 17 files changed, 870 insertions(+), 8 deletions(-) create mode 100644 src/demo-scenario.ts create mode 100644 src/demo-seed.ts diff --git a/README.md b/README.md index 2efc16f..54f4940 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,21 @@ pnpm start Server starts on `http://localhost:3000`. +## Demo Mode + +For a stable stakeholder demo with virtual data and isolated in-memory state: + +```bash +pnpm start:demo +``` + +Demo mode starts on `http://localhost:3001` and: + +- uses a richer synthetic product dataset +- bootstraps measurement, settlement, queue, audit, and risk activity automatically +- keeps CRM focused on demo data instead of real discovery output +- ignores PostgreSQL / Redis / billing adapter runtime state so the demo stays deterministic + By default the app uses in-memory persistence and in-memory hot state. If `DATABASE_URL` is set, startup switches to PostgreSQL automatically. If `REDIS_URL` is set, idempotency keys and opportunity cache switch to Redis. Hot-state keys are namespaced and versioned: diff --git a/package.json b/package.json index 5e5ffa4..6ff5ff1 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "tsx watch src/index.ts", "start": "tsx src/index.ts", + "start:demo": "APP_MODE=demo PORT=3001 tsx src/index.ts", "typecheck": "tsc --noEmit", "db:init": "tsx scripts/db-init.ts", "db:embedded": "tsx scripts/start-embedded-postgres.ts", diff --git a/public/agent-detail.html b/public/agent-detail.html index 0920177..d9aa955 100644 --- a/public/agent-detail.html +++ b/public/agent-detail.html @@ -97,6 +97,7 @@