How bigc7292/eva_eva works
Project Type and Purpose
• This is a full-stack AI calling solution for real estate, built as a monorepo using Next.js (frontend) and a Node.js service (backend) with Supabase as the primary data store, VAPI for AI-powered voice interactions, and Twilio for telephony.
Main Components
a. Frontend (apps/frontend)
• Next.js 13 App Router serves UI pages (calls dashboard, analytics, scheduling, etc.)
• Next.js API routes handle:
– Call initiation & status endpoints
– Webhook endpoints for VAPI and Twilio events
– Analytics & metrics endpoints
• Supabase client for data CRUD
• Static assets & recordings (public/)
b. Backend Service (apps/backend)
• Node.js/Express (server.js) for batch scripts and advanced call handling
• Scripts folder for database setup, call simulation, webhook registration, testing
c. Database (Supabase)
• Hosted Postgres; schema under db/ and supabase/migrations/
• Tables for calls, leads, analytics views, meeting metrics
d. AI Voice Platform (VAPI)
• External REST API for AI-driven call conversations
• Webhook events posted to Next.js API
e. Telephony Provider (Twilio)
• Calls, SIP trunk logs, SMS
• Webhook events for call status delivered to Next.js API
f. “AI Mega-Brain” Knowledge Store
• Logical component representing combined data lake:
– Raw call audio
– Transcripts & AI insights
– Lead & audience profiles
– Content ideas & campaign metadata
– Historical analytics
Relationships & Data Flows
1. User interacts with Next.js UI → triggers REST/gRPC call to Next.js API
2. Next.js API → writes/reads Supabase (call records, user settings)
3. Next.js API → calls VAPI endpoints to initiate AI call
4. VAPI → rings Twilio phone number, Twilio → outbound call to lead
5. Twilio call events → webhook → Next.js API → updates Supabase
6. VAPI conversation events → webhook → Next.js API → persists transcript & metadata
7. Analytics module (UI) → queries Supabase views/functions
8. Backend service (optional) → runs batch scripts against Supabase or triggers calls via VAPI/Twilio for bulk operations
Architectural Patterns & Principles
• Monorepo (turbo.json) separates apps/ and shared packages/ui, config, tsconfig
• Frontend follows modular App Router & API-first pattern
• Backend service as thin microservice for heavy scripts
• Database‐as‐a‐service (Supabase) with SQL migrations & seed scripts
• Event-driven webhooks for real-time updates
• Clear separation of concerns: UI, API, data, external integrations