Business launch management platform
Sign In
Create Account
((s,c) => s+(c.amount_paid||0), 0) const paying = all.filter(c => c.amount_paid > 0) const avgDeal = paying.length ? Math.round(totalRev / paying.length) : 0 const now = new Date() const thisMonth = all.filter(c => { const d=new Date(c.created_at); return d.getFullYear()===now.getFullYear()&&d.getMonth()===now.getMonth() }).reduce((s,c) => s+(c.amount_paid||0), 0) const months = Array.from({length:6}, (_,i) => { const d = new Date(now.getFullYear(), now.getMonth()-5+i, 1) return { label: d.toLocaleString('default',{month:'short'}), year: d.getFullYear(), month: d.getMonth(), rev: 0 } }) for (const c of all) { const d = new Date(c.created_at) const m = months.find(x => x.year===d.getFullYear() && x.month===d.getMonth()) if (m) m.rev += (c.amount_paid||0) } const maxRev = Math.max(...months.map(m => m.rev), 1) const byType = {diy:0, dfy:0, marketing:0} for (const c of all) if (c.service_type && byType[c.service_type]!==undefined) byType[c.service_type] += (c.amount_paid||0) const maxType = Math.max(...Object.values(byType), 1) el.innerHTML = `
Total Revenue
$${totalRev.toLocaleString()}
${all.length} total clients
This Month
$${thisMonth.toLocaleString()}
${now.toLocaleString('default',{month:'long',year:'numeric'})}
Avg Deal Size
$${avgDeal.toLocaleString()}
Per paying client
Launched
${all.filter(c=>['launched','retainer'].includes(c.stage)).length}
Businesses live
Monthly Revenue — Last 6 Months
${months.map(m => { const pct = (m.rev/maxRev)*100 const lbl = m.rev>=1000 ? '$'+(m.rev/1000).toFixed(1)+'k' : m.rev ? '$'+m.rev : '' return `
${lbl}
` }).join('')}
${months.map(m=>`
${m.label}
`).join('')}
Revenue by Service Type
${Object.entries(byType).map(([type,rev]) => `
${type.toUpperCase()}
$${rev.toLocaleString()}
`).join('')}
` } // ══════════════════════════════════════════════════════ // GLOBAL SEARCH (Cmd+K / Ctrl+K) // ══════════════════════════════════════════════════════ function openSearch() { document.getElementById('searchOverlay').classList.add('open') document.getElementById('globalSearchInput').value = '' document.getElementById('searchResults').innerHTML = '
Start typing to search all clients
' setTimeout(() => document.getElementById('globalSearchInput').focus(), 50) } function closeSearch() { document.getElementById('searchOverlay').classList.remove('open') } function filterSearch(q) { const res = document.getElementById('searchResults') if (!q.trim()) { res.innerHTML = '
Start typing to search all clients
'; return } const lq = q.toLowerCase() const matches = allClients.filter(c => c.name.toLowerCase().includes(lq) || (c.email||'').toLowerCase().includes(lq) || (c.business_name||'').toLowerCase().includes(lq) || (c.business_type||'').toLowerCase().includes(lq) ) if (!matches.length) { res.innerHTML = '
No clients found
'; return } res.innerHTML = `
${matches.map(c => `
${initials(c.name)}
${escHtml(c.name)}
${escHtml(c.business_name||c.business_type||'—')} · ${c.service_type?.toUpperCase()||'—'}
${c.stage}
`).join('')}
` } // ══════════════════════════════════════════════════════ // KEYBOARD SHORTCUTS // ══════════════════════════════════════════════════════ document.addEventListener('keydown', e => { if (e.key === 'Escape') { closeModal(); closeSearch() } if ((e.metaKey||e.ctrlKey) && e.key === 'k') { e.preventDefault(); openSearch() } }) // ══════════════════════════════════════════════════════ // BOOT // ══════════════════════════════════════════════════════ init()