Skip to main content

Demo Repos Sandbox

Use this when you want to prove X4 end to end with the demo repos before onboarding a real repo set.

The demo uses four repos:

  • x4-demo-app-npm: entry/dashboard repo;
  • x4-demo-api-pnpm: API repo with /health and /counter/increment;
  • x4-demo-web-yarn: frontend repo that calls the API;
  • x4-demo-docs-manual: docs repo included in the workspace but not started as a service.

Run the full demo from the X4 repo:

pnpm demo:x4-repos

Or run the script directly:

scripts/demo-x4-repos-sandbox.sh

The script:

  1. prepares the demo repos under /home/x4control/dev/repos;
  2. creates a fresh feature workspace under /home/x4control/dev/workspaces;
  3. generates and validates an X4 registry;
  4. bootstraps the multi-repo workspace;
  5. runs env-file to prove one env file per repo can be materialized without starting services;
  6. mirrors the demo repos to x4-testbox-standard-1;
  7. runs local-preview on that Docker-capable worker;
  8. verifies the dashboard, API, frontend, and API counter call over the private preview URL.

The control host does not need Docker. The service sandbox runs on the worker:

x4 sandbox up \
--backend ssh \
--target x4-testbox-standard-1 \
--profile local-preview \
--git-auth none \
--filter-forbidden-env \
--serve-preview \
--preview-backend tailnet-proxy \
--wait

Successful output ends with URLs like:

Dashboard: http://100.x.y.z:3002/dashboard/
Frontend: http://100.x.y.z:3002/web/
API: http://100.x.y.z:3002/backend/

Open the frontend and click the increment button. It calls the API through the same private preview proxy. You can also verify from the terminal:

curl http://100.x.y.z:3002/dashboard/health
curl http://100.x.y.z:3002/backend/health
curl http://100.x.y.z:3002/web/health
curl -X POST http://100.x.y.z:3002/backend/counter/increment

Inspect the running sandbox:

cd /home/x4control/dev/workspaces/<generated-demo-workspace>
x4 sandbox status
x4 sandbox logs --tail 100

Stop it when done:

x4 sandbox destroy --force --prune-artifacts

For a non-persistent smoke run:

scripts/demo-x4-repos-sandbox.sh --destroy