# Curio HMS — Production deploy checklist

Target: [https://curio.applaude.net/dashboard.html](https://curio.applaude.net/dashboard.html)

## Pre-deploy (local)

- [ ] Confirm dashboard files are saved as **UTF-8** (no `â‚¹` / `ðŸ` in source).
- [ ] Smoke-test locally:
  ```powershell
  cd c:\Users\sunde\proxmox\curaflow-hms
  node backend/server.js
  ```
  Open `http://localhost:3000/dashboard.html` — sidebar must not overlap the queue table; emojis and ₹ must render correctly.
- [ ] Bump cache-bust query strings if you changed static assets (`dashboard.css?v=`, `dashboard.js?v=` in `dashboard.html`).

## Deploy (CI → registry → Kubernetes)

This repo builds on **push** via `.gitea/workflows/build.yaml` (Kaniko → `192.168.8.250:5000/curio:latest`).

1. **Commit and push** all changes (including `backend/server.js` UTF-8 headers and dashboard UI fixes).
2. **Wait for the Gitea Actions build** to finish successfully.
3. **Roll out Kubernetes** (pick one):
   ```bash
   # Restart pods to pull :latest
   kubectl rollout restart deployment/curio-app -n curio

   # Or patch redeploy annotation (see k8s/app.yaml)
   kubectl apply -f k8s/app.yaml -n curio
   kubectl rollout status deployment/curio-app -n curio
   ```
4. **Confirm pods are new**:
   ```bash
   kubectl get pods -n curio -l app=curio-app
   kubectl logs -n curio -l app=curio-app --tail=50
   ```

## Post-deploy verification

Open production in a **private/incognito** window (avoids stale cache).

| Check | Expected |
|-------|----------|
| Nav labels | 👥 Queue, 💊 Pharmacy (not `ðŸ` / `â‚¹`) |
| Sidebar layout | Sidebar on the left; main content not covered |
| Overview stats | `↑ 4 since last hour` (not `â†'`) |
| Doctor workspace | Log in as Doctor → **Queue** → **Start Recording** visible |
| Response headers | DevTools → Network → `dashboard.html` → `Content-Type: text/html; charset=utf-8` |
| Recording | Chrome/Edge, allow microphone; button toggles to **Pause Scribe** |

### Quick header check (PowerShell)

```powershell
(Invoke-WebRequest -Uri "https://curio.applaude.net/dashboard.html" -Method Head).Headers["Content-Type"]
```

Should include `charset=utf-8`.

### Doctor role (for Zen / recording UI)

In browser console on production:

```javascript
localStorage.setItem('userRole', 'DOCTOR');
location.reload();
```

Then open **Queue** — clinical workspace with SOAP notes and **Start Recording**.

## If encoding is still broken after deploy

1. **Files on disk** — Re-save `dashboard.html` (and other HTML) as UTF-8 in the editor; redeploy.
2. **Reverse proxy** — Ensure nginx/ingress does not force `charset=iso-8859-1` on static files.
3. **CDN/cache** — Purge edge cache for `*.html`, `*.css`, `*.js`.
4. **Hard refresh** — `Ctrl+Shift+R` on the dashboard.

## Rollback

```bash
# If you tag images per release, redeploy the previous tag instead of :latest
kubectl set image deployment/curio-app curio=192.168.8.250:5000/curio:<previous-tag> -n curio
kubectl rollout status deployment/curio-app -n curio
```

## Files that must ship for the dashboard UX fix

- `dashboard.html`
- `dashboard.css`
- `dashboard.js`
- `globals.css`
- `settings.css`
- `backend/server.js` (UTF-8 `Content-Type` headers)
