The Sports League Management System is a comprehensive tool designed to manage data associated with sports leagues, including teams, players, coaches, referees, matches, scores, and standings. This project leverages real-time data integration, ensuring accuracy and efficiency in managing sports league data.
- Project Description
- Features
- Technologies Used
- Installation
- Usage
- Database Schema
- ER Diagram
- Screenshots
- License
The Sports League Management System aims to manage comprehensive data associated with sports leagues. The project utilizes real-time data from football-data.org, maintaining an updated database with minimal manual data entry, enhancing the system's efficiency and reliability.
- Real-time data integration
- Management of teams, players, coaches, referees, matches, scores, and standings
- User-friendly interface for administrators and users
- Detailed search and filtering options
- Secure authentication and authorization
- Modular design for easy maintenance and scalability
- Frontend: HTML, CSS (Bootstrap), JavaScript
- Backend: Flask (Python framework)
- Database: PostgreSQL
- Other Libraries: Requests, Gunicorn, Psycopg2, Python-Dotenv, Werkzeug
- Docker and Docker Compose installed on your system
- Git for cloning the repository
-
Clone the repository:
git clone https://github.com/yourusername/sports-league-management.git cd sports-league-management
-
Set up the environment variables:
# The setup script will automatically create .env from .env.example if it doesn't exist cp .env.example .env
Edit the
.env
file and set your environment variables:POSTGRES_USER
: Database usernamePOSTGRES_PASSWORD
: Database passwordPOSTGRES_DB
: Database nameFOOTBALL_DATA_API_KEY
: Your API token from football-data.org- Other configuration variables as needed
-
Run the setup script:
chmod +x setup.sh ./setup.sh
This will:
- Check if Docker is running
- Create necessary environment files
- Build and start the Docker containers
The application will be available at http://localhost:5000
If you prefer to run the application without Docker:
-
Create and activate a virtual environment:
python3 -m venv env source env/bin/activate
-
Install dependencies using Poetry:
pip install poetry poetry install
Or using pip:
pip install -r requirements.txt
-
Set up PostgreSQL database and run the schema:
psql -U your_username -d your_database -a -f schema.sql
-
Run the application:
flask run
- Manage Users: View and modify user privileges.
- Manage Teams: Add, update, or delete teams.
- Manage Players: Add, update, or delete players.
- Manage Matches: Schedule, update, or delete matches.
- View Teams: Browse team profiles and their historical performance.
- View Players: View player profiles and performance statistics.
- View Leagues: Browse different leagues and their standings.
- View Matches: View upcoming and past matches with filtering options.
- Top Scorers: See the top scorers in various leagues.
- Search: Find specific players, teams, stadiums, and coaches by name.
The data from this system is now available as a public dataset on Kaggle: European Football Leagues Database 2023-2024
Features of the dataset:
- Complete statistics for top 5 European leagues
- Weekly automated updates
- Available in both CSV and SQLite formats
- Comprehensive documentation and usage examples
- Clean, validated data with proper relationships
The database schema is designed to minimize redundancy and ensure data integrity by using foreign keys and transactions. The main entities include users, stadiums, leagues, seasons, teams, coaches, players, matches, scores, scorers, standings, referees, and match referees.
The ER diagram illustrates the relationships between different entities in the Sports League Management System. Each table represents an entity, and the lines between them represent relationships. Primary keys are indicated by the underlined attributes, and foreign keys are shown as arrows pointing to the related primary keys.
This project is licensed under the MIT License - see the LICENSE file for details.