In an era of increasing political polarization, Bridge creates a space for meaningful dialogue across ideological divides. Our platform pairs users with opposing viewpoints for structured, video-based political debates enhanced by AI-powered features.
- Social media algorithms create echo chambers by showing only aligned content
- Controversial content dominates diverse perspectives
- No platforms exist for quick, structured political debates
- Users seeking genuine debate often encounter trolls or bad-faith actors
Bridge provides a structured environment where:
- Users are matched with those holding opposing political views
- AI ensures fact-based discussions with real-time analysis
- Turn-based speaking prevents chaos and promotes respect
- Video requirements humanize interactions and reduce toxicity
- Secure Signup/Login: Full Supabase integration with email verification
- Comprehensive Profiles: Username, email, age, full name with secure password requirements
- Political Spectrum Analysis: Detailed breakdown across 5 categories (Economic, Social, Foreign Policy, Governance, Cultural)
- 20-Question Quiz: Based on Pew Research Political Typology methodology
- Multi-Dimensional Scoring: Liberal-Conservative scale (-100 to +100) across multiple domains
- Persistent Data: Quiz results stored securely in Supabase database
- Smart Matching: Results drive our matchmaking algorithm
- Opposition-Based Pairing: Matches users with opposing political views (minimum 45-point ideological gap)
- Real-Time Queue: Socket.IO-powered waiting system with live status updates
- Topic Intelligence: AI analyzes user differences to select optimal debate topics
- Fallback Matching: Long-waiting users get prioritized after timeout threshold
6-Phase Timed System:
- Opening Statement - User 1 (30s)
- Opening Statement - User 2 (30s)
- Main Argument - User 1 (120s)
- Main Argument - User 2 (120s)
- Closing Statement - User 1 (60s)
- Closing Statement - User 2 (60s)
- Real-Time Fact-Checking: OpenAI GPT-4 analyzes political claims during debates
- Topic-Specific Facts: AI generates relevant supporting information for debate topics
- Sentiment Analysis: Monitors debate tone and emotional indicators
- Pre-Debate Briefing: AI-generated fact sheets provide context before debates start
- WebRTC Peer-to-Peer: High-quality video calling with Google STUN servers
- Turn-Based Controls: Automatic muting system enforces speaking order
- Volume Analysis: Real-time audio level monitoring and visualization
- Camera Enforcement: Video required during speaking turns to maintain civility
- Framework: Next.js 15.5.3 with App Router
- UI Library: React 19.1.0 with TypeScript
- Styling: Tailwind CSS 4 for responsive design
- State Management: Zustand for user data and session handling
- Real-Time: Socket.IO Client for live communication
- Runtime: Node.js with Express 5.1.0
- WebSocket: Socket.IO 4.8.1 for real-time features
- AI Integration: OpenAI GPT-4 for fact-checking and analysis
- Database: Supabase (PostgreSQL) for user data and authentication
- Video: WebRTC for peer-to-peer video calls
- Signaling: Socket.IO for WebRTC signaling and matchmaking
- Real-Time Updates: Live user counts, debate status, and queue management
- Node.js 18+ and npm
- Supabase account and project
- OpenAI API key
Backend (.env)
OPENAI_API_KEY=your_openai_api_key_here
PORT=3000
NODE_ENV=development
CORS_ORIGIN=*Frontend (.env.local)
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
NEXT_PUBLIC_SOCKET_URL=http://localhost:3000
NEXT_PUBLIC_OPENAI_API_KEY=your_openai_api_key_hereBackend Server
cd server
npm install
npm startFrontend Application
cd client/my-app
npm install
npm run dev- Frontend: http://localhost:3000
- Backend: http://localhost:3000 (configurable via PORT)
- Health Check: http://localhost:3000/health
- Landing Page โ Signup Form (Supabase authentication)
- Political Quiz โ Results & Spectrum Analysis
- Main Dashboard โ Matchmaking Queue
- Debate Room โ Structured Video Debate
- Quiz Complete: Direct access to matchmaking and debates
- Quiz Incomplete: Prompted to complete political assessment
- Account Management: Profile viewing and spectrum analysis
bridge/
โโโ client/my-app/ # Next.js frontend
โ โโโ src/app/ # App router structure
โ โ โโโ page.tsx # Dynamic landing page with matchmaking
โ โ โโโ signup/page.tsx # User registration
โ โ โโโ quiz/page.tsx # Political spectrum quiz
โ โ โโโ account/page.tsx # User profile
โ โ โโโ debate/page.tsx # Video debate interface
โ โ โโโ components/ # React components
โ โ โโโ QuizQuestion.tsx # Quiz interface
โ โ โโโ Video.tsx # Video components
โ โ โโโ ControlPanel.tsx # Debate controls
โ โ โโโ SpeechRecognition.tsx # AI transcription
โ โ โโโ FactCheckDisplay.tsx # AI fact-checking
โ โ โโโ SentimentAnalysis.tsx # AI sentiment tracking
โ โ โโโ PoliticalFacts.tsx # AI-generated facts
โ โโโ src/utils/
โ โ โโโ factCall.ts # OpenAI API integration
โ โ โโโ supabaseClient.ts # Database client
โ โโโ src/store/
โ โโโ useStore.ts # Zustand state management
โโโ server/ # Express + Socket.IO backend
โโโ server.js # Main server with matchmaking
โโโ services/
โโโ aiService.js # AI service integration
- Ideological Opposition: Minimum 45-point gap on political spectrum
- Queue Management: Real-time waiting system with disconnect handling
- Topic Selection: AI analyzes user differences to choose debate subjects
- Room Management: Supports multiple concurrent debates
- Phase Management: Automated transitions through 6 debate phases
- Speaker Control: Turn-based audio with automatic muting
- Timer System: Real-time countdowns with phase progression
- Emergency Handling: Graceful disconnection and room cleanup
- Fact-Checking: Real-time analysis of political claims
- Context Generation: Topic-specific supporting information
- Sentiment Monitoring: Emotional tone analysis during debates
- Pre-Debate Briefing: AI-generated fact sheets for preparation
- Full-Stack Integration: Seamless connection between React frontend and Node.js backend
- Real-Time Architecture: Socket.IO handling matchmaking, signaling, and live updates
- WebRTC Implementation: Peer-to-peer video calling with advanced controls
- AI Integration: OpenAI GPT-4 for fact-checking and political analysis
- Database Design: Comprehensive Supabase schema for user data and quiz results
- Supabase Integration: Complex authentication and database setup
- P2P Networking: WebRTC connection establishment across local networks
- State Management: User data persistence across route changes
- Real-Time Synchronization: Managing multiple concurrent debates and matchmaking
- Enhanced AI Moderation: Real-time content filtering and toxicity detection
- Advanced Matching: Historical performance and preference-based algorithms
- Mobile Optimization: Responsive design improvements for mobile devices
- Scale-Up Features: Support for large-scale debate events and tournaments
- Advanced Analytics: Debate performance metrics and user engagement insights
- Platform Expansion: Integration with external video services (Twilio, Daily.co)
- Content Recording: Debate archival and replay functionality
- Frontend: Next.js, React, TypeScript, Tailwind CSS, Zustand
- Backend: Node.js, Express, Socket.IO
- Database: Supabase, PostgreSQL
- AI: OpenAI GPT-4
- Communication: WebRTC, Socket.IO
- Authentication: Supabase Auth
This project is available under the MIT License. See the LICENSE file for more details.
Bridge - Connecting minds across the political divide