AI-powered revenue optimization platform with intelligent voice calling and real-time analytics
An intelligent B2B revenue optimization platform that:
- 📊 Tracks user behavior on your e-commerce site in real-time
- 🤖 Uses Claude AI to decide when to intervene with at-risk customers
- 📞 Makes realistic voice calls via Vapi with natural-sounding AI agents
- 💬 AI Chat Interface powered by Claude for instant business insights
- 📈 Beautiful dashboards with real-time metrics and analytics
- Node.js 18+
- API Keys: Vapi, Anthropic Claude, OpenAI
git clone https://github.com/a-khandel/calhacks-demo.git
cd calhacks-demo
npm install
cd frontend02 && npm install && cd ..
cd dummy_website && npm install && cd ..cp .env.example .env
# Add your API keys to .env# Terminal 1 - Backend
node src/index.js
# Terminal 2 - Dashboard
cd frontend02 && npm run dev
# Terminal 3 - Demo E-commerce Site
cd dummy_website && npm run dev📖 Full Setup Guide: docs/setup/QUICKSTART.md
calhacks-demo/
├── 📂 src/ # Backend (Node.js + Express)
│ ├── index.js # Main server
│ ├── services/
│ │ ├── aiChatService.js # Claude AI chat integration
│ │ ├── claudeService.js # AI decision engine
│ │ ├── vapiService.js # Voice calling via Vapi
│ │ ├── engagementDetector.js # User behavior analysis
│ │ └── metricsAggregator.js # Real-time analytics
│ └── config/
│ └── vapi.config.js # Voice agent configuration
│
├── 📂 frontend02/ # Main Dashboard (React + Vite)
│ ├── src/
│ │ ├── components/
│ │ │ └── app/
│ │ │ ├── AIChatPanel.tsx # Claude AI chat interface
│ │ │ └── EngagementMonitor.tsx # User monitoring
│ │ └── contexts/
│ │ └── MetricsContext.tsx # Real-time metrics
│ └── package.json
│
├── 📂 dummy_website/ # Demo E-commerce Site (React + Vite)
│ ├── src/
│ │ ├── services/
│ │ │ └── analyticsTracker.js # Sends metrics to backend
│ │ └── pages/ # E-commerce pages
│ └── package.json
│
├── 📂 docs/ # Documentation
│ ├── deployment/ # Deployment guides
│ │ ├── QUICK_DEPLOY.md # 15-min deploy guide
│ │ ├── DEPLOYMENT.md # Full deployment docs
│ │ └── GITHUB_SETUP.md # GitHub setup
│ ├── setup/ # Setup instructions
│ │ ├── QUICKSTART.md # Quick start guide
│ │ └── SETUP_INSTRUCTIONS.md # Detailed setup
│ ├── guides/ # Feature guides
│ │ ├── DEMO_GUIDE.md # How to demo the app
│ │ └── AUTO_CALL_TRIGGER_GUIDE.md
│ ├── technical/ # Technical docs
│ └── PROJECT_STRUCTURE.md # Architecture details
│
├── 📂 scripts/ # Utility scripts
│ ├── START_BACKEND.sh # Quick backend starter
│ └── test-quick.js # Test script
│
├── 📂 config/ # Configuration files
│ └── railway.json # Railway deployment config
│
├── .env.example # Environment variables template
├── package.json # Backend dependencies
└── README.md # This file
- Monitors user behavior on e-commerce site
- Tracks cart actions, page views, engagement
- Detects abandonment patterns
- Claude AI analyzes user behavior
- Intelligent intervention timing
- Personalized outreach strategies
- Natural-sounding AI agent (Sarah)
- Office background sounds for realism
- Context-aware conversation scripts
- Handles objections and questions
- Ask questions about your data
- Get instant insights and visualizations
- Generate charts automatically
- Save graphs to dashboard
- Real-time metrics visualization
- User engagement monitoring
- Executive dashboard with custom widgets
- Backend → Deploy to Railway
- Frontend Dashboard → Deploy to Vercel
- Demo Site → Deploy to Vercel (separate project)
📖 Step-by-Step: docs/deployment/QUICK_DEPLOY.md
- Railway: FREE ($5 credits)
- Vercel: FREE (unlimited for personal projects)
- Quick Start Guide - Get running in 5 minutes
- Setup Instructions - Detailed setup
- Demo Guide - How to demo the platform
- Quick Deploy (15 min) - Fast deployment
- Full Deployment Guide - All options
- GitHub Setup - Repository setup
- Project Structure - Architecture details
- Frontend Integration - Frontend docs
- What's New - Recent updates
- Runtime: Node.js + Express
- AI: Claude 3.5 Sonnet (Anthropic)
- Voice: Vapi.ai + ElevenLabs + OpenAI GPT-4
- Real-time: WebSocket-like polling
- Framework: React + TypeScript + Vite
- UI: Tailwind CSS + Radix UI + shadcn/ui
- Charts: Recharts
- State: React Context API
- Backend: Railway
- Frontend: Vercel
- Demo Site: Vercel
┌─────────────────────────────────────────────────────────┐
│ 1. User browses demo e-commerce site │
│ - Adds items to cart │
│ - Removes items (showing hesitation) │
└─────────────┬───────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ 2. Analytics tracker sends metrics to backend │
│ - Cart actions, page views, engagement │
└─────────────┬───────────────────────────────��───────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ 3. Backend analyzes behavior with Claude AI │
│ - Detects 3rd cart removal = critical risk │
│ - AI decides: "Call now!" │
└─────────────┬───────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ 4. Vapi makes realistic voice call │
│ - Natural AI agent with office background sounds │
│ - Personalized script based on user behavior │
│ - Offers help, discount, or assistance │
└─────────────┬───────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ 5. Dashboard shows everything in real-time │
│ - User metrics, call status, engagement trends │
│ - AI chat for instant insights │
└─────────────────────────────────────────────────────────┘
# Vapi (Voice Calling)
VAPI_API_KEY=your_vapi_api_key
VAPI_PHONE_NUMBER_ID=your_phone_number_id
DEFAULT_CALL_NUMBER=+1234567890
# Anthropic Claude (AI)
CLAUDE_API_KEY=your_claude_api_key
# OpenAI (used by Vapi)
OPENAI_API_KEY=your_openai_api_key
# Server
PORT=3001
NODE_ENV=development
COMPANY_NAME=YourCompanyGet API keys:
- Vapi: https://vapi.ai
- Claude: https://console.anthropic.com
- OpenAI: https://platform.openai.com
- Visit demo e-commerce site: http://localhost:5173
- Add items to cart
- Remove items from cart 3 times
- Check backend console - should see:
🚨 THIRD CART REMOVAL DETECTED - Voice call will be initiated!
📖 Full Test Guide: docs/guides/TEST_AUTO_TRIGGER.md
This is a CalHacks demo project. Feel free to fork and experiment!
MIT
- Repository: https://github.com/a-khandel/calhacks-demo
- Deployment Guides: docs/deployment/
- Technical Docs: docs/technical/
Built for CalHacks 🎉