| .. | ||
| static | ||
| templates | ||
| app.py | ||
| app.yaml | ||
| db_config.py | ||
| deploy.py | ||
| forms.py | ||
| main.py | ||
| README.md | ||
| readSettings.py | ||
| requirements.txt | ||
| tables.py | ||
| test_app.py | ||
HKFC Men's D Team - MOTM (Man of the Match) System
This is a standalone Flask application for managing Man of the Match and Dick of the Day voting for the HKFC Men's D Team hockey club.
Features
Public Section
- Voting Interface: Players can vote for MOTM and DotD via secure random URLs
- Match Comments: View and add comments from matches
- Current Holders: Display current MOTM and DotD holders
Admin Section
- Match Management: Set up upcoming matches, opposition teams, and fixtures
- Squad Management: Add/remove players from match squads
- Statistics: Record goals and assists for players
- Voting Results: View real-time voting charts and results
- Player of the Year: Track season-long MOTM/DotD statistics
Installation
- Install dependencies:
pip install -r requirements.txt
-
Configure database settings in
db_config.py -
Run the application:
python main.py
The application will be available at http://localhost:5000
Database Requirements
The application requires access to the following database tables:
_hkfcD_matchSquad- Current match squad_HKFC_players- Player databasehkfcDAdminSettings- Admin configurationhockeyFixtures- Match fixtures_hkfc_d_motm- MOTM/DotD voting results_motmComments- Match comments_clubTeams- Club and team informationmensHockeyClubs- Club logos and information
API Endpoints
Public Endpoints
/- Main index page/motm/<randomUrlSuffix>- Voting page (requires valid URL suffix)/motm/comments- Match comments/motm/vote-thanks- Vote submission processing
Admin Endpoints (Basic Auth Required)
/admin/motm- MOTM administration/admin/squad- Squad management/admin/squad/submit- Process squad selection/admin/squad/list- View current squad/admin/squad/remove- Remove player from squad/admin/squad/reset- Reset squad for new match/admin/stats- Goals and assists administration/admin/voting- Voting results charts/admin/poty- Player of the Year charts
API Endpoints
/api/vote-results- Get voting results as JSON/api/poty-results- Get Player of the Year results as JSON/admin/api/team/<club>- Get teams for a club/admin/api/logo/<club>- Get club logo URL/admin/api/fixture/<fixture>- Get fixture information
Security
- Admin sections are protected with HTTP Basic Authentication
- Voting URLs use random suffixes to prevent unauthorized access
- All admin actions require authentication
Usage
-
Admin Setup:
- Access
/admin/motmto configure upcoming matches - Use
/admin/squadto select players for the match - Activate voting to generate the public voting URL
- Access
-
Player Voting:
- Share the generated voting URL with players
- Players can vote for MOTM and DotD
- Optional comments can be added
-
Results:
- View real-time results at
/admin/voting - Track season statistics at
/admin/poty
- View real-time results at
Configuration
Update the following in db_config.py:
- Database connection details
- Cloud SQL configuration (if using Google Cloud)
- Local database settings
The application uses the same database as the main hockey results system, so ensure proper database access is configured.