A universal gaming statistics platform that provides comprehensive player analytics and statistics for various games. The platform consists of a FastAPI backend, Flask scraper API, Telegram bot, and a modern web frontend.
- Universal Game Support: Designed to work with multiple gaming platforms
- Real-time Statistics: Live player data fetching and analysis
- Hybrid Data System: Combines real-time scraping with fallback demo data
- Telegram Bot Integration: Easy access to player stats via Telegram
- Modern Web Interface: Responsive Mini App frontend
- RESTful API: Comprehensive API for third-party integrations
- Cloudflare Bypass: Advanced scraping techniques to overcome anti-bot measures
GameStats Platform
├── Backend (FastAPI) # Main API server
├── Scraper (Flask) # Local data scraping service
├── Telegram Bot # Bot for Telegram integration
├── Mini App (Frontend) # Web interface
└── Documentation # Setup and deployment guides
- Python 3.11+
- Chrome/Chromium browser
- Git
- Node.js (for development)
-
Clone the repository
git clone <repository-url> cd GameStats
-
Setup Backend
cd backend pip install -r requirements.txt python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload -
Setup Scraper API
cd wt_profile_api pip install -r requirements.txt python warthunder_profile_api.py -
Setup Telegram Bot
pip install -r requirements.txt python mini_app_bot.py
-
Open Frontend
# Open mini_app/index.html in your browser # Or serve with a local server python -m http.server 3000
- Fork this repository to your GitHub account
- Sign up at render.com (free)
- Click "New +" → "Blueprint"
- Connect your GitHub and select this repository
- Click "Apply" - Render will automatically:
- Create a Redis database for caching
- Deploy the FastAPI backend
- Configure all environment variables
- Set up health monitoring
# Clone and push to your repository
git clone <your-repo-url>
git add .
git commit -m "Initial deployment"
git push origin main
# Render will auto-deploy on push- ✅ Free Tier: 750 hours/month
- ✅ Auto-deploy: Updates on every git push
- ✅ Redis Cache: Automatic database setup
- ✅ Health Monitoring: Built-in health checks
- ✅ SSL/HTTPS: Automatic certificates
- ✅ Custom Domains: Available on paid plans
📖 Detailed deployment guide: RENDER_DEPLOYMENT.md
GameStats/
├── backend/ # FastAPI backend
│ ├── main.py # Main API server
│ ├── requirements.txt # Python dependencies
│ └── Dockerfile # Container configuration
├── wt_profile_api/ # Flask scraper service
│ ├── warthunder_profile_api.py
│ ├── requirements.txt
│ └── Dockerfile
├── mini_app/ # Frontend application
│ ├── index.html # Main page
│ ├── app.js # Application logic
│ ├── styles.css # Styling
│ └── _redirects # Netlify configuration
├── mini_app_bot.py # Telegram bot
├── deploy.sh # Deployment script
├── render.yaml # Render deployment config
├── .render-buildpacks # Render buildpack config
├── netlify.toml # Netlify configuration
└── README.md # This file
Create a .env file in the root directory:
# Telegram Bot
TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_BOT_USERNAME=your_bot_username
# API Configuration
BACKEND_URL=http://localhost:8000
SCRAPER_URL=http://localhost:8080
# Database (if using)
DATABASE_URL=your_database_urlGET /- API informationGET /health- Health checkGET /player/{username}- Get player statisticsGET /player/{username}/refresh- Force refresh player dataGET /top- Get top playersGET /compare- Compare two players
GET /profile?username={username}®ion={region}- Get player profileGET /health- Health check
Run the deployment script:
chmod +x deploy.sh
./deploy.sh-
Backend (Render)
- Connect your GitHub repository to Render
- Set build command:
pip install -r backend/requirements.txt - Set start command:
cd backend && uvicorn main:app --host 0.0.0.0 --port $PORT
-
Frontend (Netlify)
- Connect your GitHub repository to Netlify
- Set build directory:
mini_app - Set publish directory:
mini_app
-
Telegram Bot
- Deploy to any Python hosting service
- Set environment variables for bot token
- CORS Configuration: Properly configured for production
- Input Validation: All user inputs are validated
- Rate Limiting: Built-in protection against abuse
- Error Handling: Comprehensive error handling and logging
- Cloudflare Bypass: Advanced techniques to handle anti-bot measures
The platform uses a hybrid approach:
- Real-time Scraping: Direct data extraction from game websites
- Demo Data: Fallback data for testing and development
- Caching: Intelligent caching to reduce server load
- Background Updates: Asynchronous data updates
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the GitHub repository
- Check the documentation in the
/docsfolder - Review the deployment guides
The platform is actively maintained and updated with:
- New game support
- Improved scraping techniques
- Enhanced UI/UX
- Performance optimizations
- Security updates
GameStats Platform - Universal gaming statistics for everyone! 🎮📊