# Playground and Studio

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 |

## Run locally

From the repo root (after `npm install` and `npm run build`):

```bash
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
```

Ports come from [`@x12i/ports-manager`](https://www.npmjs.com/package/@x12i/ports-manager) zone **`api-simulator`** (5520–5539). See [`scripts/api-simulator-ports.mjs`](../scripts/api-simulator-ports.mjs).

Playground **Open in Studio** hands off the current definition via `sessionStorage`.

## Product rule

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.

## Out of v1 Studio

Cloud auth/sync, org SSO, CI, marketplace, multi-env matrices, and share links are deferred (Studio v1.1+).
