Projects and sharing
A board in Lab mode is a project: its parts, wires, code files, groups and world settings, plus the random seed that makes its runs reproducible. Projects work with no server at all and gain sync, history and sharing when one is reachable.
What is open, and how the URL says it
The address bar names the project you are looking at:
| URL | Opens |
|---|---|
/lab | A local board — the last one you had open here, or the demo the first time. |
/lab/project/<id> | A project saved on the server, syncing as you edit. |
/lab/share/<slug> | Someone's shared board, read-only and forkable. |
/lab/live/<id> | A live session someone is hosting, watched read-only. |
/lab/example/<id> | A ready-made example board. |
/lab/bench/<n> | A stress-test board with n part pairs, for performance work. |
Switching projects updates the URL, so it is always safe to copy the address bar as a bookmark or a link. Links from before Lab mode became a tab (?lab, ?share=<slug> and so on) still work: they open the matching /lab/… address.
Saving
The name field in the top bar renames the project. Next to it, the save status tells you where you stand:
- In this browser — a local board; nothing leaves the machine.
- Saved / Saving… — a server project; edits are on their way.
- Offline — will sync — the server is unreachable; edits queue and go when it returns.
- Read-only — someone else's project or a shared board.
- Not saved — the server refused some change; the board is reloaded from the server.
Every edit is cached in the browser's storage immediately, so a reload or a closed tab loses nothing. If the project lives on the server, changes are batched and posted a moment later. If someone changed the project first, your unsent edits are replayed on top of the newer board and retried; if the project turns out to be someone else's, editing stops and a banner offers Fork to edit.
The Projects dialog
Projects in the top bar opens the project browser:
- This board — Save to server (when online and not yet saved), Export file…, Import file…, and New blank board (a bare Raspberry Pi and a stub
main.py). - On the server — every project you can see, with its part count, last update, Fork and Delete. Opening one loads it; forking makes a copy of your own and opens that.
- Examples — the built-in example boards, each opening as a new local project.
History: snapshots
History (for server projects) takes named snapshots. Type what changed — the message is optional and capped at 500 characters — and click Save snapshot. The table lists every snapshot with its number, message and time; Restore puts that board back, replacing what is open (the dialog asks first and suggests taking a snapshot of the current state before you do).
Snapshots are a safety net for big changes; the automatic per-edit sync is what keeps the board itself safe.
Share links
Share needs a backend and a project saved on the server (it offers Save to server if the board is still local). There are two ways to share:
- Read-only link — Create link makes a public slug and shows a URL ending
/lab/share/<slug>. Anyone with it can open the board and fork their own copy; opening it makes the project public. - Live session — Go live starts a session viewers join with the URL shown. They watch your simulation run — LEDs, displays, the console — but cannot change anything. The dialog lists who is watching, carries a chat both ways, and End live session stops it. The top bar shows a ● LIVE marker while viewers are connected.
The read-only banner at the top of a shared or foreign board has Fork to edit, which copies it into a project of your own.
Export and import
Export file writes a .raspsim.json bundle: the project's settings and seed, its parts, wires, files, groups, and (for server exports) its recordings. Import file… reads a bundle back — on a server it creates a new server project; offline it opens as a local board.
Accounts
Lab mode needs an account, like the rest of PyRasp: opening a Lab address signed out shows the front page, and signing in from there opens Lab mode. Accounts own server projects: you see your own boards in the Projects dialog, and shared boards are forked into your account.
Going deeper: live sessions
A live session streams the running simulation, not the project document: the host sends a keyframe with the board when a viewer joins, then small delta frames about ten times a second with the changed state, screens and console output. That is why viewers see a servo move or an LCD count down without downloading your code, and why they cannot edit the board — there is nothing on their side to edit until they fork it.