# Realtime Voice - ElevenLabs Cricket Analyzer

ODI Cricket database analysis with voice interaction powered by ElevenLabs. AI chat assistant connected to PostgreSQL database with Cricsheet.org ball-by-ball data. Supports text and voice queries, Python charts, and Google Docs integration.

## Links
- App: https://rexc.tigzig.com
- Docs: https://tigzig.com/app-documentation/realtime-voice-elevenlabs.html
- GitHub (FastAPI Backend): https://github.com/amararun/shared-rexc-cricket-fastapi

## Tags
database-ai, voice-ai, elevenlabs, cricket, fastapi

## Architecture

```
HTML/CSS/JS Frontend → ElevenLabs Voice Widget → FastAPI Backend → PostgreSQL
                     → Text Chat Interface    →                 → Python Charts
                                              → Google Docs API
```

- Frontend: Single-page HTML/CSS/JavaScript, deployable to Vercel/Netlify
- Backend: FastAPI server with fixed database connection (shared-rexc-cricket-fastapi)
- Voice: ElevenLabs voice widget for voice-based queries and responses
- Database: PostgreSQL with Cricsheet.org ODI data (2003-2024)

### FastAPI Backend (shared-rexc-cricket-fastapi)
Uses `/sqlquery/` endpoint to execute SQL queries against pre-configured database. Simple connector for LLMs/AI tools.

```bash
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port $PORT
```

### Repositories
1. Main JavaScript UI: https://github.com/amararun/shraed-rexc-cricket-javascript
2. FastAPI Database Connector: https://github.com/amararun/shared-rexc-cricket-fastapi
3. Cricsheet CSV Processor: https://github.com/amararun/shared-cricket-data-flask

## Features
- Voice commands and text input for cricket data queries
- Real-time database analysis with AI chat assistant
- Python-powered statistical processing and dynamic charts (text mode)
- Google Docs integration for pushing conversation/query data
- Connects to any database via credentials

## Data Source
Cricsheet.org ODI ball-by-ball data. Raw data: https://cricsheet.org/downloads/#experimental
