CASE FILE · SIM-04
CASE FILE · SIM-04
Two separate UI apps over @x12i/api-simulator. They are not one merged workspace.
| Surface | Job | Mindset |
|---|---|---|
Playground (apps/playground) |
Try a request in ~30 seconds | Ephemeral, session-only |
Studio (apps/studio) |
Author and own a simulator | Persistent (IndexedDB), exportable |
Playground Open in Studio hands off the current definition via sessionStorage.
CASE FILE · SIM-04
From the repo root (after npm install and npm run build):
npm run build
npm run dev -w @x12i/playground # http://127.0.0.1:5523
npm run dev -w @x12i/studio # http://127.0.0.1:5521
Or use the root aliases: npm run dev:playground / npm run dev:studio.
CASE FILE · SIM-04
Ports come from @x12i/ports-manager zone api-simulator (5520–5539, even = API, odd = UI). Wrapper: scripts/api-simulator-ports.mjs.
| Name | Port | Role |
|---|---|---|
api / library-demo / codegen |
5520 | API |
studio (Vite) |
5521 | UI |
flowstate compose server |
5522 | API |
playground (Vite) |
5523 | UI |
npx x12i-ports zone api-simulator
UI apps vs API processes: Playground and Studio are Vite UI processes (odd ports). They do not need @x12i/core-service /_live. Example API processes that bind even ports (library-demo, FlowState compose, node-server) use @x12i/core-service for /health and /_live — see Adapters — HTTP process compliance.
CASE FILE · SIM-04
Both apps edit a UI model that maps to SimulatorDefinition / endpoint behaviors. The library remains the API of record; the UIs generate and preview — they do not invent a parallel DSL.
CASE FILE · SIM-04
Cloud auth/sync, org SSO, CI, marketplace, multi-env matrices, and share links are deferred (Studio v1.1+).