Code sharing | Scoreboard


Table of Contents
Scoreboard
This is a real-time, flexible web application for event scoring statistics
ยฉ 2025 Scoreboard
Project Release Page
- My home page:
- GitHub:
Preview
- ๐งฎ Scoreboard
Demonstration
-
Clicking on a username in the points list that does not belong to you will open the transfer page.
Figure 1. Transfer page
-
Clicking the “ๆฌๅฑ่ฎฐๅฝ” button will allow you to view the score transaction details for this round.
Figure 2. Score List and Current Round Record
-
Clicking the “็งฏๅๅๅๅพ” button will allow you to view the complete score variation chart for this competition room.
Figure 3. Score List and Score Variation Chart
Code Repository
- This project is open-source under the MIT license.
- Click to access the GitHub repository.
Features
-
Home Page
- Users can select from an existing user list or add new users.
- Create new competitions or join existing ones.
- Set initial scores for all users when creating a competition (default is 50 points).
- Supports โzero-sumโ and โnon-zero-sumโ scoring modes.
- Optional password protection for user accounts (6-digit numeric).
-
Competition Room Page
- Displays scores and rankings for all users in the competition.
- Highlights the current user.
- The host user is marked with a special identifier (๐).
- Click on other users to transfer points.
- Real-time automatic updates of the score list.
- Displays score changes from the previous round.
- View the transaction records for the current round.
- View the score variation chart.
- Supports negative score recording, allowing users to transfer more points than they possess.
-
Competition Management
- The host can control the “Next Round” and “Settlement” functions.
- Supports multi-round competition records.
- Generates detailed settlement reports.
- Guest mode allows non-participants to watch the competition.
Installation and Running
Prerequisites
- Python 3.6+
- Flask
Install Dependencies
pip install flask
Run the Application
Execute the following command using Python:
python app.py
After starting, access the application in your browser at http://127.0.0.1:16868.
Project Structure
/
โโโ app.py # Main Flask application
โโโ /templates/ # HTML templates
โ โโโ index.html # Home page
โ โโโ room.html # Room page
โ โโโ error.html # Error page
โโโ /static/ # Static resources
โ โโโ /css/ # Stylesheets
โ โโโ /js/ # JavaScript files
โ โโโ chart-manager.js # Chart management
โ โโโ logs-manager.js # Log management
โ โโโ room-manager.js # Room management
โ โโโ settlement.js # Settlement functions
โ โโโ main.js # Main script
โโโ /data/ # Stores competition data (JSON format)
User Instructions
-
Create or Join Competitions
- Select an existing user or add a new user.
- Optionally add a 6-digit numeric password for account protection.
- Set initial scores (default is 50 points) and choose between zero-sum and non-zero-sum modes when creating a competition.
- Click the “Create Competition,” “Join Competition,” or “Watch Competition” buttons.
-
Operations within the Competition Room
- Point Transfer: Click on another user, enter the transfer amount, and confirm.
- View Records: Click “Current Round Record” to see transfer details for the ongoing round.
- Score Chart: Click “Score Variation Chart” to view score trends.
- Next Round: The host can click “Next Round” to start a new round of competition (when available).
- Settlement: The host can click “Settlement” to generate a report for the current phase (when available).
-
Special Features
- Guest Mode: No registration required; allows real-time viewing of competition progress.
- Settlement Reports: Expand to view details of historical settlement reports.
- Host Permissions: Control over the competition process.
Security and Data
- All data is stored in JSON format within the data directory.
- Optional password protection for user accounts.