Skip to content

maninka123/Tennis-tour-dashboard

Repository files navigation

🎾 Tennis Live Dashboard

Real-time ATP & WTA Tennis Tracking for 2026

Python Flask License Live Demo

Your all-in-one tennis companion for live scores, rankings, tournament insights, player analytics, and smart notifications.


✨ Features

πŸ”΄ Live Match Tracking

  • Real-time ATP/WTA live scores with server/game-point context.
  • Auto-refresh via SocketIO with polling fallback.

πŸ”₯ Form β€” Current rating

  • Lightweight match-form metric that reflects a player's recent results relative to expectations. Shows short-term hot/cold streaks alongside the official rating.

    Formula (Elo-style update):

    $$F = R + K \sum_{i=1}^n w_i (S_i - E_i)$$

    where:

    • $R$ = current official rating
    • $K$ = scaling constant (controls sensitivity)
    • $w_i$ = time-decay weight for match $i$ (recent matches larger)
    • $S_i$ = actual score for match $i$ (1 = win, 0.5 = draw, 0 = loss)
    • $E_i = \dfrac{1}{1 + 10^{(O_i - R)/400}}$ is the expected score vs opponent rating $O_i$

    Notes: choose $K$ and $w_i$ to tune responsiveness; the value $F$ is shown alongside the official rating to indicate short-term form.

πŸ“Š Match Coverage

  • Recently finished matches with quick stat breakdowns.
  • Upcoming matches (next 2 days) with H2H/prediction insights.

πŸ† Rankings & Tournaments

  • ATP/WTA rankings with update status and refresh actions.
  • Tournament calendar + bracket viewer with round points/prize context.

βš”οΈ H2H Analytics

  • ATP and WTA search + head-to-head comparison.
  • Surface splits, trends, and radar-style metrics.

πŸ‘€ Player Profiles

  • Profile cards, country flags, image fallback, and stat summaries.
  • Match-level details integrated with dashboard views.

πŸ“ˆ Data Analysis Dashboard

  • Dedicated ATP/WTA analysis workspace (/analysis/atp, /analysis/wta).
  • Player Explorer, Tournament Explorer, and Records Book.

πŸ”” Smart Notification System

  • Multi-rule alert engine with guided rule builder.
  • Event types for upcoming/live/result/milestone-style triggers.
  • Channels: Email + integrations, cooldowns, quiet hours, run-now testing.
  • Launchable from main dashboard button (auto-start helper route).

πŸš€ Quick Start

🌐 Live Demo

Visit: tennis-tour-dashboard.onrender.com

πŸ’» Local Development

1. Option A: Quick Start Script

macOS / Linux (bash):

./start.sh

Windows (PowerShell):

bash start.sh

2. Option B: Manual Setup

Backend:

cd backend
python3 -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
python app.py

Frontend (new terminal):

cd frontend
python3 no_cache_server.py

Default local URLs:

  • Frontend: http://localhost:8085
  • Backend: http://localhost:5001
  • Notification app: http://localhost:5090

πŸ› οΈ Tech Stack

Backend

  • Python Python 3.11+
  • Flask Flask + Flask-SocketIO
  • Requests BeautifulSoup Playwright Requests / BeautifulSoup / Playwright-based data flows

Frontend

  • HTML5 CSS3 JavaScript HTML/CSS/Vanilla JS (modular files)
  • UI Interactive charts/visualizations + custom UI components

Deployment

  • Render Render.com (Python service)
  • GitHub GitHub for source and CI flow

πŸ“‘ API Endpoints

Core Endpoints

Method Endpoint Description
GET /api/health Health check βœ…
GET /api/live-scores?tour=atp|wta|both Live match scores πŸ”΄
GET /api/recent-matches?tour=...&limit=... Recently completed matches πŸ“‹
GET /api/upcoming-matches?tour=...&days=7 Upcoming matches 🎯
GET /api/intro-gifs Intro GIF list πŸ–ΌοΈ

Rankings & Players

Method Endpoint Description
GET /api/rankings/<tour>?limit=... ATP/WTA rankings πŸ†
GET /api/rankings/atp/status ATP rankings status ⏰
POST /api/rankings/atp/refresh Refresh ATP rankings πŸ”„
GET /api/rankings/wta/status WTA rankings status ⏰
POST /api/rankings/wta/refresh Refresh WTA rankings πŸ”„
GET /api/player/<id> Player profile πŸ‘€
GET /api/player/<tour>/<player_id>/image Player image route πŸ“Έ

Tournaments & Brackets

Method Endpoint Description
GET /api/tournaments/<tour> Tournament calendar πŸ“…
GET /api/tournament/<id>/bracket?tour=... Tournament bracket 🌳
GET /api/categories Category list 🏷️

Head-to-Head

Method Endpoint Description
GET /api/h2h/atp/search?query=...&limit=... ATP player search πŸ”
GET /api/h2h/wta/search?query=...&limit=... WTA player search πŸ”
GET /api/h2h/atp?player1_id=...&player2_id=... ATP H2H βš”οΈ
GET /api/h2h/wta?player1_id=...&player2_id=...&year=2026&meetings=5 WTA H2H βš”οΈ

System Management

Method Endpoint Description
GET /api/system/analysis Update analysis summary πŸ“ˆ
POST /api/system/update Trigger update pipeline πŸ”„
GET /api/system/update/status Update progress πŸ“Š
GET /api/notifications/status Notification service status πŸ””
POST /api/notifications/launch Launch notification service πŸš€
GET /notifications/open Open notification page 🌐

πŸ”” Notification System Endpoints (port 5090)

Method Endpoint Description
GET /api/state State: settings/rules/history/config βš™οΈ
POST /api/settings Save delivery settings πŸ“
GET /api/options Player/tournament options πŸ”
POST /api/rules Create rule ✨
PUT /api/rules/<rule_id> Update rule πŸ”§
DELETE /api/rules/<rule_id> Delete rule πŸ—‘οΈ
POST /api/run-now Manual run πŸš€
POST /api/test-email Send test email πŸ“§
POST /api/history/clear Clear run history πŸ”„

πŸ“ Project Structure

Tennis-Dashboard/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app.py
β”‚   β”œβ”€β”€ tennis_api.py
β”‚   β”œβ”€β”€ config.py
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── notification_system/
β”‚       β”œβ”€β”€ app.py
β”‚       β”œβ”€β”€ storage/subscriptions.json
β”‚       β”œβ”€β”€ templates/index.html
β”‚       └── static/{app.js,styles.css,favicon.svg}
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ update.html
β”‚   β”œβ”€β”€ no_cache_server.py
β”‚   β”œβ”€β”€ css/
β”‚   β”œβ”€β”€ js/
β”‚   └── vendor/
β”œβ”€β”€ data/
β”œβ”€β”€ data_analysis/
β”œβ”€β”€ scripts/
β”œβ”€β”€ Images/
β”œβ”€β”€ start.sh
β”œβ”€β”€ start_local.sh
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
└── .gitignore

πŸ“Έ Interface Gallery

Title Preview Description
Loading Intro Loading intro page Intro/loading screen.
Main Interface Main interface Main dashboard layout.
Main Interface (Alt) Alternative interface Alternate dashboard composition.
Upcoming Match Insights Upcoming match insights Upcoming card with insights.
Live Rankings and Calendar Live rankings and calendar Rankings + calendar + bracket workspace.
Favourites Panel Favourites panel Favourite players side panel.
H2H Analytics View 1 H2H view 1 First H2H analysis screen.
H2H Analytics View 2 H2H view 2 Detailed H2H comparison screen.
Player Stats Card 1 Player stats 1 Player profile card style 1.
Player Stats Card 2 Player stats 2 Player profile card style 2.
Stats Table Stats table Tabular stats comparison layout.
Serving Stats Index Serving stat index Serving metrics index view.
Notification System Notification system Notification rules + controls page.
Notification System (Detail) Notification system 2 Notification detail workflow view.

πŸ“Š Data Analysis Dashboard

Title Preview Description
Player Analysis Analysis player Core player analysis workspace.
Player Analysis - Additional View Analysis player 2 Additional player perspective.
Player Analysis - Advanced Metrics Analysis player 3 Advanced metrics panel.
Player Match Analysis Analysis player matches Match-level player analysis.
Tournament Analysis Analysis tournament Tournament explorer screen.
Records Book Analysis record book Historical records and holders.
Ranking Points Analysis Analysis ranking points Ranking points trends.

πŸ“„ License

MIT License β€” see LICENSE.


⭐ Star this repo if you find it useful! ⭐

GitHub stars GitHub forks

Made with 🎾 and β˜• | Β© 2026 Tennis Dashboard

About

Real-time ATP & WTA dashboard with live scores, rankings, tournament calendars and draws, H2H analytics, player insights, and smart match notifications in one place.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors