Server-rendered Next.js — no database keys ever reach the browser
All Supabase access lives in 28 API routes. The public site and this dashboard share one database, cleanly separated.
Every visit, lead, ad dirham and phone call from irfaninvest.com — captured, analysed and acted on automatically. Marketing analytics, an AI voice agent and lead operations in one password-gated dashboard.
irfanapp is the server-rendered Next.js companion to irfaninvest.com. It ingests marketing data from Google, lead data from the website, and voice data from the AI call agent — then turns them into decisions: who to call, what to say, and which campaign is paying for itself.
GA4 traffic, Google Ads spend and campaign performance unified in one view — synced from n8n every 30 minutes.
Website forms and the AI chat flow straight into Supabase and Google Sheets, deduplicated and scored automatically.
"Sam" calls every new lead within 2 minutes via Vapi + Twilio, books consultations and records full transcripts.
Claude analyses every call and lead: buyer persona, sentiment, objections and a recommended closing strategy — 17 signals per conversation.
All Supabase access lives in 28 API routes. The public site and this dashboard share one database, cleanly separated.
A 30-minute pipeline syncs GA4, Ads, forms and AI conversations; a 2-minute watcher auto-calls brand-new leads.
Every page and data API sits behind an httpOnly signed cookie; Supabase RLS blocks anonymous access to content tables.
Vapi posts the end-of-call report to n8n, which writes the transcript, psychology profile and call record to two report sheets and this dashboard.
A visitor submits a form on irfaninvest.com → a Supabase edge function stores the lead and mirrors it to Google Sheets → n8n picks it up, and the dashboard shows it within 30 minutes (voice-eligible leads are called within 2).
Claude (Anthropic) runs the voice agent "Sam", the post-call psychology analysis and the AI Insights tab. GPT-4o-mini handles lead qualification inside n8n.
Vapi sends the end-of-call report to n8n: the lead status updates in the dashboard, the call record lands in the report-after-call sheet, and the transcript plus 17-field buyer-psychology profile lands in the conversation sheet.
A shared password issues a 30-day HMAC-signed httpOnly cookie; the Next.js proxy gates every page and data API. Machines (n8n) authenticate with a separate header secret. Supabase RLS protects the shared tables.
Same Supabase project, same Peyda brand font, same lead schema. The site writes leads; this app reads, scores, calls and reports on them — nothing is duplicated.
GA4, Google Ads, form leads and AI conversations sync every 30 minutes. New-lead auto-calling runs every 2 minutes. A public /api/health probe reports database latency live.