Code sharing | Scoreboard

Mar 25, 2025ยท
Zihao Viston Wang
Zihao Viston Wang
ยท 2 min read
Web Application Login Page
Table of Contents

Scoreboard

This is a real-time, flexible web application for event scoring statistics

ยฉ 2025 Scoreboard

Project Release Page

Preview

Due to limited server resources, this preview address may not be permanently available. If the link becomes inactive or the service is discontinued and you wish to continue accessing it, please leave a message at the bottom of this page. I will respond promptly and will consider reactivating the service based on the circumstances.
The passwords for this service are transmitted in plaintext. To prevent potential cybersecurity incidents, please avoid using your commonly used usernames or passwords while accessing this service.

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

Features

  1. 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).
  2. 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.
  3. 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

  1. 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.
  2. 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).
  3. 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.