# Deploying Family Game Night to Render (free)

Render runs your `server.js` as a real Node app with WebSockets — the part GoDaddy can't do. Render deploys from a Git repository (GitHub is easiest). You do **not** need to use any command line; both GitHub and Render work in the browser.

Total time: ~15 minutes the first time.

---

## Step 1 — Put the project on GitHub (browser only)

1. Make a free account at https://github.com if you don't have one.
2. Click the **+** (top right) → **New repository**.
   - Name: `family-game-night`
   - Set it to **Private** (fine — Render can still read it once you connect them).
   - Click **Create repository**.
3. On the new repo page, click **uploading an existing file** (the link in "…or upload an existing file").
4. Drag in the contents of your **Group Games** folder:
   - `server.js`, `package.json`, `render.yaml`, `README.md`, and the **`public`** folder.
   - ❌ Do **not** upload `node_modules` (Render rebuilds it) — if it's there, just skip it.
5. Click **Commit changes**.

> Tip: make sure `server.js` and `package.json` are at the **top level** of the repo, with `public/` as a subfolder — not nested inside another folder.

---

## Step 2 — Deploy on Render

1. Make a free account at https://render.com — sign up **with GitHub** so they're connected.
2. Click **New +** → **Blueprint** (this reads the `render.yaml` for you).
   - If asked, **connect your GitHub** and pick the `family-game-night` repo.
   - Render shows it will create a free web service. Click **Apply** / **Create**.
3. Wait for the build (a couple of minutes). When it says **Live**, you'll get a URL like:
   `https://family-game-night-xxxx.onrender.com`
4. Open that URL — create a room, get a code, and you're live. 🎉

(If you'd rather not use the Blueprint: **New + → Web Service → pick the repo**, then set **Build Command** = `npm install --ignore-scripts` and **Start Command** = `node server.js`. Render fills in the rest.)

---

## Step 3 (optional) — Use play.synara.app instead of the onrender.com URL

1. In Render → your service → **Settings → Custom Domains** → add `play.synara.app`.
2. Render shows a target value (something like `family-game-night-xxxx.onrender.com`).
3. In **GoDaddy → your domain → DNS**, add a record:
   - Type: **CNAME**
   - Name/Host: `play`
   - Value/Points to: the Render target from step 2
   - Save.
4. Back in Render, wait for it to verify and issue the HTTPS certificate (can take a few minutes to an hour). Then `https://play.synara.app` works — **and** cameras work, because it's HTTPS.

---

## Good to know

- **First open of the night is slow.** Free services sleep after 15 min idle and take ~1 minute to wake on the next visit. During an active game, WebSocket traffic keeps it awake. If the wait ever bugs you, Render's cheapest paid tier removes the sleep.
- **Updating the game later:** upload changed files to the GitHub repo (same as Step 1.3–1.5). Render redeploys automatically.
- **Cameras need HTTPS** — both the onrender.com URL and play.synara.app are HTTPS, so you're covered.
