π Overview
This application is a comprehensive match statistics tracking system designed for tchoukball. It consists of two main pages:
π Setup Page
Configure match details
index.html
β
π Game Page
Track live statistics
game.html
π Match Setup
Configure date, time, location, teams, and players before starting.
β±οΈ Track Match Time
Control game timer with play/pause, adjustable speed, and manual adjustments.
π― Record Scores
Track team scores with automatic updates from Point and Lost events.
π₯ Manage Players
Track up to 12 players per team with playing/bench positions and swaps.
π Collect Statistics
Record multiple stat types per player with field position tracking.
πΊοΈ Field Positioning
Click on the field to record where events occurred with real-world coordinates.
π Advanced Filtering
Filter field events by stat type, team, or individual players.
πΎ Save & Load
Auto-save games and manually save/load game states.
βοΈ Database Sync
Automatically sync events and scores to a database in real-time.
π Setup Page (index.html)
The Setup Page is the entry point for the application. You must configure match details here before starting to track statistics.
Required Fields
The following fields are mandatory to start a match:
| Field |
Description |
| Date * |
Match date (required for saving and identification) |
| Home Team Name * |
Name of the home team (displayed throughout the game) |
| Away Team Name * |
Name of the away team (displayed throughout the game) |
| 5+ Players per Team * |
Minimum 5 player names entered for each team |
Optional Fields
| Field |
Description |
| Time |
Match start time |
| Location |
Venue or location of the match |
| Team Colors |
Color picker for each team (visual identification) |
Loading Players
You can enter player names manually or load from a file:
- Click π Load next to the team name
- Select a
.txt file with player names (one name per line)
- Players are loaded into the form (5-12 players per team)
Loading Previous Games
From the setup page, you can resume previous matches:
- π Load Auto-save - Resume the last auto-saved game
- π Load from File - Load a previously saved JSON file
Starting the Match
- Fill in all required fields (date, team names, 5+ players each)
- Click βΆ Start Match
- You'll be redirected to the Game Page with your configuration
β οΈ Validation: The "Start Match" button is disabled until all required fields are filled. Missing fields will be highlighted in red.
π Game Page (game.html)
The Game Page is where you track live match statistics. It shows your team names, colors, and only the players you entered in setup.
Match Info Bar
At the top of the page, you'll see:
- β Setup - Return to the setup page
- Match information: Date, time, and location
Team Display
Your teams are displayed with:
- Actual team names (not generic "Home" / "Away")
- Custom team colors you selected
- Only the players you entered (no empty placeholder slots)
Interface Layout
The game interface is divided into:
- Header: Scoreboard and timer controls
- Left Panel: Home team players (playing + bench)
- Center: Field area for position tracking
- Right Panel: Away team players + Event history
π‘ Mobile View: On smaller screens, the interface switches to a tab-based layout for easier navigation.
β±οΈ Timer Controls
Timer Display
The timer is located at the center of the header, showing time in MM:SS format. Default time is 12:00 minutes.
Control Buttons
| Button |
Function |
| -1 min |
Decrease time by 1 minute |
| -1 sec |
Decrease time by 1 second |
| βΆοΈ / βΈ |
Play/Pause the timer |
| +1 sec |
Increase time by 1 second |
| +1 min |
Increase time by 1 minute |
Speed Control
Adjust playback speed from 0.5x to 2x using the dropdown menu:
- 0.5x - 0.75x: For detailed review or training
- 1x: Real-time game tracking (default)
- 1.25x - 2x: Fast-forward through breaks
Period Control
Track which period of the match you're in using the period buttons (β / βΆ).
Manual Time Edit
Click directly on the timer display to enter a specific time (only when timer is stopped).
π― Scoring System
Score Controls
Each team has score controls in the header:
- β Decrease team score by 1
- Score display (center)
- + Increase team score by 1
Automatic Score Updates
Scores update automatically when recording certain stats:
| Stat Type |
Score Effect |
| Point |
+1 to player's team |
| Perdu / Lost |
+1 to opponent's team |
β
Smart Scoring: When you remove a "Point" or "Perdu" event from history, the scores are automatically reverted.
π₯ Player Management
Player Setup
Players are configured on the Setup Page before the match. Only the players you entered will appear on the Game Page.
- Minimum: 5 players per team required
- Maximum: 12 players per team
- First 7 players: Start as playing players
- Remaining players: Start on the bench
Editing Player Names (Game Page)
- Stop the timer
- Click directly on a player's name (not the card)
- Enter new name in the prompt dialog
- Name is updated and game auto-saves
Swapping Players
Use the bench-first swap system:
- Click a bench player - card turns yellow
- Click a playing player - players swap positions
- Stats move with the players
β οΈ Swap System Rules:
- Must click bench player first
- Cannot swap two bench players or two playing players
- Cannot swap players between teams
π Player Statistics
Default Stat Types
The system tracks these statistics per player:
| Stat |
Description |
Effect |
| Point |
Successful scoring attempt |
+1 team score |
| Perdu |
Lost ball/possession |
+1 opponent score |
| Bloque |
Blocked attempt |
- |
| Penetre |
Penetration into defense |
- |
| Zone |
Zone entry |
- |
| Cadre |
Shot on target |
- |
| Passe |
Successful pass |
- |
| Marcher |
Walking violation |
- |
| Autre |
Other event |
- |
| Defendu |
Defensive action |
- |
Recording Stats
- Click a playing player card - opens stats popup
- Click the stat button (e.g., "Point", "Passe")
- Optionally, click on the field to record position before selecting stat
- Stat is added to player and event history
Viewing Stats
Each player card displays current stats below their name in a compact format.
π‘ Tip: Stats are preserved when players are swapped between playing and bench positions.
πΊοΈ Field Coordinates
Field Specifications
The field represents a real tchoukball court:
- Dimensions: 25 meters Γ 15 meters
- Coordinate System: Percentage-based (scales with window size)
Recording Field Positions
- Click anywhere on the field - a dot appears
- Select a player and stat type
- The dot is saved with the event
- Coordinates are stored in percentages and real meters
Dot Colors
Dots are color-coded by stat type and have team-colored borders:
- Green: Point
- Red: Perdu/Lost
- Orange: Bloque
- Blue: Penetre
- Other colors for other stat types
β
Responsive: Dots automatically reposition when you resize the window, maintaining their relative positions on the field.
π Filtering & Analysis
Filter Types
The interface provides three types of filters below the field:
1. Stats Filter
Filter by event type (Point, Perdu, Bloque, etc.)
2. Teams Filter
Filter by team (All, Home, Away)
3. Players Filter
Filter by individual player names
Combined Filtering
All filters work together with AND logic:
Example 1
Stats: "Point" + Teams: "Home" = Shows only Home team's scoring locations
Example 2
Players: "John" + Stats: "Perdu" = Shows only John's lost balls
β οΈ Note: Filters only affect field dot visibility. Event history always shows all events.
π Event History
Event Log
All recorded events appear in chronological order, showing:
- Time: When the event occurred
- Score: Game score at that moment
- Player: Who performed the action
- Stat Type: What happened
- Coordinates: Field position in meters
Removing Events
Each event has a Γ remove button:
- Removes the event from history
- Reverts the player's stat count
- Automatically adjusts scores if it was a Point/Perdu event
- Removes the field position dot
β οΈ Warning: Removing events cannot be undone (unless you reload a saved game state).
πΎ Save & Load Games
Auto-Save
The system automatically saves every 30 seconds to browser storage.
π‘ Important: Auto-save does NOT automatically restore when you start a new match. You must explicitly click "Load Auto-save" on the Setup Page to resume.
Manual Save to File
- Click πΎ Download
- File downloads as
tchoukball_game_YYYY-MM-DD-HH-MM-SS.json
- Store safely for future use
Loading Games
From the Setup Page:
- π Load Auto-save - Resume the last auto-saved game
- π Load from File - Load a previously saved JSON file
Clear Auto-Save
Use the ποΈ Clear button on the Game Page to remove the auto-saved game from browser storage.
βοΈ Database Integration
Automatic Sync
When database integration is enabled, the application automatically:
- Creates match: On the first event, the match is created in the database
- Saves events: Each event is immediately saved to the database
- Updates scores: Score changes are synced in real-time
Manual Database Save
Click βοΈ Save to DB to manually save the current game state to the database.
Database Requirements
For database integration to work, you need:
- A configured PHP API backend
- MySQL/MariaDB database with proper tables
CONFIG.API.ENABLED = true in script.js
π‘ Note: See DATABASE_README.md for detailed setup instructions.
π‘ Tips & Tricks
Workflow Optimization
- Prepare Before Game: Set up teams and players on the Setup Page before the match starts
- Use Load Feature: Load player lists from files to save typing time
- Regular Saves: Even with auto-save, manually save important matches to files
Best Practices
- Fill All Required Fields: Ensure date, team names, and 5+ players are filled before starting
- Record Positions: Click on the field before selecting stats for better analysis
- Use Filters: Analyze team and player performance using the filter buttons
Troubleshooting
| Problem |
Solution |
| Can't start match |
Check that date, both team names, and at least 5 players per team are filled |
| Dots in wrong positions after load |
Wait for the field image to load - dots will reposition automatically |
| Can't edit player names |
Make sure timer is stopped first |
| Auto-save not loading |
Use "Load Auto-save" button on Setup Page - it won't load automatically |
| Database not saving |
Check browser console (F12) for errors. Ensure API is configured. |
β Need More Help?
For additional support:
- Browser Console: Press F12 to see detailed logs and error messages
- Refresh: Press Ctrl+R (or Cmd+R) if interface becomes unresponsive
- Database Guide: See
DATABASE_README.md for backend setup
β
You're Ready! Head to the Setup Page to configure your match and start tracking statistics!