Advanced AI-Powered Tournament Discovery & Management Platform
GenAI Tournament Calendar System is an intelligent tournament discovery platform that automatically finds, extracts, and organizes tournament information from across the web. Built with modern Python technologies and AI integration, it supports 13+ sports with comprehensive tournament data collection.
- π€ AI-Powered Query Generation - Generates smart search queries using OpenAI GPT
- π Multi-Sport Support - Cricket, Football, Tennis, Badminton, and 9+ more sports
- π Comprehensive Data Collection - 6 queries per sport with 8 results each (48 results total)
- π’ Official Governing Bodies - Targets ICC, FIFA, ITF, BWF and other official sources
- π Automated Pipeline - From query generation to data export in one workflow
- π Modern Architecture - UV package management, Flask API, React-ready frontend
- π Real-time Processing - Live tournament discovery and processing
- πΎ Multiple Export Formats - CSV, JSON, and database integration
graph TB
A[Query Generator] --> B[Search Collector]
B --> C[Content Extractor]
C --> D[Data Processor]
D --> E[Tournament Filter]
E --> F[Data Exporter]
G[Flask API] --> H[Frontend Interface]
G --> I[Processing Engine]
I --> A
J[UV Environment] --> K[50+ Dependencies]
L[OpenAI GPT] --> A
M[Serper API] --> B
N[Firecrawl API] --> C
| Component | Purpose | Technology |
|---|---|---|
| Query Generator | AI-powered search query generation | OpenAI GPT-3.5 |
| Search Collector | Web search results collection | Serper API |
| Content Extractor | Tournament data extraction | Firecrawl API |
| Data Processor | Deduplication & validation | Python/Pandas |
| Flask API | RESTful backend services | Flask 3.0+ |
| Frontend | Tournament search interface | HTML5/CSS3/JS |
- Python 3.12+ (Required)
- UV Package Manager (Recommended)
- Git (For version control)
- 4GB+ RAM (For processing)
- Internet Connection (For API calls)
- Serper API - Web search functionality
- OpenAI API - AI query generation
- Firecrawl API - Content extraction
# Clone the repository
git clone https://github.com/Arjunheregeek/Gen-AI.git
cd Gen-AI
# Switch to the enhanced UV branch
git checkout uv
# Install UV package manager (if not installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or on Windows: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Install all dependencies with UV
uv sync# Copy environment template
cp .env.example .env
# Edit .env file with your API keys
nano .env # or code .envRequired API Keys in .env:
SERPER_API_KEY=your_serper_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
FIRECRAWL_API_KEY=your_firecrawl_api_key_here# Activate UV environment and test
uv run python -c "import tournament_system; print('β
Installation successful!')"# Start both frontend and backend together
uv run python run.py devAccess Points:
- π Frontend: http://localhost:3000
- π Backend API: http://localhost:8000
- π Health Check: http://localhost:8000/health
# Start backend API server
uv run python run.py server --port 8000
# Or with debug mode
uv run python run.py server --port 8000 --debug# Run complete tournament discovery pipeline
uv run python run.py batch --sport Cricket
# Limit results
uv run python run.py batch --sport Tennis --max 501. Query Generation β 2. Web Search β 3. Content Extraction β 4. Data Processing β 5. Export
- Generates 6 smart queries per sport
- Targets official governing bodies (ICC, FIFA, ITF, etc.)
- Uses OpenAI GPT for enhanced query optimization
- Covers men's and women's tournaments
- Executes 8 search results per query (48 total per sport)
- Uses Serper API for comprehensive web search
- Filters for official tournament sources
- Implements rate limiting and retry logic
- Extracts structured tournament data using Firecrawl
- Identifies tournament names, dates, venues, levels
- Validates data quality and relevance
- Handles multiple content formats
- Deduplicates tournaments using intelligent matching
- Standardizes date formats and venue information
- Applies confidence scoring
- Filters for relevance and quality
- Exports to CSV, JSON formats
- Generates processing statistics
- Creates data validation reports
- Saves to organized file structure
# Search Cricket tournaments
curl "http://localhost:8000/search?sport=Cricket"
# Search Tennis tournaments
curl "http://localhost:8000/search?sport=Tennis"# Full pipeline for Football
uv run python run.py batch --sport Football
# Multiple sports processing
for sport in Cricket Tennis Football; do
uv run python run.py batch --sport $sport --max 25
done# Check system status
curl "http://localhost:8000/health"| Sport | International Body | National Body (India) | Queries Generated |
|---|---|---|---|
| π Cricket | ICC | BCCI | 6 queries |
| β½ Football | FIFA | AIFF | 6 queries |
| πΈ Badminton | BWF | BAI | 6 queries |
| πΎ Tennis | ITF | AITA | 6 queries |
| π Running | World Athletics | AFI | 6 queries |
| π΄ Cycling | UCI | CFI | 6 queries |
| π Swimming | World Aquatics | SFI | 6 queries |
| π Basketball | FIBA | BFI | 6 queries |
| βοΈ Chess | FIDE | AICF | 6 queries |
| π Table Tennis | ITTF | TTFI | 6 queries |
| π€Ό Kabaddi | IKF | KFI | 6 queries |
| π§ Yoga | IYF | Ministry of AYUSH | 6 queries |
| ποΈ Gym | IWF | IWF India | 6 queries |
Total: 78 queries across all sports
GET /search?sport={sport}&level={level}Parameters:
sport(required): Sport name (Cricket, Tennis, etc.)level(optional): Tournament level (International, National)
Response Example:
{
"success": true,
"sport": "Cricket",
"count": 25,
"tournaments": [
{
"tournament_name": "ICC World Cup 2025",
"level": "International",
"start_date": "2025-10-01",
"end_date": "2025-11-15",
"venue": "India",
"governing_body": "ICC",
"registration_url": "https://icc-cricket.com/worldcup2025"
}
]
}GET /healthGET /sportstournament_system/
βββ π§ api/ # Flask API Backend
β βββ routes/ # API route handlers
β βββ services/ # Business logic services
β βββ utils/ # API utilities
βββ π§ core/ # Core Processing Engine
β βββ query_generator.py # AI-powered query generation
β βββ search_collector.py # Web search collection
β βββ content_extractor.py # Tournament data extraction
β βββ data_processor.py # Data processing & validation
βββ π€ exporters/ # Data Export Modules
βββ ποΈ database/ # Database integration
βββ π οΈ utils/ # Shared utilities
βββ π final_output/ # Generated tournament data
frontend/ # Web Interface
βββ index.html # Tournament search interface
βββ assets/ # CSS, JS, images
π§ Configuration Files
βββ pyproject.toml # UV package configuration
βββ uv.lock # Dependency lock file
βββ .env.example # Environment template
βββ run.py # Main entry point
# Run all tests
uv run python -m pytest
# Test specific components
uv run python -m pytest tests/test_query_generator.py# Test query generation
uv run python test_query_generator.py
# Test API endpoints
curl -X GET "http://localhost:8000/health"
curl -X GET "http://localhost:8000/search?sport=Cricket"- 78 queries across 13 sports
- 624 search results per full run (78 Γ 8)
- ~100-300 tournaments discovered per sport
- Processing time: 5-15 minutes per sport
- β‘ UV Package Manager - 2x faster dependency resolution
- π Batch Processing - Efficient bulk operations
- π― Smart Filtering - Reduces irrelevant results by 70%
- πΎ Caching - Avoids duplicate API calls
- π Parallel Processing - Multi-threaded extraction
# In tournament_system/core/query_generator.py
self.governing_bodies["New Sport"] = {
"international": "International Body",
"national": "National Body",
"website": "official-website.com"
}# Modify query templates
self.official_query_templates = [
'your custom query template here',
# Add more templates...
]- Fork the repository
- Create feature branch:
git checkout -b feature/new-feature - Commit changes:
git commit -m 'Add new feature' - Push to branch:
git push origin feature/new-feature - Submit Pull Request
# Reinstall UV
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrc # or restart terminal# Verify .env file exists and has correct keys
cat .env
# Check API key validity
uv run python -c "import os; print(os.getenv('SERPER_API_KEY'))"# Use different port
uv run python run.py server --port 8001# Reinstall dependencies
uv sync --reinstallArjun - Project Creator & Lead Developer
- GitHub: @Arjunheregeek
- Repository: Gen-AI Tournament System
- Python 3.12+ - Core programming language
- UV Package Manager - Modern dependency management
- Flask 3.0+ - Web framework and API development
- OpenAI GPT-3.5 - AI-powered query generation
- Serper API - Web search functionality
- Firecrawl API - Content extraction and processing
Special recognition to the governing bodies that make tournament data accessible:
- ICC (International Cricket Council)
- FIFA (FΓ©dΓ©ration Internationale de Football Association)
- ITF (International Tennis Federation)
- BWF (Badminton World Federation)
- And all other international sports federations
This project is licensed under the MIT License - see the LICENSE file for details.
- π Multi-language Support - Tournament discovery in multiple languages
- π± Mobile App - React Native mobile application
- π Calendar Integration - Google Calendar, Outlook sync
- π€ Advanced AI - GPT-4 integration for better query generation
- π Analytics Dashboard - Tournament trends and statistics
- π Real-time Notifications - Tournament deadline alerts
- π Documentation: Check this README and inline code comments
- π Bug Reports: Create an issue
- π‘ Feature Requests: Submit enhancement request
- π¬ Discussions: GitHub Discussions
# Start development servers
uv run python run.py dev
# Run batch processing
uv run python run.py batch --sport Cricket
# Check system health
curl http://localhost:8000/health
# Run tests
uv run python -m pytest