Skip to content

Redevil10/football-manager

Repository files navigation

title Football Manager
emoji
colorFrom indigo
colorTo red
sdk docker
app_port 7860
pinned false
license agpl-3.0
short_description Manage football teams, allocate players, track matches

Football Manager logo

Football Manager

lint tests codecov python

A web app for managing amateur football rosters, balancing teams, and tracking matches.

Live Demo: redevil10-football-manager.hf.space — click Try as Guest to explore

Features

  • Player Management — Add/edit players with 41 attributes across Technical, Mental, Physical, and Goalkeeper categories
  • Team Allocation — Auto-balance players into teams based on overall scores
  • Match Tracking — Create matches, import signups, record goals/assists/events
  • Leagues & Clubs — Multi-club support with role-based access (viewer/manager/admin)
  • Smart Import — AI-powered signup parsing via Gemini API (optional)
  • Persistent Storage — Auto-backup to Hugging Face Datasets every 15 minutes

Tech Stack

Layer Technology
Backend FastHTML (Python 3.13+)
Database SQLite + HF Datasets backup
Frontend HTML + HTMX
Deployment Docker on Hugging Face Spaces
Package Manager uv

Quick Start

# Install dependencies
uv sync --extra dev

# Run locally (http://localhost:8000)
uv run python main.py

# Run tests
uv run pytest

# Lint & format
uv run ruff check . --fix && uv run ruff format .

Environment Variables

Variable Required Description
HF_TOKEN On HF Spaces Hugging Face backup token
SECRET_KEY No Session secret (auto-generated if unset)
GEMINI_API_KEY No Enables AI-powered Smart Import

Project Structure

├── main.py              # Entry point
├── core/                # Config, styles, auth utilities
├── db/                  # Database operations (SQLite)
├── logic/               # Business logic (scoring, allocation, import)
├── render/              # HTML rendering functions
├── routes/              # HTTP route handlers
├── migrations/          # Database migrations
└── tests/               # pytest test suite

How Team Allocation Works

Players are sorted by overall score (10–200), then distributed to minimize the score gap between teams. Players beyond the team capacity become substitutes, split evenly.

License

AGPL-3.0 — see LICENSE for details.

About

Football team management tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages