A comprehensive web application for tracking floorball game statistics, player performance, team management, and season organization. Built with Flask and Bootstrap 5, featuring bilingual support (English/Italian).
- Multi-Season Support: Organize games and rosters by season (e.g., 2024-25, 2025-26)
- Season Filtering: Filter games, stats, and rosters by specific seasons
- Automatic Season Detection: System automatically identifies available seasons from your data
- Season Migration Tool: Easy migration of existing data to season-based structure
- Create Game: Add games with season, category, teams, date, referees, lines, and goalies
- Modify Game: Edit all game details including lineup and formations
- Delete Game: Remove games from the database (with confirmation)
- Reset Stats: Reset all player, goalie, and period stats for a game to zero
- Game Filtering: Filter by season and team/category
- Season-Based Categories: Category dropdown loads dynamically based on selected season
- Plus/Minus Tracking: Increment or decrement player plus/minus stats
- Goals & Assists: Track goals and assists (automatically updates period results)
- Unforced Errors: Track player mistakes and turnovers
- Line Actions: Apply stats to entire lines with a single click
- Real-time Updates: All stats update immediately in the interface
- Saves Tracking: Record saves for each goalie
- Goals Conceded: Track goals against (affects period results)
- Save Percentage: Automatic calculation of save percentage per game and overall
- Multiple Goalies: Support for multiple goalies per game
- Opponent Goalie Tracking: Optional tracking of opponent goalie stats
- 4 Periods: Support for periods 1, 2, 3, and Overtime
- Period Switching: Easy navigation between periods during game
- Automatic Score Calculation: Real-time score updates based on goal tracking
- Period Summaries: View goals per period with running totals
- Comprehensive Stats Tables:
- Plus/Minus standings
- Goals & Assists with totals
- Unforced Errors tracking
- Goalie Save Percentages
- Sortable Tables: Click column headers to sort by any metric
- Multi-Level Filtering:
- Filter by season
- Filter by team/category
- Hide players with zero stats
- Per-Game Breakdown: See individual game performance for each player
- Season-Based Rosters: Manage separate rosters for each season and category
- Player Details: Track number, name, surname, nickname, position, and category (tesser)
- Bulk Import: Import entire rosters from CSV or formatted text
- Player CRUD: Add, edit, and delete players individually
- Position Organization: Players organized by position (A/C/D/P)
- Automatic File Naming: Rosters saved as
roster_SEASON_CATEGORY.json
- Convocation System: Select which players are called up for each game
- 4 Playing Lines: Define L1, L2, L3, L4 with position-based selection
- Special Formations:
- PP1, PP2 (Power Play)
- BP1, BP2 (Box Play/Penalty Kill)
- 6vs5 (Extra Attacker)
- Stress Line (High-pressure situations)
- Starting Goalies: Select up to 2 starting goalies
- Category Counters: Real-time count of players by category (U18/U21/U21 DP/U16)
- Position Counters: Track players by position (A/C/D/P)
- Hide Inactive Players: Filter view to show only selected players
- Print-Friendly View: Clean layout for printing game sheets
- PIN Protection: Secure access via configurable PIN (set via
FLOORBALL_PINenv variable) - Bilingual Interface: Full English and Italian language support
- Language Toggle: Switch languages on the fly from any page
- Responsive Design: Optimized for desktop, tablet, and mobile
- Bootstrap 5: Modern, clean interface with intuitive navigation
- Edit Mode Toggle: Separate viewing and editing modes
- Keyboard Shortcuts: Quick actions via keyboard (where applicable)
- Success/Error Messages: Clear feedback for all actions
- Confirmation Dialogs: Safety checks for destructive operations
- Python 3.8 or higher
- pip (Python package manager)
-
Clone the repository:
git clone https://github.com/dennyschwender/floorball_stats_tracker.git cd floorball_stats_tracker -
Create and activate a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up your PIN (optional, default is "1234"):
export FLOORBALL_PIN="your_secure_pin"
-
Run the application:
python app.py
-
Open your browser and navigate to:
http://127.0.0.1:5000
-
Build and start the container:
docker-compose up -d
-
Access the application at
http://localhost:5000 -
Stop the container:
docker-compose down
-
Build the image:
docker build -t floorball-stats-tracker . -
Run the container:
docker run -d -p 5000:5000 \ -e FLOORBALL_PIN="your_secure_pin" \ -v $(pwd)/gamesFiles:/app/gamesFiles \ -v $(pwd)/rosters:/app/rosters \ floorball-stats-tracker
All data is stored in JSON format for easy backup and portability:
- Games:
gamesFiles/games.json- All game data including stats and lineups - Rosters:
rosters/roster_SEASON_CATEGORY.json- Team rosters by season and category - Backups:
gamesFiles/games_backup_*.json- Automatic backups created during migrations
{
"id": 0,
"season": "2025-26",
"team": "U21",
"home_team": "Team A",
"away_team": "Team B",
"date": "2025-11-14",
"referee1": "Referee Name",
"referee2": "Referee Name",
"lines": [["1 - Player Name", ...], ...],
"goalies": ["30 - Goalie Name"],
"plusminus": {"1 - Player Name": 2},
"goals": {"1 - Player Name": 1},
"assists": {"1 - Player Name": 1},
"unforced_errors": {"1 - Player Name": 0},
"saves": {"30 - Goalie Name": 25},
"goals_conceded": {"30 - Goalie Name": 3},
"result": {
"1": {"home": 2, "away": 1},
"2": {"home": 1, "away": 2},
"3": {"home": 0, "away": 0},
"OT": {"home": 0, "away": 0}
},
"current_period": "1"
}[
{
"id": "uuid-string",
"number": 7,
"surname": "Doe",
"name": "John",
"nickname": "JD",
"position": "C",
"tesser": "U21"
}
]Located in the scripts/ directory:
Migrate existing games and rosters to use season identifiers.
python scripts/assign_season.py 2025-26This will:
- Rename
roster_U21.jsonβroster_2025-26_U21.json - Add
"season": "2025-26"to all games - Create automatic backups
Create a timestamped backup of your games file.
python scripts/backup_games.pyCreates: gamesFiles/games_backup_YYYYMMDD_HHMMSS.json
Perform data structure migrations and updates.
python scripts/migrate_games.pyFix file paths after deployment (for server environments).
bash scripts/fix_remote_migration.sh- Set Your Season: When creating your first roster or game, establish a season naming convention (e.g., "2025-26")
- Create Rosters: Go to Team Roster β Create New Roster β Enter season and category
- Import Players: Use Bulk Import or add players individually
- Create Games: Navigate to Create Game β Select season β Select category β Fill in game details
- Track Stats: During the game, use the game view to track stats in real-time
- Use consistent season naming: "YYYY-YY" format (e.g., "2024-25", "2025-26")
- Create rosters for each season separately
- Filter views by season to focus on current data
- Use the migration script when transitioning seasons
- Keep player numbers unique within a category
- Use full names for better tracking
- Set correct positions for proper game lineup organization
- Update rosters at the start of each season
- Create game with season and category
- Select players for convocation
- Set up your 4 lines and special formations
- Choose starting goalies
- Print game sheet if needed
- During game: track stats by period
- Review stats overview after game
FLOORBALL_PIN: Access PIN for the application (default: "1234")FLASK_ENV: Set to "development" for debug mode (default: "production")
The application supports customization through:
- Categories: Modify
CATEGORIESinapp.pyto add/remove team categories - Periods: Modify
PERIODSinapp.pyto change period names - Translations: Edit translation dictionaries in
app.pyfor English and Italian - Styling: Customize CSS in
templates/files or add tostatic/folder
See CONTRIBUTING.md for guidelines on:
- Code style and structure
- Testing requirements
- Pull request process
- Bug reporting
See MIGRATION_GUIDE.md for detailed instructions on:
- Migrating from old versions
- Data structure changes
- Season system migration
- Troubleshooting common issues
This project is licensed under the MIT License - see the LICENSE file for details.
Issue: Categories not loading when creating a game
- Solution: Ensure you've selected a season first. Categories load dynamically based on the selected season.
Issue: Roster file not found
- Solution: Check that your roster file follows the naming convention:
roster_SEASON_CATEGORY.json
Issue: Stats not saving
- Solution: Ensure
gamesFiles/directory has write permissions
Issue: PIN not working
- Solution: Check that
FLOORBALL_PINenvironment variable is set correctly
If you experience data issues:
- Check
gamesFiles/for automatic backups (games_backup_*.json) - Restore from the most recent backup
- Use migration scripts to update data structure if needed
For issues, questions, or feature requests:
- Open an issue on GitHub
- Check existing documentation in
docs/folder - Review MIGRATION_GUIDE.md for upgrade help
Version: 2.0.0 (Season Management Update) Last Updated: November 2025 Maintainer: Denny Schwender