Laptop: the Plugin Studio route in LAPTOP-6WAY, and one route on port 4616 at a time

LAPTOP-6WAY described two routes. The third, the public Plugin Studio (bun run laptop plugin-studio),
had only its compose profile and the command's help. It now has its own section: what the command
starts, the addresses, the admin password for publishing and PocketBase's dashboard, how the two
per-request addresses are set, and what to set while dx-maps' development has no public mode yet.
"Checked" records what was proven on 2026-09-29, the halves separately, and says the one command
end to end has not been run yet.

The subdomain and Plugin Studio routes both publish the dx-maps container on port 4616. Starting one
while the other runs failed inside docker compose with a port error. bun run laptop now stops first
and says to run bun run laptop down.
This commit is contained in:
doxa-maps 2026-09-29 05:32:55 +00:00
parent fa3591ca9b
commit 18e0c39ed9
2 changed files with 62 additions and 8 deletions

View file

@ -1,13 +1,15 @@
# The Research Gallery on your laptop: two routes
# The Research Gallery on your laptop: three routes
DX-life takes the dx-maps Research Gallery in **two routes**, one branch each. This page runs each of them on a
laptop, so you can see and test them before any server is involved. The same two run on the team's servers;
together that is the embed test (2 routes × laptop and server).
DX-life takes the dx-maps Research Gallery in **three routes**, one branch each. This page runs each of them on a
laptop, so you can see and test them before any server is involved. The drop-in and subdomain routes also run on
the team's servers (the embed test: each route on a laptop and on a server). The Plugin Studio route's own server
is still to come.
| Route | DX-life branch | What runs | Docker | PocketBase |
|---|---|---|---|---|
| **Drop-in** (the default) | `research-gallery-drop-in` | this site alone; the maps are its own copy in `public/dx-maps` | no | no |
| **Subdomain** | `research-gallery-subdomain` | the dx-maps **team container** (Plugin Studio, PocketBase, the research site) + a local sign-in + this site | yes, about 5 GB | yes, for plugins that have users, an API or a database |
| **Plugin Studio** | `research-gallery-plugin-studio` | the dx-maps container in its **public** mode (the Plugin Studio open to everyone, and its `/cdn` of production maps) + this site | yes, about 5 GB | yes, the container's own; its dashboard asks for the admin password |
The **CDN** route (`research-gallery-cdn`) was retired on 2026-09-29. Its branch is kept for history.
@ -18,8 +20,8 @@ The **CDN** route (`research-gallery-cdn`) was retired on 2026-09-29. Its branch
doxa-maps/ dx-maps, on development (the team's table) or main (production)
doxa-life/ this repo
```
- **bun 1.3+** and **node 20+**. For the subdomain route, **Docker** with Compose: it uses about 1.4 GB, 2.5 GB while
publishing; give Docker 4-6 GB.
- **bun 1.3+** and **node 20+**. For the subdomain and Plugin Studio routes, **Docker** with Compose: each uses
about 1.4 GB, 2.5 GB while publishing; give Docker 4-6 GB.
- **Once:** `cd doxa-life && bun install`. The branches share one lockfile.
## 1. Drop-in (the default: one server, no Docker)
@ -86,6 +88,39 @@ drop-in route.
**Stop:** `bun run laptop down` keeps PocketBase's data and the published build; `bun run laptop down --wipe`
deletes them. `bun run laptop status` shows what's running.
## 3. Plugin Studio (the public Studio, no sign-in)
```bash
cd doxa-life && git switch research-gallery-plugin-studio
bun run laptop plugin-studio
```
- The first time is as for the subdomain route: `.env.laptop` needs `GIT_TOKEN`, and the first start takes 5-10
minutes. `.env.laptop` also gets an `ADMIN_PASSWORD`.
- It builds the same dx-maps image from `../doxa-maps/Dockerfile`, and runs dx-maps `development` in its public
mode (`ACCESS=public`).
- **Public mode is new.** If your dx-maps checkout's `deployment/cloud/README.md` has no "Public Studio" section,
`development` doesn't have it yet: add `DXMAPS_BRANCH=repo/public-studio-mode` to `.env.laptop` until it lands.
- It uses port 4616, as the subdomain route does, so run one of the two at a time (`bun run laptop down` first).
It starts two services, both on `127.0.0.1` only:
| Address | What |
|---|---|
| http://localhost:4614/ | this site, plugin-studio branch. The Research menu and `/regions` open the Studio; every map loads from the Studio's `/cdn` |
| http://research.localhost:4616/ | the public Plugin Studio: every plugin, open to everyone, with no sign-in, as its public server will run it |
| http://research.localhost:4616/admin/status and `/pb/_/` | publishing and PocketBase's dashboard: user `admin`, password `ADMIN_PASSWORD` from `.env.laptop` |
**How it is wired:**
- This site reads both addresses per request, never at build time. The compose file sets them:
`NUXT_PUBLIC_RESEARCH_GALLERY_URL=http://research.localhost:4616/` and
`NUXT_PUBLIC_DX_MAPS_BASE=http://research.localhost:4616/cdn/dx-maps`.
- Publishing is automatic. About a minute after the container starts, and whenever `main` moves, it publishes
`main` to `/cdn`. The snippets point at `http://research.localhost:4616/cdn`.
- `research.localhost` works as in the subdomain route (Safari may need the `/etc/hosts` line).
**Stop:** `bun run laptop down` (data kept; `--wipe` deletes it).
## What "working" looks like
- **`/embed-test`:** the production cards mount and draw their maps, with 0 page errors and 0 iframes.
@ -96,9 +131,10 @@ deletes them. `bun run laptop status` shows what's running.
the script, its integrity hash, its element, its page, CORS, and the copy-paste snippet. The label reads
`<name>=<site origin>@<manifest URL>`:
- drop-in: `drop-in=http://localhost:4611@http://localhost:4611/dx-maps/manifest.json`;
- subdomain: `subdomain=http://research.localhost:4615@http://research.localhost:4615/dx-maps/manifest.json`.
- subdomain: `subdomain=http://research.localhost:4615@http://research.localhost:4615/dx-maps/manifest.json`;
- Plugin Studio: `plugin-studio=http://localhost:4614@http://research.localhost:4616/cdn/dx-maps/manifest.json`.
- The **snippet** passes only when the manifests carry the address they're served from:
- the subdomain route bakes it in by itself;
- the subdomain and Plugin Studio routes bake it in by themselves;
- for the drop-in, regenerate the manifests as shown in 1.
## Without Docker, the subdomain route by hand (no PocketBase)
@ -138,3 +174,16 @@ Results:
maps pass all 6 checks, the snippet included.
- **Memory once running:** dx-maps 0.3 GB, this site 0.9 GB, the sign-in provider 0.15 GB. The first publish added
about 1 GB for a minute.
**The Plugin Studio route** was checked in two halves on 2026-09-29:
- the public Studio container (dx-maps `repo/public-studio-mode`, `ACCESS=public`) ran on a server, tunnelled as
above;
- this site's plugin-studio branch ran as a dev server beside it, with the two addresses above.
Results:
- **`check-embed-6way` on `plugin-studio=http://localhost:4614@…/cdn/dx-maps/manifest.json`:** 7 of 7 production
maps pass all 6 checks, the snippet included (dx-base).
- **The public Studio's review (dx-base): PASS.** A visitor with no password reaches the Studio and the plugins'
data, and nothing else. Publishing and PocketBase's dashboard ask for the admin password.
- **Not yet run:** the one command end to end (`bun run laptop plugin-studio` starting both services). It is run
before the Driver's own laptop run.

View file

@ -66,6 +66,11 @@ function ensureEnv() {
async function up(profile: 'subdomain' | 'plugin-studio') {
if (!out(['docker', 'compose', 'version', '--short'])) stop(`Docker with Compose is needed for the ${profile} route. Without Docker, use: bun run laptop drop-in`)
const env = ensureEnv()
// Both routes publish the dx-maps container on port 4616, so only one can run at a time.
const [other, otherDx] = profile === 'subdomain' ? ['plugin-studio', 'dx-maps-studio'] : ['subdomain', 'dx-maps']
if (out([...COMPOSE, '--profile', other, 'ps', '--status', 'running', '--services'])?.split('\n').includes(otherDx)) {
stop(`The ${other} route is running, and both routes use port 4616. Stop it first: bun run laptop down`)
}
const dx = env.DXMAPS_DIR || '../doxa-maps'
if (!existsSync(`${dx}/Dockerfile`)) stop(`${dx}/Dockerfile not found. Clone dx-maps next to this folder (or set DXMAPS_DIR in ${ENV}) and pull development: its Dockerfile is at the root.`)
const dockerMb = Math.round(Number(out(['docker', 'info', '--format', '{{.MemTotal}}']) ?? 0) / 1048576)