Team StudioTutorialFor adminsApplies from 4.2.3
Trying it locally with compose.yml
Cette page en françaisThis page on the GitHub wiki
You want to see the Studio Server work before hosting it. In ten minutes, on your machine, you will run it in its
simplest mode (no login, SQLite and a folder), import a game, write through its API, watch the journal, and export the
game back. Then you will see what ops/studio/compose.yml adds to try the full team mode.
What you will build
A Studio Server on 127.0.0.1:8787 holding one game at revision 1, then 2 after your first write, and a folder with
that game exported at its head. Every step prints something you can check.
What you need
- The engine repository with its dependencies installed (
npm ci), and Node 22.12 or newer (see Requirements). curl. Docker is never required; it only serves the optional part at the end.
Steps
-
Write a configuration without
oidc: the server is then the local one, on the loopback only, with SQLite and a folder for the contents. Save it as/tmp/studio-try/studio.config.json:{ "publicUrl": "http://127.0.0.1:8787", "playUrl": "http://127.0.0.1:8788", "game": "template", "workDir": "/tmp/studio-try/work", "host": "127.0.0.1", "port": 8787, "store": { "kind": "sqlite", "file": "/tmp/studio-try/work/journal.sqlite" }, "blobs": { "kind": "fs", "dir": "/tmp/studio-try/work/blobs" } }playUrlmust be another origin thanpublicUrl, even here. Then create the folder:# anywhere mkdir -p /tmp/studio-try/work
-
Import a game.
# in the engine repository npm run studio-server -- import games/_template --config /tmp/studio-try/studio.config.jsonYou see
{"event":"imported","game":"template","revision":1}.
-
Start the server (it stays in the foreground; use a second terminal for the next steps):
# in the engine repository npm run studio-server -- serve --config /tmp/studio-try/studio.config.jsonYou see
{"event":"lease-taken",…}then{"event":"listening","host":"127.0.0.1","port":8787,…}.
-
Ask it how it is.
# anywhere on the machine curl http://127.0.0.1:8787/readyz curl http://127.0.0.1:8787/api/revisionYou see
{"ok":true,"writes":"served"}(this instance serves writes) and{"epoch":"…","revision":1}.
-
Write through the API, with an operation id, twice:
# anywhere on the machine curl -i -X POST -H 'content-type: application/json' -H 'x-studio-op: try-local-0001' \ -d '{"text":"hello from curl"}' http://127.0.0.1:8787/api/notes curl -i -X POST -H 'content-type: application/json' -H 'x-studio-op: try-local-0001' \ -d '{"text":"hello from curl"}' http://127.0.0.1:8787/api/notesYou see the first answer with
x-studio-revision: 2; the second, the same answer withx-studio-replayed: 1: the write was applied once.
-
Read the journal and the diff.
# anywhere on the machine curl "http://127.0.0.1:8787/api/ops?after=1" curl http://127.0.0.1:8787/api/diff/1..2You see operation 2 writing
notes.json, and the diff naming the note's fields added.
- Stop the server with Ctrl+C in its terminal. You see
{"event":"stopping","signal":"SIGINT"}.
-
Export the game at its head:
# in the engine repository npm run studio-server -- export /tmp/studio-try/exported --config /tmp/studio-try/studio.config.jsonYou see
{"event":"exported","revision":2,"files":…}, and/tmp/studio-try/exported/export-manifest.jsonwith each file's hash. Delete/tmp/studio-trywhen you are done.
The full team mode with compose.yml
ops/studio/compose.yml starts, on the loopback only, Postgres (127.0.0.1:55432,
user studio), MinIO, an S3 store (127.0.0.1:59000), and Keycloak (127.0.0.1:58080) with the test realm
web-scumm and one test user, lea@example.org, password lea-local-only, email verified:
# in the engine repository
docker compose -f ops/studio/compose.yml up -dIt is a starting point, not a turnkey setup. On top of it you still need:
- a configuration with
oidc(issuerhttp://127.0.0.1:58080/realms/web-scumm, clientsstudioandweb-scumm-cli) andoidc.allowInsecure: true, since the provider answers over http; the realm'sstudioclient expects its callback athttp://localhost:8080/auth/callback, sopublicUrlishttp://localhost:8080unless you edit the realm; store.kindpostgreswithSTUDIO_DATABASE_URL, andblobs.kinds3on MinIO with a bucket you create andSTUDIO_S3_KEY_ID/STUDIO_S3_KEY_SECRET;- the secrets
STUDIO_OIDC_CLIENT_SECRET(the realm's) andSTUDIO_SESSION_KEY; - a worker (
npm run studio-worker, withWORKER_PUBLIC_KEYandWORKER_INSTANCE), its keys made byworker-keys, andworkerin the configuration withSTUDIO_WORKER_KEY; - the Studio's page built:
npm run studio-client; trustProxyif the server listens beyond the loopback.
What you learned
- A write is an operation with an id, applied once (Concepts).
- Every change moves the revision, and the journal lists it (Concepts).
exportgives the game back at its head (The server's command line).
Where to go next
- What runs where: the parts of a hosted Studio.
- Clever Cloud: overview, then First deployment.