Files
SluijsensandClaude Sonnet 5 0447993181 Completes local-dev-master-slave-setup: dual-instance frontend tooling, module-capability gating, and master/slave protocol self-healing fixes
Frontend (Unit 2 completion): dual dev-server tooling (pnpm dev:slave,
pnpm dev:all), per-instance browser tab titles, and a backend
capability check (SystemController + useSystemCapabilities +
ModuleGuard) so a Master-only page is hidden on a slave instance
instead of assuming every backend has every module.

Master/slave protocol fixes surfaced by actually running master and
slave side by side locally:
- Deactivating a CMS instance (Inactive) now releases the slave's
  master gate instead of leaving it stuck on its last pushed status.
- The periodic integrity check now also re-pushes status to every
  reachable slave (previously URL-verification only) and runs once
  immediately on startup.
- Added the originally-specified (but never implemented) slave-pull
  path: a slave now periodically polls its own status from the master
  (GET /api/v1/SlaveStatus) and fails open to Available if the master
  is unreachable for too long, complementing the existing push.
- The slave's own Settings page can no longer "successfully" change
  local availability while the master controls it; it's now locked
  with an explanatory banner and the backend rejects the write with
  409 instead of silently no-op'ing it.
- CMS instance status badges now match the dashboard's color/icon
  styling instead of a plain grey badge.

Also corrected the master-cms-module design docs to match this
as-built behavior, and flagged (without a full rewrite) a larger,
pre-existing divergence between its inception-stage application
design and what construction actually built.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-04 19:53:52 +02:00

2.7 KiB

Code Generation Summary — Unit 2: Frontend Dual-Instance Tooling & Runbook

Created

  • frontend/.env.slave.localVITE_API_BASE_URL=https://localhost:7222, VITE_APP_TITLE=SlpModularCms (Slave) (gitignored via existing frontend/.gitignore *.local pattern, verified via git check-ignore)
  • aidlc-docs/features/local-dev-master-slave-setup/construction/unit-2-frontend-dual-instance-tooling/code/summary.md (this file)

Modified

  • frontend/.env.example — added a documented block explaining how to create .env.slave.local and use pnpm dev:slave, and how VITE_APP_TITLE distinguishes tabs
  • frontend/.env.local (developer's existing local file, gitignored) — added VITE_APP_TITLE=SlpModularCms (Master) for symmetry with the slave
  • frontend/package.json — added "dev:slave": "vite --mode slave --port 5174" script
  • frontend/src/vite-env.d.ts — added optional VITE_APP_TITLE to the typed env interface
  • frontend/src/lib/config.ts — added appTitle to AppConfig, sourced from VITE_APP_TITLE with a 'SlpModularCms' fallback when unset
  • frontend/src/main.tsx — sets document.title from getAppConfig().appTitle at startup, so each instance's browser tab is recognizable
  • README.md (root) — added new section "Lokaal Master + Slave Draaien (Dev)" after "Master CMS Module", covering: starting both backends, starting the frontend against either instance, and using the existing "Add CMS Instance" dialog to connect them

Notes

  • No new tests — this unit is env/config/documentation only, no testable logic.
  • pnpm dev:slave uses Vite's --mode slave flag, which loads .env.slave.local in addition to the default .env/.env.local files; --port 5174 overrides vite.config.ts's default port (5173) for this invocation only.
  • Added after initial Build and Test review (user request): distinguishable browser tab titles per instance via VITE_APP_TITLE, defaulting to "SlpModularCms" so existing setups without the var keep today's title unchanged.
  • Full end-to-end verification (starting both backends with real local databases, running both frontends, and confirming the "Add CMS Instance" flow actually connects them) is performed in Build and Test, since it requires a running local SQL Server instance that isn't available in this automated environment.

Verification Performed (Tab Title Change)

  • pnpm build (tsc -b + vite build) — succeeds, no type errors.
  • pnpm test — 208/209 pass; the 1 failure (AddCmsInstanceDialog.test.tsx, a findByTestId timeout) reproduced as flaky under this session's load and passed 5/5 when re-run in isolation — unrelated to the title change (no title-related assertions, and main.tsx is not exercised by component tests).