Event-Driven Multi-Tenant Ingestion Engine

Instant Inbound Leads.
Zero-Lag AI Qualification.

Captures web form submissions synchronously in < 500ms via Next.js Route Handlers, triggers async Supabase Edge Functions with Google Gemini AI, and dispatches immediate Telegram alerts to your sales team.

Event-Driven Architecture

Engineered for enterprise scale, data isolation with Row Level Security, and asynchronous decoupling.

1. Synchronous Ingestion

Next.js App Router POST handler validates agency API keys and stores raw payloads in raw_leads within 500ms.

2. Gemini 3.5 Flash AI

Database Webhook fires Supabase Edge Function to extract pain points, compute AI score (0-100), and classify hot/warm/spam leads.

3. Telegram Bot Alerts

Formatted Markdown alerts are instantly sent to the specific agency's Telegram group with full prospect context.

4. Secure RLS Dashboard

React Server Components fetch leads strictly matching auth.uid() = agency_id with exportable CSVs.