← back to Rentv 2026

DEPLOY-HANDOFF-toggle.md

33 lines

# RENTV 2026 — surgical deploy handoff (toggle + templates + ad-slots)

**Owner of this deploy:** `claude-rentv-max` (Steve's call, 2026-08-07 — you own rentv prod + the live `rentv-ad-engine` :9793). `claude-mac2` built it; **do NOT full-deploy** (a full `deploy.sh` from a Mac2 worktree crash-looped prod once — TK-10061 — because prod's live `server.js` carries pr-intelligence + forsale + ad-engine wiring the worktree may not match).

## Goal
An admin logged into `rentv.agentabrams.com` sees a bottom-right **▾ Templates** pill to flip the live front end between the original site + the 5 concepts (A–E), plus the ad-slots-for-sale marketplace.

## Files (all on branch `feature/2026-overhaul-adslots`, shared `.git` — just `git checkout` them onto the prod tree)
**Additive statics (safe, drop-in):**
- `public/template-toggle.js`  ← the admin toggle (+ view-all overlay, commit 3e325c5)
- `public/2026/{index,a,b,c,d,e}.html`  ← selector + 5 templates
- `public/2026/elements.js`  ← element-numbering overlay
- `public/ad-slot.js`, `public/ad-admin.html`, `public/ad-creatives/*.svg`
- `public/advertise.html`  ← rebuilt slots-for-sale marketplace
- `data/ad-slots.json`  ← banner rate card
- `src/ad-system.cjs`  ← the ad-slots module (all 154 videos as sponsorable inventory)

**One-line inject in `public/index.html`** (before `</body>`):
```html
<script src="/template-toggle.js" defer></script>
```

**One line to MERGE into prod's LIVE `server.js`** (before the `express.static` fallthrough — do NOT overwrite prod's server.js, just add this line):
```js
require('./src/ad-system.cjs')(app, { DATA, PUB, adminOnly });
```
That mounts `/api/ad/*`, which the /2026 pages + /advertise call. It needs the same `DATA`, `PUB`, `adminOnly` symbols prod's server.js already defines (it does).

## Notes / gates
- **nginx** already gates the site (un/pw) — the app-layer re-gate in commit 23094df is optional belt-and-suspenders; skip it if you don't want to touch prod's gate. The toggle shows for authed admin/user via `/api/whoami` (prod forwards Basic creds → role resolves → toggle appears).
- **Ad-system reconciliation (open):** my `/advertise` slots-for-sale overlaps your live `/advertisers` ad-engine (:9793, TK-10343). Steve hasn't picked the canonical one yet. Deploy the toggle + templates now; we settle which ad system is canonical separately (I proposed feeding my slot inventory into your engine + rentv-forsale's CRM rather than running two).
- Verify after: `curl -u admin:DW2024! https://rentv.agentabrams.com/2026/c.html` = 200, and an admin browser hit to `/` shows the ▾ Templates pill.