"An intelligent debate platform that listens, learns, and levels up how people argue."
Live Demo β’ Documentation β’ Replit Setup β’ Contributing
Oratio is a voice-enabled, AI-powered debate platform built specifically for Replit Vibeathon. It transforms traditional debates into interactive, AI-enhanced experiences where:
- π€ Hosts create debate rooms, set topics, and upload reference materials (PDFs, articles, podcasts)
- π¬ Participants debate using text or voice with real-time transcription
- π₯ Spectators join as audience members and reward debaters for strong arguments
- π€ AI Judge evaluates each round using the LCR Model (Logic, Credibility, Rhetoric)
- π§βπ« AI Trainer provides personalized post-debate feedback and gamified learning exercises
This project is fully optimized for Replit and showcases:
| Feature | Implementation | Status |
|---|---|---|
| Replit Database | Key-value store for all debate data | β Built-in |
| Replit AI | LCR debate judging & training | β Built-in |
| Replit Auth | Seamless user authentication | β Built-in |
| Replit Deployment | One-click deploy & hosting | β Ready |
Why Replit?
- π Zero configuration required
- πΎ Built-in database (no external DB needed)
- π€ Free AI API access for judging
- π Authentication out-of-the-box
- π Instant deployment
- Speak or type your arguments
- Real-time speech-to-text transcription (Whisper API / Web Speech API)
- Live WebSocket broadcast to all participants
Each participant is evaluated on three criteria:
| Criterion | Description | Weight |
|---|---|---|
| Logic (L) | Coherence, reasoning, argument structure | 40% |
| Credibility (C) | Accuracy, evidence use, fact consistency | 35% |
| Rhetoric (R) | Tone, persuasion, clarity, emotional delivery | 25% |
Verdict Format:
{
"scores": {
"A": { "Logic": 8, "Credibility": 9, "Rhetoric": 7 },
"B": { "Logic": 7, "Credibility": 8, "Rhetoric": 9 }
},
"spectator_influence": { "A": 70, "B": 30 },
"winner": "B",
"feedback": {
"A": "Excellent structure, but lacked supporting data.",
"B": "Stronger delivery and fact consistency."
},
"summary": "A tightly contested debate with superior rhetoric from B."
}- Join debates in view-only mode
- Reward debaters with emojis (π π₯ β€οΈ π‘ π―)
- Influence the "People's Choice" meter
- View live leaderboards and audience sentiment
After each debate:
- Personalized AI-generated training plans
- Identifies weak areas (grammar, logic, vocabulary, pacing)
- Interactive exercises with XP progression and badges
- Gamified learning path (e.g., Rising Orator, Fact Master)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (React + TailwindCSS + WebSockets) β
β - Pages: Landing, Host, Arena, Spectator, Results β
β - Components: ScoreBoard, VoiceInput, RewardPanel β
β - Services: API Client, WebSocket Manager β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Backend (FastAPI + WebSockets) β
β - REST API endpoints for rooms, participants, etc. β
β - WebSocket handlers for real-time debate updates β
β - File upload handling (PDFs, audio, URLs) β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI Layer (Gemini AI β Replit AI β Static Fallback) β
β - LCR Model evaluation β
β - Fact-checking via Serper/Tavily β
β - Speech-to-text (Web Speech API) β
β - Personalized training feedback β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Database (Replit DB β In-Memory Dict) β
β - User profiles, debate history, scores β
β - XP progression, badges, leaderboards β
β - Auto-fallback for local development β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Oratio uses intelligent fallback layers for maximum compatibility:
Database Tier:
- Tier 1 (Production): Replit DB - Persistent key-value storage when deployed on Replit
- Tier 2 (Development): In-Memory Dict - Non-persistent, perfect for local testing
AI Provider Tier:
- Tier 1 (Best Quality): Gemini AI (gemini-2.5-pro) - If
GEMINI_API_KEYis configured - Tier 2 (Good Quality): Replit AI (chat-bison) - Automatically available on Replit platform
- Tier 3 (Demo Mode): Static Responses - Fallback for testing without API keys
Backend Hosting:
- Replit: Auto-detected, optimized for Replit environment
- Local: Development mode with in-memory storage
- Docker: Production-ready containerized deployment
---
## βοΈ **Tech Stack**
| Layer | Technologies |
|-------|-------------|
| **Frontend** | React 18, TailwindCSS, Framer Motion, React Router, Web Speech API, WebSockets |
| **Backend** | FastAPI 0.95+, Pydantic 2.0+, Uvicorn, WebSockets, ORJSONResponse (3-5x faster JSON) |
| **AI/LLM** | Google Gemini AI (gemini-2.5-pro) β Replit AI (chat-bison) β Static fallback |
| **Speech** | Browser SpeechRecognition API (built-in) |
| **Fact Checking** | Serper API (free tier available) |
| **File Parsing** | PyMuPDF (PDF), BeautifulSoup4 (HTML/articles), aiofiles (async I/O) |
| **Database** | Replit DB (key-value) β In-Memory Dict (local fallback) |
| **Auth** | Replit Auth (on Replit) / Simple JWT (local) |
| **Performance** | GZip middleware, orjson serialization, connection pooling |
| **Deployment** | Replit (primary), Docker + Docker Compose (alternative), Local (development) |
---
## π **Quick Start**
### **Option 1: Deploy on Replit (Recommended)**
1. **Fork this Repl**
Click "Fork" on Replit or import from GitHub
2. **Add Secrets (Optional but Recommended)**
- Click π **Secrets** tab in left sidebar
- Add `GEMINI_API_KEY` for better AI judging (get free key at [Google AI Studio](https://aistudio.google.com/app/apikey))
- Add `SERPER_API_KEY` for fact-checking (get free key at [serper.dev](https://serper.dev))
- Add `SECRET_KEY` for secure sessions (or let it auto-generate)
3. **Click βΆοΈ Run**
The backend will start automatically on port 8000
4. **Access the App**
https://[your-repl-name].[username].repl.co/docs
π **Detailed guide**: See [QUICKSTART.md](./QUICKSTART.md)
---
### **Option 2: Local Development**
#### **Prerequisites**
- Docker & Docker Compose installed
- (Optional) Node.js 18+ and Python 3.11+ for local development
#### **1. Clone the Repository**
```bash
git clone https://github.com/muneer320/oratio.git
cd oratio
cp .env.example .envEdit .env and add your API keys (all optional):
GEMINI_API_KEY- For better AI judging (get at Google AI Studio)SERPER_API_KEY- For fact-checking (get at serper.dev)SECRET_KEY- For secure auth sessions (auto-generates if empty)
Note: App works without these keys using fallback responses for testing.
docker-compose up --buildThis will:
- Build the frontend (Vite + React)
- Build the backend (FastAPI)
- Start both services behind nginx
- Expose the app at http://localhost
- Frontend: http://localhost
- Backend API: http://localhost/api/utils/health
- WebSocket: ws://localhost/ws/debate/{room_id}
cd backend
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\Activate.ps1
pip install -r requirements.txt
uvicorn app.main:app --reload --host 127.0.0.1 --port 8000cd frontend
npm install
npm run devFrontend will run on http://localhost:5173
POST /api/auth/register - Register new user
POST /api/auth/login - Login user
GET /api/auth/me - Get current user
PUT /api/auth/update - Update user profile
DELETE /api/auth/logout - Logout user
POST /api/rooms/create - Create debate room
GET /api/rooms/{room_id} - Get room details
PUT /api/rooms/{room_id}/update - Update room settings
DELETE /api/rooms/{room_id} - Delete room
GET /api/rooms/list - List all active rooms
POST /api/participants/join - Join debate room
GET /api/participants/{participant_id} - Get participant info
PUT /api/participants/{participant_id}/ready - Mark as ready
DELETE /api/participants/{participant_id}/leave - Leave room
POST /api/spectators/join - Join as spectator
POST /api/spectators/{room_id}/reward - Send reward emoji
GET /api/spectators/{room_id}/stats - Get audience stats
DELETE /api/spectators/{spectator_id}/leave - Leave as spectator
POST /api/debate/{room_id}/submit-turn - Submit text/voice turn
POST /api/debate/{room_id}/submit-audio - Upload audio turn
GET /api/debate/{room_id}/transcript - Get full transcript
POST /api/debate/{room_id}/end - End debate
GET /api/debate/{room_id}/status - Get debate status
POST /api/ai/analyze-turn - Analyze single turn
POST /api/ai/fact-check - Fact-check statement
POST /api/ai/final-score - Generate final verdict
GET /api/ai/summary/{room_id} - Get debate summary
GET /api/ai/report/{room_id} - Get detailed report
POST /api/trainer/analyze - Analyze user performance
GET /api/trainer/recommendations/{user_id} - Get personalized exercises
POST /api/trainer/challenge/start - Start training challenge
POST /api/trainer/challenge/submit - Submit challenge response
GET /api/trainer/progress/{user_id} - Get XP and badges
PUT /api/trainer/progress/{user_id} - Update progress
POST /api/uploads/pdf - Upload PDF reference
POST /api/uploads/audio - Upload audio file
POST /api/uploads/url - Add URL reference
GET /api/uploads/{room_id} - List room uploads
DELETE /api/uploads/{file_id} - Delete uploaded file
GET /api/utils/health - Health check
GET /api/utils/config - Get public config
POST /api/utils/feedback - Submit user feedback
GET /api/utils/leaderboard - Global leaderboard
GET /api/utils/search-topics - Search debate topics
ws://localhost/ws/debate/{room_id} - Live debate updates
ws://localhost/ws/spectator/{room_id} - Audience interactions
ws://localhost/ws/trainer/{user_id} - Real-time trainer feedback
| Page | Route | Description |
|---|---|---|
| Landing Page | / |
"Host Debate" / "Join Debate" / "Train with AI" options |
| Host Dashboard | /host |
Room creation, topic input, reference upload |
| Debate Arena | /debate/:roomId |
Split-screen participants + live scores + audience meter |
| Spectator View | /spectate/:roomId |
Watch debate + send rewards |
| Result Page | /results/:roomId |
Winner, LCR breakdown chart, AI feedback, fact sources |
| Trainer Page | /trainer |
Personalized training modules, XP tracking, challenges |
oratio/
βββ frontend/
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Route-level views
β β βββ services/ # API and WebSocket clients
β β βββ hooks/ # Custom React hooks
β β βββ utils/ # Helper functions and constants
β β βββ styles/ # Global CSS
β β βββ routes/ # Route definitions
β β βββ App.jsx # Main app component
β β βββ main.jsx # React entry point
β βββ index.html
β βββ vite.config.js
β βββ package.json
βββ backend/
β βββ app/
β β βββ main.py # FastAPI entry point
β β βββ routers/ # API route handlers (TODO)
β β βββ models/ # Pydantic models (TODO)
β β βββ services/ # Business logic (TODO)
β β βββ websockets/ # WebSocket handlers (TODO)
β βββ requirements.txt
β βββ README.md
βββ docker/
β βββ nginx.conf # Nginx configuration
β βββ supervisord.conf # Process manager config
βββ Dockerfile # Multi-stage build
βββ docker-compose.yml
βββ .env.example
βββ .gitignore
βββ .dockerignore
βββ LICENSE
βββ README.md
| Time | Focus | Deliverable |
|---|---|---|
| 0β6h | Project setup | β Base FastAPI + React + Docker structure |
| 6β14h | Debate logic | Room creation, join flow, turn system |
| 14β22h | AI judging | LCR prompt engineering + live scoring |
| 22β28h | Voice integration | Whisper API + speech recognition |
| 28β32h | Spectator system | Reward system + audience influence |
| 32β36h | Trainer + polish | AI training, animations, final demo |
| Feature | Status |
|---|---|
| Backend Foundation | β Complete |
| Replit Integration | β Complete |
| Database Models | β Complete |
| API Schemas | β Complete |
| Auth System | π§ In Progress |
| Room Management | π Planned |
| Debate Flow | π Planned |
| AI Judging | π Planned |
| Trainer System | π Planned |
| Frontend UI | π§ In Progress |
| WebSockets | π Planned |
| File Uploads | π Planned |
- Backend foundation with Replit features
- Database models and schemas
- Authentication system
- Basic room creation and joining
- Simple debate flow
- LCR model implementation
- Real-time AI feedback
- Fact-checking integration
- Final verdict generation
- XP and leveling system
- Badges and achievements
- Global leaderboard
- Training exercises
- Voice input/output
- Advanced UI animations
- Mobile responsiveness
- Performance optimization
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For more details, see CONTRIBUTING.md
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini for powerful AI capabilities
- FastAPI for the amazing Python web framework
- React and Vite for modern frontend tooling
- Replit for zero-config database and AI integration
For questions or feedback:
- GitHub Issues: github.com/muneer320/oratio/issues
- Email: muneer.alam320@gmail.com
Built with β€οΈ for better debates and smarter conversations.