SharedTools.Scoreboard
0.0.19
See the version list below for details.
dotnet add package SharedTools.Scoreboard --version 0.0.19
NuGet\Install-Package SharedTools.Scoreboard -Version 0.0.19
<PackageReference Include="SharedTools.Scoreboard" Version="0.0.19" />
<PackageVersion Include="SharedTools.Scoreboard" Version="0.0.19" />
<PackageReference Include="SharedTools.Scoreboard" />
paket add SharedTools.Scoreboard --version 0.0.19
#r "nuget: SharedTools.Scoreboard, 0.0.19"
#:package SharedTools.Scoreboard@0.0.19
#addin nuget:?package=SharedTools.Scoreboard&version=0.0.19
#tool nuget:?package=SharedTools.Scoreboard&version=0.0.19
Scoreboard
A dynamic web-based scoreboard application built as a SharedTools module for ASP.NET Core. This application provides real-time score tracking with persistent storage using Azure Blob Storage.
Overview
The Scoreboard application is built using a modular architecture that separates the scoreboard functionality into a loadable module (Scoreboard.App
) and a lightweight host application (Scoreboard.Web
). This design allows the scoreboard to be:
- Dynamically loaded - The module can be loaded at runtime from NuGet packages
- Self-contained - All assets, dependencies, and functionality are packaged together
- Reusable - Can be easily integrated into other ASP.NET Core applications
- Isolated - Module dependencies don't conflict with the host application
Features
- Real-time Score Tracking - Keep track of scores for multiple players
- Persistent Storage - Game history saved to Azure Blob Storage
- Responsive Design - Works on desktop and mobile devices
- Audio Feedback - Buzzer sounds for game events
- Customizable Players - Add, remove, and manage player profiles
- Full-screen Mode - Optimized display for presentations
- Rate Limiting - Built-in protection against API abuse
Project Structure
Scoreboard/
└── src/
├── Scoreboard.App/ # The scoreboard module
│ ├── ScoreboardModule.cs # Module entry point implementing IApplicationPartModule
│ ├── ScoreboardApiMethods.cs # API endpoints for the module
│ └── wwwroot/ # Static assets (HTML, CSS, JS, audio)
│ ├── index.html # Main scoreboard UI
│ ├── app.js # Client-side JavaScript
│ ├── styles.css # Styling
│ ├── audio/ # Sound effects
│ └── icons/ # UI icons
│
└── Scoreboard.Web/ # The host application
└── Program.cs # Minimal host for loading modules
Quick Start
Prerequisites
- .NET 10.0 SDK or later
- Azure Storage Account (or use local development storage)
- Visual Studio 2022 or VS Code (optional)
Running Locally
Clone the repository
git clone https://github.com/andrewboudreau/Scoreboard.git cd Scoreboard
Configure Azure Storage (optional - for persistence)
Update
src/Scoreboard.Web/appsettings.json
:{ "BlobStorage": { "ConnectionString": "UseDevelopmentStorage=true", "ContainerName": "scoreboard-data" } }
Build and run
dotnet build cd src/Scoreboard.Web dotnet run
Open in browser Navigate to
http://localhost:5000/Scoreboard/
Development
Building the Module
The Scoreboard.App module is automatically packed to the local NuGet feed during Debug builds:
cd src/Scoreboard.App
dotnet pack -c Debug
This outputs the package to C:\LocalNuGet
for local testing.
Module Architecture
The scoreboard is implemented as a SharedTools module following these patterns:
Module Class (
ScoreboardModule.cs
)- Implements
IApplicationPartModule
- Registers services (Azure Blob Storage, Rate Limiting)
- Maps API endpoints with
/Scoreboard/
prefix - Configures middleware
- Implements
API Methods (
ScoreboardApiMethods.cs
)- Static methods for handling HTTP requests
- Upload game history to blob storage
- Test blob storage connectivity
Static Assets (
wwwroot/
)- Served via
/_content/Scoreboard/
path - Includes HTML, CSS, JavaScript, and audio files
- Packaged as embedded resources in the module
- Served via
Testing the Module
The Scoreboard.Web
project serves as a test host:
// Program.cs - Minimal host application
await builder.AddApplicationPartModules(["ScoreboardModule"]);
app.UseApplicationPartModules();
Configuration
Azure Blob Storage
Configure blob storage in appsettings.json
:
{
"BlobStorage": {
"ConnectionString": "DefaultEndpointsProtocol=https;AccountName=...",
"ContainerName": "scoreboard-data"
}
}
For local development, use the Azure Storage Emulator:
{
"BlobStorage": {
"ConnectionString": "UseDevelopmentStorage=true",
"ContainerName": "scoreboard-data"
}
}
Rate Limiting
The module includes built-in rate limiting:
- 6 requests per minute per IP address
- Applied only to
/Scoreboard/
endpoints - Returns HTTP 429 when limit exceeded
API Endpoints
GET /Scoreboard/
- Main scoreboard UI (redirects to index.html)POST /Scoreboard/api/upload-history
- Upload game history to blob storageGET /Scoreboard/api/test-blob-connection
- Test blob storage connectivity
Publishing
To Local NuGet Feed
cd src/Scoreboard.App
dotnet pack -c Debug
To NuGet.org
- Update version in
Directory.Build.props
- Run the GitHub Actions workflow "Tag and Publish"
- Package will be published to NuGet.org
See MODULE_PUBLISH.md for detailed publishing instructions.
Integration
To use the Scoreboard module in another ASP.NET Core application:
Add NuGet package
dotnet add package Scoreboard.App
Load the module
await builder.AddApplicationPartModules(["ScoreboardModule"]);
Activate modules
app.UseApplicationPartModules();
Configure blob storage in your host's
appsettings.json
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE.txt file for details.
Related Documentation
- SharedTools Module System - Overview of the module loading system
- Publishing Modules - Guide for publishing to NuGet
- Migration Guide - Converting existing projects to modules
- Architecture Overview - Detailed technical documentation
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Storage.Blobs (>= 12.26.0-beta.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.