Project Info
Inspiration
Kyle recently took part in a campaign as a phone banker and made many calls to both appreciative and unappreciative New Yorkers. During this time, he noticed a gap that nobody was filling. How do we support those grassroots volunteers, helping them prepare for difficult yet important personal questions while providing a scalable and cost-effective solution for campaigns.
What it does
Grassroots is a personalized training tool for phone bankers utilizing versatile AI Voice Agents in order to mimic voters from all backgrounds and areas of the political landscape, including those in extremely unique scenarios. We've organized each voter's conversation type into easy, medium, and hard level,s allowing the user to progress with confidence. You can start talking to a specific voter, and repeatedly practice until you It classifies each voter's conversation into easy, medium, and hard, allowing the user to climb up with confidence. You can start talking to a voter profile and practice until you are ready to move forward. After your conversation, we show you your call transcription so that you can better reflect on your experience. This is then stored in our backend and is accessible by Poke using an MCP server integration, where it can rate, evaluate, and recommend improvements.
How we built it
We utilized a NextJS (Frontend), Supabase (Backend + Auth), Google Gemini (LLM), ElevenLabs (Voices), VAPI (Voice Agent Orchestration), Poke (MCP + Text).
Challenges we ran into
Pivoted away from utilizing SNAP AR. Had to deal with bad wifi.
Accomplishments we're proud of
We created a fullstack app with MCP integrations.
What we learned
We learned how to utilize MCP integrations.
What's next
We will continue to improve our infrastructure.
CalHacks: Grassroots Training Platform
Master the Art of Political Phone Banking with AI-Powered Training
A comprehensive training platform that combines realistic voter simulations with advanced performance analytics to help political volunteers excel at phone banking. Built for CalHacks, this project features both a Next.js training application and an MCP server for AI-powered call analysis.
๐ฏ Project Overview
The Grassroots Training Platform is a LeetCode-style training system for political phone banking volunteers. It provides:
- Realistic AI-powered voter simulations using voice agents
- Progressive difficulty levels (Easy โ Medium โ Hard)
- Comprehensive performance analytics with detailed feedback
- Progress tracking and improvement insights
- AI-powered call analysis via MCP server integration
๐๏ธ Architecture
This project consists of two main components:
1. Training Application (phone-banker-training/)
A Next.js web application that provides the core training experience.
2. MCP Server (phone-banker-mcp-server/)
A Model Context Protocol server that exposes call data to AI assistants for advanced analysis.
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
โ Training App โ โ MCP Server โ
โ (Next.js) โ โ (Node.js/Express) โ
โ โ โ โ
โ โข Voter Profiles โ โ โข Call Analytics โ
โ โข Voice Calls โ โ โข Transcripts โ
โ โข Performance UI โ โ โข Recordings โ
โ โข Progress Tracking โ โ โข AI Integration โ
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโ
โ External Services โ
โ โ
โ โข Vapi (Voice AI) โ
โ โข Supabase (DB) โ
โ โข Claude/Poke (AI) โ
โโโโโโโโโโโโโโโโโโโโโโโ
๐ Quick Start
Option 1: Explore the Training App (5 minutes)
cd phone-banker-training
npm install
npm run dev
Open http://localhost:3000 to explore the UI and voter profiles.
Option 2: Full Setup with Voice Calls (15 minutes)
-
Set up external services:
- Create a Vapi account for voice AI
- Create a Supabase project for data storage
-
Configure environment:
cd phone-banker-training cp .env.example .env.local # Add your Vapi and Supabase credentials -
Set up database:
- Run the SQL from
DATABASE_SCHEMA.sqlin your Supabase SQL Editor
- Run the SQL from
-
Start the application:
npm run dev -
Make your first call:
- Click "Start Training"
- Select "Working Mom - Queens" (Easy difficulty)
- Allow microphone access
- Start practicing!
๐ฎ Features
Training Application
- ๐ฃ๏ธ Realistic Voter Simulations: 7 pre-configured voter personas across NYC boroughs
- ๐ Three Difficulty Levels:
- Easy: Supportive voters (Working Mom, Small Business Owner, Retired Senior)
- Medium: Persuasion-focused voters (Tech Worker, New Immigrant Family)
- Hard: Skeptical voters (Disillusioned Democrat, Conservative Independent)
- ๐ Performance Analytics: Detailed scoring on:
- Confidence, Enthusiasm, Clarity
- Persuasiveness, Empathy
- ๐ Real-time Transcription: Review conversation transcripts
- ๐ Progress Tracking: Monitor improvement over time
MCP Server
- ๐ List Call Sessions: Get recent training calls with metadata
- ๐ Get Call Details: Fetch complete transcripts and performance metrics
- ๐ต Get Call Recordings: Retrieve Vapi recording URLs for audio analysis
- ๐ Get User Progress: View aggregate statistics and progress tracking
๐ ๏ธ Tech Stack
Training Application
- Frontend: Next.js 16, React 19, TypeScript
- Styling: Tailwind CSS
- Voice AI: Vapi AI SDK
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth
MCP Server
- Runtime: Node.js with TypeScript
- Framework: Express.js
- Protocol: Model Context Protocol (MCP)
- Database: Supabase client
- Deployment: Google Cloud Run
๐ Project Structure
CalHacks/
โโโ phone-banker-training/ # Main training application
โ โโโ app/ # Next.js App Router pages
โ โ โโโ page.tsx # Landing page
โ โ โโโ dashboard/ # Voter profiles dashboard
โ โ โโโ practice/ # Call interface
โ โโโ components/ # React components
โ โ โโโ ui/ # Base UI components
โ โ โโโ CallInterface.tsx # Voice call interface
โ โ โโโ VoterProfileCard.tsx # Voter profile display
โ โ โโโ PerformanceReport.tsx # Analytics display
โ โโโ lib/ # Utility libraries
โ โ โโโ vapi.ts # Vapi AI integration
โ โ โโโ supabase.ts # Database client
โ โ โโโ voterProfiles.ts # Voter persona definitions
โ โ โโโ analytics.ts # Performance analysis
โ โโโ DATABASE_SCHEMA.sql # Database setup
โ
โโโ phone-banker-mcp-server/ # MCP server for AI analysis
โโโ src/
โ โโโ server-http.ts # HTTP server
โ โโโ tools/ # MCP tool implementations
โ โ โโโ list-call-sessions.ts
โ โ โโโ get-call-details.ts
โ โ โโโ get-call-recording.ts
โ โ โโโ get-user-progress.ts
โ โโโ utils/ # Utility modules
โ โโโ supabase-client.ts
โ โโโ vapi-client.ts
โโโ deploy.sh # Google Cloud Run deployment
๐ฃ๏ธ Voter Profiles
The platform includes 7 carefully crafted voter personas:
Easy Difficulty
- Working Mom - Queens: Practical, cost-of-living focused
- Small Business Owner - Brooklyn: Tax-concerned, community-minded
- Retired Senior - Staten Island: Traditional, values experience
Medium Difficulty
- Millennial Tech Worker - Manhattan: Progressive, questioning
- New Immigrant Family - Brooklyn/Queens: Family-focused, hopeful but guarded
Hard Difficulty
- Disillusioned Former Democrat - Bronx: Cynical, needs genuine engagement
- Independent Conservative - Staten Island: Traditional values, skeptical of progressive policies
๐ Performance Metrics
After each call, volunteers receive detailed feedback on:
- Confidence (0-100): Voice tone, certainty, delivery strength
- Enthusiasm (0-100): Energy level, passion for the campaign
- Clarity (0-100): Message organization, speaking pace
- Persuasiveness (0-100): Addressing concerns, making compelling arguments
- Empathy (0-100): Active listening, acknowledging voter concerns
Plus:
- Identified strengths and improvement areas
- Key conversation moments
- Overall sentiment analysis
- Transcript review
๐ง Configuration
Environment Variables
Training Application (.env.local):
# Supabase Configuration (Required)
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# Vapi Configuration (Optional - for voice calls)
NEXT_PUBLIC_VAPI_PUBLIC_KEY=your_vapi_public_key
MCP Server (.env):
# Supabase Configuration
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
# Vapi API Configuration
VAPI_API_KEY=your_vapi_server_api_key
# MCP Server Configuration
MCP_API_KEY=your_secure_api_key
PORT=8080
Adding Custom Voter Profiles
Edit phone-banker-training/lib/voterProfiles.ts:
{
id: "custom-voter",
name: "Your Custom Voter",
difficulty: "medium",
description: "Brief description",
age: "Age range",
location: "Borough/Area",
occupation: "Job",
income: "Income level",
votingHistory: "Voting pattern",
keyIssues: ["Issue 1", "Issue 2", "Issue 3"],
skepticism: "What makes them skeptical",
personality: "How they communicate"
}
๐ข Deployment
Training Application
Deploy to Vercel, Netlify, or any Next.js-compatible platform:
npm run build
npm start
MCP Server
Deploy to Google Cloud Run:
cd phone-banker-mcp-server
./deploy.sh
๐ค AI Integration
The MCP server enables AI assistants (like Claude via Poke) to analyze training calls:
{
"mcpServers": {
"grassroots-training": {
"url": "https://your-mcp-server.run.app",
"apiKey": "your-mcp-api-key",
"transport": "sse"
}
}
}
Once configured, you can ask Poke:
- "Show me my recent phone banking training calls"
- "Analyze the recording from my most recent training session"
- "What's my progress in phone banking training?"
๐ Training Tips
- Start Easy: Build confidence with supportive voters first
- Read Profiles Carefully: Understanding voter concerns is key
- Be Authentic: Voters respond better to genuine conversation
- Address Concerns: Don't ignore skepticism - acknowledge it
- Review Performance: Learn from each call's analytics
- Progress Gradually: Move to harder profiles as you improve
- Practice Regularly: Consistency builds skill
๐ Troubleshooting
Common Issues
Voice calls not working:
- Check browser console for Vapi errors
- Ensure microphone permissions are granted
- Verify Vapi public key is correctly set
- Try Chrome or Edge for best WebRTC support
Authentication issues:
- Verify Supabase credentials in
.env.local - Check that database schema is applied
- Ensure RLS policies are configured
MCP server connection issues:
- Verify API key matches in Poke configuration
- Check server logs for detailed error messages
- Ensure all environment variables are set
๐ Documentation
- Quick Start Guide - Get running in 10 minutes
- Authentication Setup - Complete auth configuration
- Database Schema - Database setup
- MCP Server README - Detailed MCP server docs
๐ค Contributing
This project was built for CalHacks and is open for educational purposes. Suggested improvements:
- Additional voter profiles for different demographics
- More sophisticated sentiment analysis
- Real-time coaching during calls
- Team leaderboards and competitions
- Integration with actual phone banking tools
๐ License
This project is open source and available for educational purposes.
๐ Support
For issues or questions:
- Check the Vapi documentation
- Review the Supabase documentation
- Consult the Next.js documentation
Built with โค๏ธ for CalHacks | Because every phone call makes a difference ๐๐ณ๏ธ
Analysis
View
Metric
- 15
- 6
- 5
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- ExpressIn code
- JavaScriptIn code
- Next.jsIn code
- ReactIn code
- SQLIn code
- SupabaseIn code
- Tailwind CSSIn code
- TypeScriptIn code
- PostgreSQLClaimed
- PythonClaimed
9 of 11 appear in the indexed code. 2 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
186 KB
Source files
45
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
Yatha04/CalHacks
64 files ยท 604 KB ยท @ 3935f19
Structure
Interface
18 files ยท 28%Screens, components and styles rendered to the user.
Application logic
14 files ยท 22%Domain rules, services and shared utilities.
Data & schema
2 files ยท 3%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here โ open the file browser to check anything the diagram implies.
Languages
- TypeScript68%
- Markdown27%
- SQL3%
- Shell1%
- CSS0%
- JavaScript0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
phone-banker-mcp-server/package.json
npm ยท 19- @modelcontextprotocol/sdk
- @supabase/supabase-js
- axios
- cors
- dotenv
- eventsource-parser
- express
- node-fetch
- zod
- +10 more
phone-banker-training/package.json
npm ยท 17- @supabase/supabase-js
- @vapi-ai/web
- clsx
- lenis
- lucide-react
- next
- react
- react-dom
- tailwind-merge
- +8 more
Declared in the repositoryโs manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This projectโs features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.