| Working copy | Stable copy | |
|---|---|---|
| Folder | im-web-prototypes | im-web-prototypes-stable, next to it |
| Branch | main | stable |
| Runs | bun run dev (Vite dev, hot reload) | bun run stable (production build, vite preview) |
| Port | 3100 | 3200 |
| Shared as | ngrok http 3200 --url=<static domain>.ngrok-free.dev |
Set up once
git worktree add -b stable ../im-web-prototypes-stable main
cd ../im-web-prototypes-stable
git branch --set-upstream-to=main stable # git pull takes local main
git config branch.stable.mergeoptions --ff-only # and never makes a merge commit
bun install
bun run stableThen, in another terminal: ngrok http 3200 --url=<static domain>.ngrok-free.dev. ngrok's free plan includes one static domain, so the shared link stays the same.
Ship a new version
Commit on main first: the stable copy only sees committed work.
cd ../im-web-prototypes-stable
git pull # from local main, fast-forward only
bun install
bun run stable # stop the running one firstgit log stable..main lists what isn't shipped yet.
Worth knowing
- Each copy keeps its own in-memory state (carts, orders, admin edits). A restart resets it.
vite.config.tslets*.ngrok-free.devthrough both the dev server andvite preview.- Receipt PDFs are printed by headless Chrome from this server's own address. Through a tunnel the request has no port, so the PDF code reads
PORT(set to 3200 bybun run stable); without it, the stable copy would print PDFs from the dev server on 3100. - Don't run
bun addin the stable copy. Add packages onmainand merge.