diff --git a/MainApp.tsx b/MainApp.tsx index bd5e995..664af13 100644 --- a/MainApp.tsx +++ b/MainApp.tsx @@ -10,6 +10,7 @@ import { Login } from './components/Login'; import { AnalysisResult, InvoiceItem, ProcessingStatus, SavedInvoice, Product, UserRole } from './types'; import { analyzeInvoiceImage } from './services/geminiService'; import { getAllGlCodes } from './services/glCodeService'; +import { DEMO_BOOKING_URL } from './src/siteConfig'; import { GLCode } from './types'; import { saveInvoiceToHistory, checkForDuplicate, getSavedInvoices } from './services/storageService'; import { saveNewProduct, migrateLocalProductsToDb } from './services/productService'; @@ -1129,7 +1130,9 @@ const App: React.FC = () => { Upgrade → diff --git a/components/Login.tsx b/components/Login.tsx index 9d2f048..0e4afba 100644 --- a/components/Login.tsx +++ b/components/Login.tsx @@ -3,6 +3,7 @@ import { ChefHat, Lock, User, Mail, CheckCircle2, Loader2, ArrowLeft, UserPlus, import { UserRole } from '../types'; import { signIn, signUp, getUserRole, Plan } from '../services/authService'; import { supabase } from '../services/supabaseClient'; +import { DEMO_BOOKING_URL } from '../src/siteConfig'; interface LoginProps { onLogin: (role: UserRole) => void; @@ -438,7 +439,7 @@ export const Login: React.FC = ({ onLogin }) => {

Unlimited locations + SSO + EDI

-
+ Book a Demo → diff --git a/index.html b/index.html index 74957b4..67e2f00 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,31 @@ ChefCode.ai — AI Invoice Coding + + + + + + + + + + + + + + + + + + + + + diff --git a/package.json b/package.json index d8f741b..555dba6 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,10 @@ "type": "module", "scripts": { "dev": "vite", - "build": "vite build && node scripts/check-build-secrets.mjs", + "build": "vite build && node scripts/check-build-secrets.mjs && node scripts/check-cta-links.mjs", "check:secrets": "node scripts/check-build-secrets.mjs", - "preview": "vite preview" + "preview": "vite preview", + "check:ctas": "node scripts/check-cta-links.mjs" }, "dependencies": { "@google/genai": "^1.41.0", diff --git a/public/og-image.png b/public/og-image.png new file mode 100644 index 0000000..61a110f Binary files /dev/null and b/public/og-image.png differ diff --git a/scripts/check-cta-links.mjs b/scripts/check-cta-links.mjs new file mode 100644 index 0000000..f7ef91b --- /dev/null +++ b/scripts/check-cta-links.mjs @@ -0,0 +1,60 @@ +// Build-time CTA gate. Fails the build if a "Book a Demo" button would ship +// pointing at somewhere nobody reads. Runs after `vite build` — see +// package.json "build". Companion to check-build-secrets.mjs. +// +// Why this exists: the demo buttons spent months pointing at +// sales@chefcode.ai, a domain that was never registered. Every enterprise and +// trial-upgrade lead bounced silently — nothing failed, nothing logged, the +// mail just went nowhere. A dead CTA is invisible in testing, so it gets +// caught here instead. + +import { readFileSync, readdirSync, statSync } from 'node:fs'; +import { join } from 'node:path'; + +const DIST = 'dist'; + +// [pattern, what the person should do about it] +const BAD = [ + [/REPLACE_ME/, 'The demo booking link is still the placeholder. Open src/siteConfig.ts and set DEMO_BOOKING_URL to your real Cal.com or Calendly URL (the full https:// address).'], + [/mailto:[^"'\s]*@chefcode\.ai/, 'A button still points at an @chefcode.ai address. That domain is not registered, so the mail goes nowhere. Point it at DEMO_BOOKING_URL in src/siteConfig.ts instead.'], +]; + +function walk(dir) { + const out = []; + for (const name of readdirSync(dir)) { + const p = join(dir, name); + if (statSync(p).isDirectory()) out.push(...walk(p)); + else if (/\.(js|mjs|cjs|html)$/.test(name)) out.push(p); + } + return out; +} + +let files; +try { + files = walk(DIST); +} catch { + console.log('[check-cta-links] no dist/ dir — skipping.'); + process.exit(0); +} + +const problems = new Map(); // advice -> Set(files) +for (const file of files) { + const text = readFileSync(file, 'utf8'); + for (const [re, advice] of BAD) { + if (re.test(text)) { + if (!problems.has(advice)) problems.set(advice, new Set()); + problems.get(advice).add(file); + } + } +} + +if (problems.size) { + console.error('\n\x1b[31m✗ BUILD BLOCKED — a "Book a Demo" button would go nowhere.\x1b[0m\n'); + for (const [advice, fileSet] of problems) { + console.error(' ' + advice); + console.error(' found in: ' + [...fileSet].join(', ') + '\n'); + } + process.exit(1); +} + +console.log('[check-cta-links] OK — every demo CTA points at a real destination.'); diff --git a/src/components/landing/FinalCTA.tsx b/src/components/landing/FinalCTA.tsx index 59a63c8..f42e724 100644 --- a/src/components/landing/FinalCTA.tsx +++ b/src/components/landing/FinalCTA.tsx @@ -1,5 +1,6 @@ import { ArrowRight, Zap } from 'lucide-react'; import { useReveal } from '../../hooks/useReveal'; +import { DEMO_BOOKING_URL } from '../../siteConfig'; export default function FinalCTA() { const ref = useReveal(); @@ -37,10 +38,12 @@ export default function FinalCTA() { - Book a 15-Min Demo + Book a 30-Min Demo diff --git a/src/components/landing/Pricing.tsx b/src/components/landing/Pricing.tsx index 1459fdc..faa5d38 100644 --- a/src/components/landing/Pricing.tsx +++ b/src/components/landing/Pricing.tsx @@ -1,6 +1,7 @@ import { useState } from 'react'; import { Check, Star } from 'lucide-react'; import { useReveal } from '../../hooks/useReveal'; +import { DEMO_BOOKING_URL } from '../../siteConfig'; const plans = [ { @@ -26,7 +27,7 @@ const plans = [ price: { monthly: null, yearly: null }, desc: 'For university systems and hotel chains.', cta: 'Book a Demo', - href: 'mailto:sales@chefcode.ai?subject=Enterprise%20Demo%20Request', + href: DEMO_BOOKING_URL, featured: false, items: ['Unlimited locations', 'Unlimited team members', 'Unlimited invoices', 'Everything in Professional', 'SSO / SAML integration', 'API access', 'Vendor EDI connections', 'Dedicated account manager', 'Custom onboarding'], }, @@ -92,6 +93,9 @@ export default function Pricing() {