Table tennis betting prediction platform with a Django REST API backend and React TypeScript frontend.
Note: This project was created in 2021 and is no longer maintained or supported.
This project was created for educational purposes only. It is intended as a learning exercise in web development, data analysis, and machine learning techniques.
Regarding betting: This software does not encourage, promote, or facilitate real-money gambling. The predictions generated are purely illustrative and should not be used for actual betting decisions. Gambling involves significant financial risk and may be illegal in your jurisdiction. The authors are not responsible for any financial losses or legal consequences resulting from the misuse of this software.
- Docker & Docker Compose
- Node.js 15+ (for frontend development)
- Python 3.10+ (for local development without Docker)
# Build and start services (PostgreSQL, Django, Nginx)
make build
make up
# Initialize database
make migrate
make create-superuser
# Access the API at http://localhost:8081cd probetspp_front
npm install
npm start
# Access the app at http://localhost:3000# Database
make migrate # Run migrations
make makemigrations # Create migrations
make reset-db # Reset database
make init-db # Reset + migrate + load fixtures
make shell # Django shell_plus
# Testing
make run-tests # Run all tests
make run-tests args="-k test_name" # Run specific test
# Code quality
make black # Format Python code
make dev-check # Run pre-commit hooks
# Predictions
make create-predictions # Generate predictions manuallycd probetspp_front
npm start # Development server
npm test # Run tests
npm run build # Production buildprobetspp/
βββ probetspp/ # Django project
β βββ apps/ # Application modules
β β βββ core/ # Base models, utilities
β β βββ games/ # Game, Player, League models
β β βββ predictions/ # Prediction engine
β β βββ data/ # ML weights, analysis
β β βββ third_parties/ # Web scrapers (Flashscore, Yajuego)
β β βββ utils/ # Helpers, S3 integration
β βββ probetspp/ # Settings & configuration
βββ probetspp_front/ # React TypeScript frontend
βββ config/ # Nginx, Gunicorn, entrypoint
βββ requirements/ # Python dependencies
βββ Dockerfile
βββ docker-compose.yml
βββ makefile
zappa deploy devRequired environment variables:
ALLOWED_HOSTSBUCKET_FILESDATABASE_HOST,DATABASE_NAME,DATABASE_USER,DATABASE_PASSWORD,DATABASE_PORTENVIRONMENT=productionSENTRY_URLAWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY
For headless Chrome on AWS Lambda, install chromeless and configure the Lambda function (default name: chromeless-server-prod).
Add Lambda environment variable: TZ=America/Bogota
When deployed to AWS Lambda via Zappa:
update_old_scheduled_games- Daily at 5:05 AMupdate_events_data- Every 10 minutescreate_periodical_prediction- Every 25 minutes
Backend: Django 3.1, Django REST Framework, PostgreSQL, Django-Q, Selenium, Pandas
Frontend: React 18, TypeScript, Redux Toolkit, React Router, Chart.js
Infrastructure: Docker, Nginx, Gunicorn, AWS Lambda/Zappa, S3