{"id":31906425,"url":"https://github.com/mahmoodhamdi/esports-flask","last_synced_at":"2026-05-08T07:32:59.872Z","repository":{"id":301202743,"uuid":"1008100380","full_name":"mahmoodhamdi/esports-flask","owner":"mahmoodhamdi","description":"A comprehensive Flask REST API providing real-time data for the Esports World Cup, including tournaments, teams, players, matches, and news. Features advanced search, live data scraping, and a full admin interface.","archived":false,"fork":false,"pushed_at":"2025-08-29T21:18:35.000Z","size":4261,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-21T19:49:00.301Z","etag":null,"topics":["api","beautifulsoup4","cors","cs2","data-scraping","esports","esports-api","flask","football","liquipedia","openapi","python","rest-api","sqlite","swagger","valorant"],"latest_commit_sha":null,"homepage":"https://github.com/mahmoodhamdi/esports-flask","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mahmoodhamdi.png","metadata":{"files":{"readme":"README.md","changelog":"news.db","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-25T03:09:50.000Z","updated_at":"2025-10-15T22:07:46.000Z","dependencies_parsed_at":"2025-07-13T04:28:44.846Z","dependency_job_id":"982c8f64-34a2-4073-82a8-b82a550d4265","html_url":"https://github.com/mahmoodhamdi/esports-flask","commit_stats":null,"previous_names":["mahmoodhamdi/esports-flask"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mahmoodhamdi/esports-flask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoodhamdi%2Fesports-flask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoodhamdi%2Fesports-flask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoodhamdi%2Fesports-flask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoodhamdi%2Fesports-flask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mahmoodhamdi","download_url":"https://codeload.github.com/mahmoodhamdi/esports-flask/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoodhamdi%2Fesports-flask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32771028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T02:36:36.067Z","status":"ssl_error","status_checked_at":"2026-05-08T02:36:07.210Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","beautifulsoup4","cors","cs2","data-scraping","esports","esports-api","flask","football","liquipedia","openapi","python","rest-api","sqlite","swagger","valorant"],"created_at":"2025-10-13T14:45:51.135Z","updated_at":"2026-05-08T07:32:59.857Z","avatar_url":"https://github.com/mahmoodhamdi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎮 Esports World Cup API\n\nA comprehensive Flask-based REST API for esports data, providing real-time information about tournaments, teams, players, matches, and news for the Esports World Cup and other major esports events.\n\n## 🌟 Features\n\n- **📰 News Management** - CRUD operations for esports news with image upload support\n- **🏆 Tournament Information** - Detailed data about EWC and other tournaments\n- **👥 Teams \u0026 Players** - Comprehensive player transfers, team rosters, and profiles\n- **⚔️ Matches \u0026 Schedules** - Live and upcoming match data across multiple games\n- **🏅 Prize Distribution** - Prize pool information and distribution details\n- **🔍 Advanced Search** - Full-text and fuzzy search across all data types\n- **📊 Rankings** - EWC club championship standings with weekly tracking\n- **🔄 Live Data Fetching** - Real-time data scraping from Liquipedia\n- **📱 Pagination \u0026 Filtering** - Efficient data retrieval with extensive filtering options\n- **📊 Matches Dashboard** - Comprehensive match viewing interface\n- **🗓️ Weekly Tracking** - Week-by-week EWC progress and statistics\n\n## 🛠️ Technology Stack\n\n- **Backend Framework**: Flask (Python)\n- **Database**: SQLite with FTS5 for full-text search\n- **API Documentation**: Flasgger/Swagger\n- **CORS Support**: Flask-CORS\n- **Data Scraping**: BeautifulSoup, Requests\n- **Search**: FuzzyWuzzy for fuzzy search, SQLite FTS5 for full-text\n- **Data Processing**: Pandas for data manipulation\n- **Authentication**: (To be implemented based on requirements)\n\n## 📦 Installation \u0026 Setup\n\n### Prerequisites\n- Python 3.8+\n- pip (Python package manager)\n- Virtualenv (recommended)\n\n### Installation Steps\n\n1. **Clone the repository**\n```bash\ngit clone https://github.com/mahmoodhamdi/esports-flask.git\ncd esports-flask\n```\n\n2. **Create a virtual environment**\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n3. **Install dependencies**\n```bash\npip install -r requirements.txt\n```\n\n4. **Initialize the database**\n```bash\npython -c \"from app import create_app; app = create_app()\"\n```\n\n5. **Run the application**\n```bash\npython run.py\n```\n\nThe API will be available at `http://localhost:5000`\n\n### Docker Installation (Alternative)\n```bash\ndocker build -t esports-api .\ndocker run -p 5000:5000 esports-api\n```\n\n## 📚 API Documentation\n\nOnce the application is running, access the interactive Swagger documentation at:\n`http://localhost:5000/apidocs`\n\n## 🗂️ Project Structure\n\n```\nesports-flask/\n├── app/\n│   ├── __init__.py              # Application factory and setup\n│   ├── db.py                    # Database connection and initialization\n│   ├── enhanced_search.py       # Advanced search functionality\n│   ├── ewc_info.py              # EWC tournament information\n│   ├── ewc_rank.py              # Club championship rankings\n│   ├── ewc_teams_players.py     # Teams and players data\n│   ├── game_matches.py          # Match data handling\n│   ├── fuzzy_search.py          # Fuzzy search implementation\n│   ├── fts_search.py            # Full-text search implementation\n│   ├── matches_mohamed.py       # Match scraping functionality\n│   ├── news.py                  # News management\n│   ├── new_teams.py             # Teams data handling\n│   ├── game_teams.py            # Game teams management\n│   └── game_teams_init_db.py    # Database initialization for game teams\n├── routes/                      # API route handlers\n│   ├── news.py\n│   ├── games.py\n│   ├── prizes.py\n│   ├── info.py\n│   ├── player_transfers.py\n│   ├── ewc_rank_route.py\n│   ├── ewc_teams_players.py\n│   ├── team_information.py\n│   ├── player_information.py\n│   ├── search.py\n│   ├── search_extended.py\n│   ├── game_matches.py\n│   ├── game_teams.py\n│   └── ewc_weeks.py\n├── matches_dashborad/           # Matches dashboard functionality\n│   └── reoute_matches_dashbord_test.py\n├── static/                      # Static files and uploads\n├── requirements.txt             # Python dependencies\n└── README.md                    # Project documentation\n```\n\n## 🚀 Complete API Endpoints\n\n### News Management\n- `GET /api/news` - Retrieve paginated news articles with filtering\n- `POST /api/news` - Create a new news article\n- `GET /api/news/{id}` - Get a specific news article\n- `PUT /api/news/{id}` - Update a news article\n- `DELETE /api/news/{id}` - Delete a news article\n- `DELETE /api/news` - Delete all news articles\n\n### Games Information\n- `GET /api/games` - Get information about supported games\n\n### Prize Distribution\n- `GET /api/prizes` - Get prize pool information and distribution\n\n### General Information\n- `GET /api/info` - Get general EWC tournament information\n\n### Player Transfers\n- `GET /api/player-transfers` - Get player transfer information\n\n### EWC Rankings\n- `GET /api/ewc_rank` - Get club championship standings\n\n### EWC Teams \u0026 Players\n- `GET /api/ewc_teams_players` - Get team rosters and player data\n\n### Team Information\n- `GET /api/team_information` - Get detailed team profiles\n\n### Player Information\n- `GET /api/player_information` - Get detailed player profiles\n\n### Search Functionality\n- `GET /api/search` - Basic search across all data types\n- `GET /api/extended/search` - Advanced search with filters\n\n### Game Matches\n- `GET /api/game_matches` - Get match data for specific games\n- `GET /api/game_matches/{game}` - Get matches for a specific game\n\n### Teams Data\n- `GET /api/new_teams` - Get team information from JSON data\n- `POST /api/new_teams` - Add new team data\n- `GET /api/game_teams` - Get teams for specific games\n\n### Matches Dashboard\n- `GET /api/matches` - Get matches dashboard data with filtering\n- `GET /api/matches/{game}` - Get matches for a specific game\n\n### EWC Weeks\n- `GET /api/weeks` - Get weekly EWC information and progress\n\n### File Uploads\n- `GET /uploads/{filename}` - Serve uploaded files\n\n## 🔧 Configuration\n\nThe application can be configured through environment variables:\n\n- `FLASK_ENV` - Environment (development/production)\n- `FLASK_DEBUG` - Debug mode (0/1)\n- `DATABASE_URL` - Database connection string\n- `CORS_ORIGINS` - Allowed origins for CORS\n- `HOST` - Host address to bind to (default: 0.0.0.0)\n- `PORT` - Port to run on (default: 5000)\n\nExample environment file (.env):\n```env\nFLASK_ENV=production\nFLASK_DEBUG=0\nDATABASE_URL=sqlite:///app.db\nCORS_ORIGINS=*\nHOST=0.0.0.0\nPORT=5000\n```\n\n## 🗄️ Database Schema\n\nThe application uses SQLite with the following main tables:\n- `news` - News articles with metadata\n- `matches` - Match information across games\n- `game_teams` - Team information for specific games\n- `game_teams_fts` - Full-text search virtual table\n\n## 🔍 Search Features\n\n### Full-Text Search\n- Supports searching across team names, game names, and logo modes\n- Uses SQLite FTS5 for efficient text searching\n- Automatic synchronization with triggers\n\n### Fuzzy Search\n- Implemented using FuzzyWuzzy\n- Handles typos and approximate matching\n- Configurable similarity thresholds\n\n### Extended Search\n- Advanced filtering options\n- Field-specific search capabilities\n- Combined text and filter queries\n\n## 📊 Data Sources\n\nThe API integrates with multiple data sources:\n- **Liquipedia** - For live match data and tournament information\n- **Local JSON files** - For team and game data\n- **Manual input** - For news and custom content\n\n## 🤝 Contributing\n\nWe welcome contributions! Please follow these steps:\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n### Development Guidelines\n- Follow PEP 8 style guide for Python code\n- Write tests for new functionality\n- Update documentation for new features\n- Use descriptive commit messages\n\n## 🧪 Testing\n\nRun the test suite with:\n```bash\npython -m pytest tests/ -v\n```\n\nOr run specific test files:\n```bash\npython -m pytest tests/test_news.py -v\n```\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## 🐛 Troubleshooting\n\n### Common Issues\n\n1. **Database errors**: Try deleting the database file and reinitializing\n2. **Missing dependencies**: Run `pip install -r requirements.txt`\n3. **CORS issues**: Check the CORS_ORIGINS environment variable\n4. **File upload issues**: Ensure the uploads directory exists and has proper permissions\n\n### Getting Help\n\nIf you encounter issues not covered here, please:\n1. Check the existing issues on GitHub\n2. Create a new issue with detailed information\n3. Include error logs and steps to reproduce\n\n## 👨‍💻 Developer\n\n**Mahmood Hamdi**  \n- Email: [hmdy7486@gmail.com](mailto:hmdy7486@gmail.com)  \n- WhatsApp: [+201019793768](https://wa.me/201019793768)  \n- GitHub: [https://github.com/mahmoodhamdi/](https://github.com/mahmoodhamdi/)\n\n## 🙏 Acknowledgments\n\n- Liquipedia for providing comprehensive esports data\n- Flask community for excellent documentation and resources\n- All contributors who have helped improve this project\n- The esports community for feedback and feature suggestions\n\n---\n\n**Note**: This API is actively maintained and updated regularly with new features and improvements. Check the GitHub repository for the latest updates and release notes.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahmoodhamdi%2Fesports-flask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahmoodhamdi%2Fesports-flask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahmoodhamdi%2Fesports-flask/lists"}