A web application for tracking tennis matches, built with Python Flask, HTML, and CSS.
- Create tennis matches with two players
- Track points, games, and sets in real-time
- Follow traditional tennis scoring rules (0, 15, 30, 40, Deuce, Advantage)
- Responsive design that works on desktop and mobile devices
- Persistent storage of matches in a database
- View match history and access previous matches
- Delete matches when no longer needed
- Detailed scoring options (Ace, Winner, Unforced Error, Forced Error, Fault)
- Serving player tracking with visual indicators
- Double fault system (first fault -> second fault = point for opponent)
- Enhanced user interface with score display at the top
- Clone or download this repository
- Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the required dependencies:
pip install -r requirements.txt
-
Run the application:
python app.py
-
Open your web browser and go to
http://localhost:5000 -
Create a new game by entering the names of the two players
-
Use the detailed scoring buttons to track specific point types:
- Ace: An untouched serve that wins the point (only available for serving player)
- Winner: A shot that the opponent cannot reach
- Unforced Error: An error made without significant opponent pressure
- Forced Error: An error caused by the opponent's good play
- Fault: An invalid serve (only available for serving player)
- Double Fault: Two consecutive faults result in a point for the opponent
-
The serving player is indicated by a red dot next to their name
-
Alternatively, use the traditional "Player X Wins Point" buttons for simple scoring
-
The application will automatically handle scoring according to tennis rules:
- Points: 0, 15, 30, 40, Deuce, Advantage
- Games: First to win 4 points with a 2-point lead
- Sets: First to win 6 games with a 2-game lead
-
Visit the "Match History" page to view all previously created matches
app.py: Main Flask application with game logicmodels.py: Database models for persistent storagetemplates/: HTML templatesstatic/css/: CSS stylesheetsstatic/js/: JavaScript filesrequirements.txt: Python dependencies
This app implements standard tennis scoring:
- A player must win by at least 2 points at the game level
- A game is won by the first player to win 4 points with a 2-point lead
- A set is won by the first player to win 6 games with a 2-game lead
- Deuce occurs when both players have 3 points (40-40)
- Advantage is awarded to the player who wins the point after deuce
- Serving rules:
- The first serve of the match is by Player 1
- The serve alternates after each point
- Only the serving player can score an Ace or commit a Fault
- Two consecutive faults result in a Double Fault, awarding the point to the opponent
This project is open source and available under the MIT License.