# Workshare demo on the real server: runbook

Goal: show that Kavion's worksharing runs on the **company Linux server** over **HTTPS**, with two PCs editing one
house at the same time. The server is installed exactly as it will be for customers.

---

## A. Needed before the demo

- SSH login to the server with **sudo**
- DNS name `workshare.globalinfocloud.in` → the server's public IP (type A)
- Ports **80 and 443** open to the server (8080 stays closed)
- A MySQL database and user for Workshare (SETUP_GUIDE_LINUX.md section 5.2b)

`workshare.globalinfocloud.in` is only an **example** used throughout this page: no DNS name exists yet. Use the
real name once it's decided. If the DNS record can't be made in time, see **F. Fallbacks**.

---

## B. Install (the day before the demo, ~30 min)

Follow `SETUP_GUIDE_LINUX.md` sections 3–6. In short, on the server:
```bash
git clone git@github-workshare:Dikshant294/kavion-workshare-server.git     # section 5.1-5.2 (deploy key)
cd kavion-workshare-server
sudo sh deploy/linux/install-linux.sh --check --mysql-url-file /root/workshare-db-url
sudo sh deploy/linux/install-linux.sh --domain workshare.globalinfocloud.in --email <your work e-mail> --mysql-url-file /root/workshare-db-url
```
(`/root/workshare-db-url` holds the MySQL address: SETUP_GUIDE_LINUX.md section 5.2b.)

Then from **your PC** (cmd, in `D:\Projects\WorkshareServer`):
```cmd
node tools\smoke-test.js https://workshare.globalinfocloud.in --token <token>
```
The token: on the server, `sudo cat /etc/workshare/workshare.env`. Expect `20 passed, 0 failed - this server works`.
**Keep that output**: it's slide 1 of the demo.

For the version banner in the demo, on the server:
```bash
sudo nano /etc/workshare/workshare.env
```
add:
```
WORKSHARE_LATEST_APP_VERSION=0.1.1
WORKSHARE_DOWNLOAD_URL=https://workshare.globalinfocloud.in/health
```
then `sudo systemctl restart workshare`. (The link is only a placeholder until there's a real installer to download.)

---

## C. Prepare the two PCs (the day before)

| | PC 1 (you, "Ann") | PC 2 (a colleague's or a laptop, "Bob") |
|---|---|---|
| App | Unity test copy, **Kavion Dev**, with the Workshare folder from the handoff zip + the files from `UnityClientPatch_0.8` + Update Notice component | A **Windows build** of the same test copy |
| Player Settings | Version `0.1.0`, Allow downloads over HTTP = **Not allowed** (proves it's https) | same build |
| Server address | `https://workshare.globalinfocloud.in` (WorkshareController → Default Server Url) | same |
| Create token | Add `WorkshareCreateToken.cs` (from UnityClientPatch) to the Setup Object and paste the token (only Ann creates the model; test copy only) | not needed (Bob joins) |

Best: PC 2 on a **different network** (phone hotspot), so it's clearly over the internet, not the office LAN.

Dry run once: create a model, join, sync, reload. Then delete that model (Team tab) so the demo starts clean.

---

## D. The demo (10 minutes)

Keep a terminal open on the server with the live log next to the Unity windows:
```bash
journalctl -u workshare -f
```
Every action in Unity shows up as a line (route, status, time, app version): the audience sees the real server working.

| # | Do | Say |
|---|---|---|
| 1 | Show the smoke test output | "An automatic test plays two users against the live server. 20 checks, all green, including live push updates." |
| 2 | Browser: `https://workshare.globalinfocloud.in/health` → padlock, `{"ok":true}` | "Real server, real certificate, encrypted." |
| 3 | Ann: **New central model** "Demo House" → join code appears (log: `POST /models 201`) | "The house now lives on the server. That's the central model." |
| 4 | Bob (other network): **Join** with the code | "A second person joins from anywhere, no VPN." |
| 5 | Ann draws two rooms and a door → **Synchronize with Central** | "Ann's work is in central: version 2." |
| 6 | Point at Bob's panel: "1 newer" appeared within a second of Ann's sync, header says "· live". Bob → **Reload Latest** → rooms appear | "Changes are pushed live to everyone; Bob gets them without losing anything of his own." |
| 7 | Bob moves the door. Ann tries to move the same door → "Owned by Bob" | "Like Revit: an element being edited by someone is locked for the others. No overwriting." |
| 8 | Ann → Worksets → **Request** → Bob → **Grant** | "Ownership can be handed over on request." |
| 9 | Both edit different rooms at the same time → both Synchronize | "Parallel work, merged automatically." |
| 10 | **History** tab → open a version → field changes | "Every version: who, when, what changed. The admin can restore any of them." |
| 11 | Home Designer scene: Ann places a sofa → Synchronize → Bob Reload Latest | "Furniture works the same way." |
| 12 | Blue banner "A new version (0.1.1) is available" | "The server tells old apps to update, so customers never run stale versions." |
| 12b | Ann → Team → **Delete central model** → it shows as Deleted → **Restore** | "A mis-click can't destroy a customer's house: it can be restored for 30 days." |
| 13 | Server terminal: `systemctl status workshare`, `ls -lh /var/backups/workshare` | "Runs as a service, restarts itself, backs up every night." |

Optional, if they ask "what if it crashes?": `sudo systemctl restart workshare` during the demo. The apps show "Cannot
reach the server" for a second, then the next action works and nothing is lost.

---

## E. What's honestly not done yet (say it before someone asks)

- **Customer login**: today people join with a code and a key stored on their PC; it needs to be tied to Kavion
  accounts before real customers use it.
- **Code signing** of the installer (Windows warning on install).
- The main Kavion project isn't in Git yet; Workshare is shown in a test copy and goes in on a branch afterwards.

Saying this yourself makes the demo more credible, and it's exactly the list of next steps.

---

## F. Fallbacks

| Problem | Fallback |
|---|---|
| No DNS record in time | On the server, keep the app private and use a temporary Cloudflare tunnel for the demo: install `cloudflared` on the server, run `cloudflared tunnel --url http://localhost:8080` and use the `https://...trycloudflare.com` address it prints (install with `--lan 127.0.0.1` instead of `--domain`). Real server, real HTTPS, but a temporary address |
| Ports 80/443 not opened | Same tunnel fallback: it only needs outgoing internet, no open ports |
| No access to the company server at all | A small cloud VM (Ubuntu, 2–4 vCPU, 4–8 GB) for a few dollars a month, same install. Or show Stage 2 from `TESTING.md` (your PC + tunnel) and be clear that it's the same code |
| Smoke test fails on the day | Send the output and `journalctl -u workshare -n 100 --no-pager` to Dikshant; don't start the demo until it passes |
| Something odd during the demo | Click ↻ in the Workshare panel (refreshes state); worst case Reload Latest. Nothing is lost: central keeps every version |
