← back to Ventura Corridor
YOLO tick 5: /upgrade/:bizId tier ladder page + intent capture
e0407a5ce8211363a92e6d8b56c0bc835e558729 · 2026-05-12 13:45:26 -0700 · SteveStudio2
Public per-business upgrade page that reads tier_pricing seeded by the
3am gallery job. URL pattern: /upgrade/123 (numeric :bizId only — regex
([0-9]+) in the route prevents catching /upgrade/foo paths).
API:
- GET /api/upgrade/:bizId — business row + tier_pricing rows for its
category, ordered by price_cents ASC
- POST /api/upgrade/:bizId/intent — captures email + name + notes
for buyers wanting to be notified when paid tiers open; persists
to upgrade_intents (new table: business_id FK, requested_tier,
contact_email, contact_name, notes, ip_addr, created_at)
Frontend (public/upgrade.html):
- Standard Ventura Corridor chrome: gold logo UL, hamburger UR
- Business header: eyebrow, name (Playfair), category chip, address chip,
optional website chip with deeplink
- 3-tier cards grid (auto-fit 1-col mobile, 3-col desktop)
· Basic: 'Already on Basic' disabled CTA
· Featured: gold-bordered card with 'MOST POPULAR' ribbon
· Spotlight: gold CTA, Playfair italic accent on tier name
- Tier marketing_copy reads from JSONB in DB; falls back to TIER_COPY
defaults per tier name (basic/featured/spotlight/verified)
- 'Notify me when this opens' CTA expands an inline intent form (no
page navigation, smooth-scroll into view, accessible)
- Form: email (required), name (optional), notes (textarea)
- POST → green ✓ toast on success, red ✕ on failure
- Current-tier badge if biz.tier already matches (green pill)
Stripe Connect path NOT wired yet — that's gated on Steve enabling
Connect on the Designer Wallcoverings account. Intent capture is the
pragmatic stand-in: photographers/restaurateurs sign up now, we email
them the moment Stripe is live. No false 'Buy Now' button that 404s.
End-to-end smoke test (Shanghai Rose, biz 3, amenity: restaurant):
- /api/upgrade/3 returns business + 3 tiers (basic free, featured ,
spotlight )
- /upgrade/3 renders the page (HTTP 200)
- POST intent → upgrade_intents V1 inserted ok
Reversible: DROP TABLE upgrade_intents + revert routes if pricing model
changes. No external side-effects.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Files touched
A public/upgrade.htmlM src/server/index.ts
Diff
commit e0407a5ce8211363a92e6d8b56c0bc835e558729
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date: Tue May 12 13:45:26 2026 -0700
YOLO tick 5: /upgrade/:bizId tier ladder page + intent capture
Public per-business upgrade page that reads tier_pricing seeded by the
3am gallery job. URL pattern: /upgrade/123 (numeric :bizId only — regex
([0-9]+) in the route prevents catching /upgrade/foo paths).
API:
- GET /api/upgrade/:bizId — business row + tier_pricing rows for its
category, ordered by price_cents ASC
- POST /api/upgrade/:bizId/intent — captures email + name + notes
for buyers wanting to be notified when paid tiers open; persists
to upgrade_intents (new table: business_id FK, requested_tier,
contact_email, contact_name, notes, ip_addr, created_at)
Frontend (public/upgrade.html):
- Standard Ventura Corridor chrome: gold logo UL, hamburger UR
- Business header: eyebrow, name (Playfair), category chip, address chip,
optional website chip with deeplink
- 3-tier cards grid (auto-fit 1-col mobile, 3-col desktop)
· Basic: 'Already on Basic' disabled CTA
· Featured: gold-bordered card with 'MOST POPULAR' ribbon
· Spotlight: gold CTA, Playfair italic accent on tier name
- Tier marketing_copy reads from JSONB in DB; falls back to TIER_COPY
defaults per tier name (basic/featured/spotlight/verified)
- 'Notify me when this opens' CTA expands an inline intent form (no
page navigation, smooth-scroll into view, accessible)
- Form: email (required), name (optional), notes (textarea)
- POST → green ✓ toast on success, red ✕ on failure
- Current-tier badge if biz.tier already matches (green pill)
Stripe Connect path NOT wired yet — that's gated on Steve enabling
Connect on the Designer Wallcoverings account. Intent capture is the
pragmatic stand-in: photographers/restaurateurs sign up now, we email
them the moment Stripe is live. No false 'Buy Now' button that 404s.
End-to-end smoke test (Shanghai Rose, biz 3, amenity: restaurant):
- /api/upgrade/3 returns business + 3 tiers (basic free, featured ,
spotlight )
- /upgrade/3 renders the page (HTTP 200)
- POST intent → upgrade_intents V1 inserted ok
Reversible: DROP TABLE upgrade_intents + revert routes if pricing model
changes. No external side-effects.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---
public/upgrade.html | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++
src/server/index.ts | 42 ++++++++++
2 files changed, 261 insertions(+)
diff --git a/public/upgrade.html b/public/upgrade.html
new file mode 100644
index 0000000..619ec65
--- /dev/null
+++ b/public/upgrade.html
@@ -0,0 +1,219 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
+<meta name="theme-color" content="#0e0e0e">
+<title>Upgrade your listing — Ventura Corridor</title>
+<meta name="description" content="Three tiers per category — Basic free, Featured, Spotlight. Stand out on the boulevard.">
+<link rel="preconnect" href="https://fonts.googleapis.com">
+<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;500;600;700&display=swap">
+<style>
+:root{--bg:#0e0e0e;--panel:#181613;--fg:#f1ece2;--muted:#9a8f7e;--rule:rgba(255,255,255,0.10);--gold:#c9a96e;--green:#7ee69b}
+*{box-sizing:border-box}
+html,body{margin:0;padding:0;background:var(--bg);color:var(--fg);font-family:'Inter',sans-serif;line-height:1.55}
+header{padding:14px 22px;border-bottom:1px solid var(--rule);display:flex;align-items:center;gap:14px;position:sticky;top:0;background:rgba(14,14,14,0.96);backdrop-filter:blur(10px);z-index:5}
+header .logo{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--gold);font-family:'Playfair Display',serif;font-weight:700;font-size:1.2em}
+header .logo svg{width:30px;height:30px}
+.hamburger{margin-left:auto;width:36px;height:36px;border:1px solid var(--rule);border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--fg);font-size:1.05em;cursor:pointer;background:transparent}
+main{max-width:1100px;margin:0 auto;padding:36px 24px 80px}
+.biz{margin-bottom:32px}
+.biz .eyebrow{color:var(--gold);font-size:0.72em;letter-spacing:2px;text-transform:uppercase;font-weight:600;margin-bottom:8px}
+.biz h1{margin:0 0 6px;font-family:'Playfair Display',serif;font-weight:700;font-size:2.1em;letter-spacing:-0.01em}
+.biz .meta{color:var(--muted);font-size:0.95em}
+.biz .meta span{display:inline-block;padding:3px 10px;background:rgba(255,255,255,0.04);border:1px solid var(--rule);border-radius:999px;font-size:0.78em;margin-right:6px}
+.tiers{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:28px}
+.tier{background:var(--panel);border:1px solid var(--rule);border-radius:14px;padding:24px;display:flex;flex-direction:column;gap:14px;transition:transform 0.18s,border-color 0.18s,box-shadow 0.18s;position:relative;min-height:480px}
+.tier:hover{transform:translateY(-4px);border-color:rgba(201,169,110,0.4);box-shadow:0 12px 28px rgba(0,0,0,0.4)}
+.tier.featured{border-color:var(--gold);box-shadow:0 0 0 1px rgba(201,169,110,0.3) inset}
+.tier.featured::before{content:'MOST POPULAR';position:absolute;top:-11px;left:50%;transform:translateX(-50%);background:var(--gold);color:#0a0a0a;font-size:0.65em;letter-spacing:2px;padding:4px 10px;border-radius:999px;font-weight:700}
+.tier .name{font-family:'Playfair Display',serif;font-size:1.4em;font-weight:700;margin:0}
+.tier .name em{color:var(--gold);font-style:italic}
+.tier .price{font-family:'Playfair Display',serif;font-size:2.4em;font-weight:700;color:var(--gold);margin:0;line-height:1}
+.tier .price small{display:block;color:var(--muted);font-family:'Inter',sans-serif;font-size:0.32em;font-weight:500;letter-spacing:1.5px;margin-top:4px;text-transform:uppercase}
+.tier .desc{margin:0;color:var(--muted);font-size:0.92em;line-height:1.5}
+.tier ul{margin:0;padding-left:20px;flex:1}
+.tier li{margin-bottom:8px;color:var(--fg);font-size:0.88em}
+.tier li::marker{color:var(--gold)}
+.tier .cta{margin-top:auto;background:transparent;color:var(--fg);border:1px solid var(--rule);border-radius:10px;padding:13px 18px;font-family:inherit;font-weight:600;font-size:0.95em;cursor:pointer;transition:all 0.18s}
+.tier.featured .cta,.tier.spotlight .cta{background:var(--gold);color:#0a0a0a;border-color:var(--gold)}
+.tier .cta:hover{filter:brightness(1.15)}
+.tier .cta:disabled{opacity:0.5;cursor:not-allowed}
+.current{background:rgba(126,230,155,0.1);border:1px solid rgba(126,230,155,0.4);color:var(--green);text-align:center;padding:8px;border-radius:8px;font-size:0.82em;font-weight:600;letter-spacing:1px;text-transform:uppercase}
+.intent-form{display:none;background:var(--panel);border:1px solid var(--gold);border-radius:14px;padding:24px;margin-top:24px}
+.intent-form.show{display:block;animation:slidein 0.3s ease}
+@keyframes slidein{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
+.intent-form h3{margin:0 0 6px;font-family:'Playfair Display',serif;font-size:1.3em}
+.intent-form p{margin:0 0 18px;color:var(--muted);font-size:0.92em}
+.intent-form .row{display:grid;gap:12px}
+.intent-form input,.intent-form textarea{width:100%;background:rgba(255,255,255,0.05);border:1px solid var(--rule);border-radius:8px;padding:11px 14px;color:var(--fg);font-family:inherit;font-size:0.95em;outline:none}
+.intent-form input:focus,.intent-form textarea:focus{border-color:var(--gold)}
+.intent-form .actions{display:flex;gap:10px;margin-top:14px}
+.intent-form button{padding:12px 22px;border-radius:10px;font-family:inherit;font-weight:700;cursor:pointer;border:1px solid var(--rule);background:transparent;color:var(--fg)}
+.intent-form button[type=submit]{background:var(--gold);color:#0a0a0a;border-color:var(--gold)}
+.intent-form .label{color:var(--muted);font-size:0.75em;letter-spacing:1.5px;text-transform:uppercase;font-weight:600;margin-bottom:4px;display:block}
+.toast{margin-top:14px;padding:12px 16px;border-radius:8px;font-size:0.9em}
+.toast.ok{background:rgba(126,230,155,0.1);border:1px solid rgba(126,230,155,0.4);color:var(--green)}
+.toast.err{background:rgba(255,138,138,0.1);border:1px solid rgba(255,138,138,0.4);color:#ff8a8a}
+.empty{padding:60px 24px;text-align:center;color:var(--muted)}
+.empty h2{font-family:'Playfair Display',serif;color:var(--fg);font-size:1.6em;margin:0 0 8px}
+@media (max-width:780px){
+ main{padding:24px 16px 60px}
+ .biz h1{font-size:1.6em}
+ .tiers{grid-template-columns:1fr;gap:14px}
+ .tier{min-height:auto}
+ .tier.featured::before{font-size:0.6em}
+}
+</style>
+</head>
+<body>
+
+<header>
+ <a class="logo" href="/" aria-label="Ventura Corridor home">
+ <svg viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
+ <circle cx="20" cy="20" r="18" fill="none" stroke="#c9a96e" stroke-width="1.5"/>
+ <path d="M6 22 L34 18" stroke="#c9a96e" stroke-width="1.5" fill="none"/>
+ <circle cx="13" cy="21" r="1.5" fill="#c9a96e"/>
+ <circle cx="20" cy="20.5" r="1.5" fill="#c9a96e"/>
+ <circle cx="27" cy="19.5" r="1.5" fill="#c9a96e"/>
+ </svg>
+ <span>Ventura Corridor</span>
+ </a>
+ <button class="hamburger" aria-label="Menu">≡</button>
+</header>
+
+<main id="root">
+ <div class="empty"><h2>Loading…</h2></div>
+</main>
+
+<script>
+const TIER_COPY = {
+ // Default marketing copy when tier_pricing.marketing_copy JSONB is null —
+ // generic-but-honest fallback per (tier) name.
+ basic: { tagline: "Always free. The default listing from public-records data.", bullets: ["Name, address, phone","Auto-updated from OpenStreetMap","Standard sort + browse"] },
+ featured: { tagline: "Stand out · logo, photos, boosted placement.", bullets: ["Logo + up to 5 photos","Boosted in browse + search","Featured ribbon on the card","Category tags + amenities"] },
+ spotlight: { tagline: "Premium · video, reservations, priority everywhere.", bullets: ["Everything in Featured","Video embed or chef bio","Reservation / booking link","Priority placement in search","Weekly nearby-user email digest","Promo offer slot"] },
+ verified: { tagline: "Verified · State Bar # + practice areas + intake form.", bullets: ["State Bar number on card","Up to 5 practice areas with descriptions","Consultation request form","Verified badge"] },
+};
+
+function $(id) { return document.getElementById(id); }
+function esc(s) { return String(s||'').replace(/[&<>"]/g, c => ({'&':'&','<':'<','>':'>','"':'"'}[c])); }
+function dollars(cents) { return cents === 0 ? 'Free' : '$' + (cents/100).toFixed(0); }
+
+const bizId = parseInt(location.pathname.split('/').pop(), 10);
+
+async function load() {
+ const r = await fetch('/api/upgrade/' + bizId);
+ if (!r.ok) {
+ $('root').innerHTML = '<div class="empty"><h2>Business not found</h2><p>The listing for ID ' + bizId + ' doesn\\'t exist in the directory. <a href="/" style="color:var(--gold)">← back</a></p></div>';
+ return;
+ }
+ const j = await r.json();
+ if (!j.ok) { $('root').innerHTML = '<div class="empty"><h2>Error</h2><p>' + esc(j.error || '') + '</p></div>'; return; }
+ render(j.business, j.tiers);
+}
+
+function render(biz, tiers) {
+ if (!tiers.length) {
+ $('root').innerHTML = `<div class="empty"><h2>${esc(biz.name)}</h2><p>This category (<code>${esc(biz.category||'')}</code>) doesn't have a tier ladder yet. Email <a href="mailto:steve@designerwallcoverings.com" style="color:var(--gold)">steve@designerwallcoverings.com</a> if you want one.</p></div>`;
+ return;
+ }
+ const currentTier = biz.tier || 'basic';
+ $('root').innerHTML = `
+ <div class="biz">
+ <div class="eyebrow">Listing upgrade</div>
+ <h1>${esc(biz.name)}</h1>
+ <div class="meta">
+ <span>${esc(biz.category||'')}</span>
+ ${biz.address ? `<span>📍 ${esc(biz.address)}</span>` : ''}
+ ${biz.website ? `<span><a href="${esc(biz.website)}" target="_blank" rel="noopener" style="color:var(--gold);text-decoration:none">${esc(biz.website.replace(/^https?:\\/\\//,''))} ↗</a></span>` : ''}
+ </div>
+ </div>
+ <div class="tiers">
+ ${tiers.map(t => {
+ const isCurrent = t.tier === currentTier;
+ const copy = (t.marketing_copy && typeof t.marketing_copy === 'object') ? t.marketing_copy : TIER_COPY[t.tier] || {};
+ const bullets = copy.bullets || TIER_COPY[t.tier]?.bullets || [];
+ const featured = t.tier === 'featured' || t.tier === 'verified';
+ const spotlight = t.tier === 'spotlight';
+ return `
+ <article class="tier ${featured?'featured':''} ${spotlight?'spotlight':''}">
+ <h3 class="name">${t.tier === 'basic' ? 'Basic' : t.tier === 'spotlight' ? '<em>'+esc(t.display_name||'Spotlight')+'</em>' : esc(t.display_name||t.tier)}</h3>
+ <p class="price">${dollars(t.price_cents)}<small>${t.price_cents > 0 ? '/ month' : 'forever'}</small></p>
+ <p class="desc">${esc(copy.tagline || copy.subtitle || TIER_COPY[t.tier]?.tagline || '')}</p>
+ <ul>${bullets.map(b => '<li>' + esc(b) + '</li>').join('')}</ul>
+ ${isCurrent
+ ? '<div class="current">✓ Your current tier</div>'
+ : t.tier === 'basic'
+ ? '<button class="cta" disabled>Already on Basic</button>'
+ : `<button class="cta" data-tier="${esc(t.tier)}" data-price="${t.price_cents}">${spotlight ? 'Get on the list' : 'Notify me when this opens'}</button>`}
+ </article>
+ `;
+ }).join('')}
+ </div>
+ <form class="intent-form" id="intent-form">
+ <h3>Get notified when <span id="intent-tier-label">this tier</span> opens for ${esc(biz.name)}</h3>
+ <p>We're finishing payment integration. Drop your email and we'll reach out the day you can sign up. No spam, no upsells you didn't ask for.</p>
+ <div class="row">
+ <div>
+ <label class="label">Your email</label>
+ <input type="email" name="email" required placeholder="you@${esc((biz.website||'thebusiness.com').replace(/^https?:\\/\\/(www\\.)?/,'').split('/')[0])}">
+ </div>
+ <div>
+ <label class="label">Your name (optional)</label>
+ <input type="text" name="name" placeholder="Steve Owner">
+ </div>
+ <div>
+ <label class="label">Anything to add? (optional)</label>
+ <textarea name="notes" rows="2" placeholder="e.g. We want to highlight our patio dining + sunset hours."></textarea>
+ </div>
+ </div>
+ <div class="actions">
+ <button type="button" id="intent-cancel">Cancel</button>
+ <button type="submit">Notify me →</button>
+ </div>
+ <div id="intent-result"></div>
+ </form>
+ `;
+
+ // Wire CTAs
+ document.querySelectorAll('.cta[data-tier]').forEach(btn => {
+ btn.addEventListener('click', () => {
+ const tier = btn.dataset.tier;
+ $('intent-tier-label').textContent = tier.charAt(0).toUpperCase() + tier.slice(1);
+ $('intent-form').classList.add('show');
+ $('intent-form').dataset.tier = tier;
+ $('intent-form').scrollIntoView({ behavior: 'smooth', block: 'center' });
+ });
+ });
+ $('intent-cancel').addEventListener('click', () => $('intent-form').classList.remove('show'));
+ $('intent-form').addEventListener('submit', async e => {
+ e.preventDefault();
+ const form = e.target;
+ const tier = form.dataset.tier;
+ const fd = new FormData(form);
+ const body = { tier, email: fd.get('email'), name: fd.get('name'), notes: fd.get('notes') };
+ form.querySelector('button[type=submit]').disabled = true;
+ try {
+ const r = await fetch('/api/upgrade/' + bizId + '/intent', {
+ method:'POST', headers:{'Content-Type':'application/json'},
+ body: JSON.stringify(body),
+ });
+ const j = await r.json();
+ $('intent-result').innerHTML = j.ok
+ ? '<div class="toast ok">✓ Got it. We\\'ll email <b>'+esc(body.email)+'</b> the moment <b>'+esc(tier)+'</b> opens for '+esc(biz.name)+'.</div>'
+ : '<div class="toast err">✕ '+esc(j.error || 'failed')+'</div>';
+ if (j.ok) form.reset();
+ } catch (err) {
+ $('intent-result').innerHTML = '<div class="toast err">✕ '+esc(err.message)+'</div>';
+ } finally {
+ form.querySelector('button[type=submit]').disabled = false;
+ }
+ });
+}
+
+load();
+</script>
+</body>
+</html>
diff --git a/src/server/index.ts b/src/server/index.ts
index 7c640f2..91d3ba5 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -255,6 +255,48 @@ app.get('/api/businesses', async (req, res) => {
}
});
+// ─── Tier upgrade — per-business pricing comparison + upgrade intent ───
+// Public, no admin gate. /upgrade/:bizId is a tier ladder for a single
+// business; reads from tier_pricing (seeded by build-virtual-gallery.sh).
+app.get('/api/upgrade/:bizId', async (req, res) => {
+ const bizId = parseInt(String(req.params.bizId), 10);
+ if (!Number.isInteger(bizId)) return res.status(400).json({ ok:false, error:'bad bizId' });
+ try {
+ const biz = await query<any>(`
+ SELECT id, name, category, category_naics, address, city, lat, lng, website, tier
+ FROM businesses WHERE id = $1 LIMIT 1`, [bizId]);
+ if (!biz.rows.length) return res.status(404).json({ ok:false, error:'business not found' });
+ const tiers = await query<any>(`
+ SELECT category, tier, display_name, price_cents, marketing_copy
+ FROM tier_pricing WHERE category = $1 ORDER BY price_cents ASC`,
+ [biz.rows[0].category]);
+ res.json({ ok:true, business: biz.rows[0], tiers: tiers.rows });
+ } catch (e:any) { res.status(500).json({ ok:false, error: e.message }); }
+});
+
+app.post('/api/upgrade/:bizId/intent', async (req, res) => {
+ const bizId = parseInt(String(req.params.bizId), 10);
+ const { tier, email, name, notes } = req.body || {};
+ if (!Number.isInteger(bizId) || !tier || !email) {
+ return res.status(400).json({ ok:false, error:'bizId + tier + email required' });
+ }
+ try {
+ const r = await query<any>(`
+ INSERT INTO upgrade_intents (business_id, requested_tier, contact_email, contact_name, notes, ip_addr)
+ VALUES ($1, $2, $3, $4, $5, $6) RETURNING id, created_at`,
+ [bizId, tier, email, name || null, notes || null,
+ req.headers['x-forwarded-for'] || req.socket.remoteAddress || null]);
+ res.json({ ok:true, intent: r.rows[0] });
+ } catch (e:any) { res.status(500).json({ ok:false, error: e.message }); }
+});
+
+// SSR-ish: route /upgrade/:bizId to the upgrade.html shell — the page reads
+// bizId from window.location.pathname and hydrates via /api/upgrade/:bizId.
+app.get('/upgrade/:bizId([0-9]+)', (req, res) => {
+ const here = path.dirname(fileURLToPath(import.meta.url));
+ res.sendFile(path.join(here, '..', '..', 'public', 'upgrade.html'));
+});
+
// ─── Blvd Gallery — virtual art walk along Ventura Blvd ──────────────
// One imagined piece of art per business, generated overnight by qwen3:14b.
// East (Encino, position_pct=0) → West (Studio City, position_pct=100).
← e648a17 ventura-corridor: add /marketplace.html local listings board
·
back to Ventura Corridor
·
YOLO tick 6: qwen3 fills tier marketing_copy + /admin/upgrad cf9f180 →