mehdihadeli/game-leaderboard-microservices
50.3
Weak · 21 September 2026
11.4k
lines of production code
C#
with TypeScript
4
measurements over time
What this system is
This system is a real-time leaderboard service that manages player scores and game events. It exposes APIs to track, update, and retrieve player rankings, utilizing a flexible caching architecture that supports read-through, write-through, and write-behind strategies across Redis and SQL databases. The platform delivers live score updates to clients via SignalR and processes incoming game events to maintain accurate, up-to-date leaderboards.
Features
Add account login and home page features
Introduced a new login flow for the accounts feature, including a login form with username and password validation, and a home page that displays the authenticated user's profile details such as username, first name, last name, and email. The home page also includes a logout mechanism that clears the local storage token and redirects to the login page.
src/Client/src/app/features/accounts, src/Client/src/app/features/home · high confidence
Add global score and rank retrieval endpoint
A new API endpoint has been introduced to retrieve a player's global score and rank, returning the player's position along with their immediate neighbors in the leaderboard. The implementation leverages a MediatR handler that supports a read-through cache strategy, allowing the system to fetch data from Redis or fall back to the EF Core database if the cache is cold.
src/Server/Services/LeaderBoard.GameEventsProcessor/PlayerScores/Features/GettingGlobalScoreAdnRank · high confidence
Add player score and game event endpoints
Added new endpoints and handlers for managing player scores and game events. This includes a GET endpoint to retrieve a player's global score and rank, a POST endpoint to add or update a player's score, a GET endpoint to fetch a range of scores and ranks, and a POST endpoint to create game events that are published to RabbitMQ via an outbox pattern.
(repo-wide) · high confidence
Added .devcontainer configuration for .NET 9 development
Added a new .devcontainer directory containing a Dockerfile, devcontainer.json, and supporting scripts to configure a local development environment for .NET 9. The configuration sets up a .NET 9 runtime, installs necessary VS Code extensions (including C\# Dev Kit and CSharpier), configures the Visual Studio Light theme, and includes post-create scripts to install fonts, trust HTTPS certificates, and set up the Aspire project templates.
.devcontainer · high confidence
Added database migration infrastructure for inbox/outbox and read models
The LeaderBoard.DbMigrator project was introduced to handle database schema evolution, including the initial migration for the MassTransit inbox/outbox tables and the Leaderboard read model. This includes new DbContext classes, entity configurations, and migration scripts that ensure the database schema is updated to support reliable message processing and read-model projections.
src/Server/Shared · high confidence
Introduce game event processing service with player score management
The GameEventsProcessor service is introduced to handle game events and manage player scores. It provides HTTP endpoints to add or update player scores, which are then processed via MediatR commands. The system supports multiple caching strategies (cache-aside, write-through, write-behind) using Redis and Entity Framework Core, with projections updating both SQL and Redis read models. A message consumer listens for external game events to trigger score updates, and a data seeder initializes the cache from the database.
src/Server/Services/LeaderBoard.GameEventsProcessor · high confidence
Introduce read-through and write-behind cache strategies for the leaderboard system
The \src/Server/CacheStrategies\ directory now contains three distinct implementations for managing player score data: a read-through strategy that serves cached data from Redis with a fallback to a Postgres database, a write-behind strategy that asynchronously persists updates to EventStoreDB and Postgres via multiple backends (Redis Streams, Pub/Sub, and message brokers), and a write-through strategy. These changes introduce new DTOs (e.g., \PlayerScoreDto\, \PlayerScoreDetailDto\), service interfaces (\IReadThrough\, \IWriteBehind\), and host configurations (\Program.cs\) for each strategy, enabling users to choose how their leaderboard data is cached and synchronized.
src/Server/CacheStrategies · high confidence
Introduce real-time leaderboard updates via SignalR
A new SignalR-based service has been added to the server, enabling real-time push notifications for player score updates. The implementation includes a \StronglyTypedPlayerScoreHub\ to manage WebSocket connections, a \HubService\ to coordinate updates, and a \PlayersRankAffectedConsumer\ that listens for rank-change messages and triggers client updates. The service also introduces DTOs for player scores and neighbors, an HTTP client to fetch global scores, and configuration for JWT authentication and CORS.
src/Server/Services/LeaderBoard.SignalR · high confidence
Introduce real-time player score updates via SignalR
The client application now supports real-time updates for player scores using SignalR. A new \SignalRService\ establishes a persistent connection to the server hub, allowing the \PlayerScoreComponent\ to receive live score updates and initial state. The \AppRoutingModule\ and \PlayersRoutingModule\ define routes for the player score and registration pages, while the \AuthenticationService\ and \JwtInterceptor\ ensure that the SignalR connection and HTTP requests are authenticated with a JWT token. Additionally, a \CreatePlayerComponent\ allows new users to register, and the \ContentLayoutComponent\ provides the main application shell.
src/Client, src/Client/src/app/features/players · high confidence
New endpoints for retrieving player group and range leaderboard scores
Added new API endpoints and corresponding MediatR handlers for fetching player group global scores and ranks, as well as range-based scores and ranks. The \LeaderBoard.ReadThrough\ module exposes these via \MapGetPlayerGroupGlobalScoresAndRanksEndpoints\ and \MapGetRangeScoresAndRanksEndpoint\, routing to handlers that delegate to the \IReadThrough\ service. In the \LeaderBoard.GameEventsProcessor\ module, a parallel implementation of the player group scores feature was added, which conditionally uses the \IReadThroughClient\ or falls back to individual score lookups via the mediator, controlled by the \LeaderBoardOptions.UseReadThrough\ setting. These changes introduce the underlying logic and HTTP routes for querying specific sets of player scores and their ranks.
src/Server/CacheStrategies/LeaderBoard.ReadThrough/PlayerScores/Features/GettingPlayerGroupGlobalScoresAndRanks, src/Server/CacheStrategies/LeaderBoard.ReadThrough/PlayerScores/Features/GettingRangeScoresAndRanks, src/Server/Services/LeaderBoard.GameEventsProcessor/PlayerScores/Features/GettingPlayerGroupGlobalScoresAndRanks · high confidence
Repository initialization and configuration
The repository was initialized with essential configuration files, including .editorconfig for C\# code formatting and style rules, .csharpierrc for CSharpier formatting, stylecop.json for static code analysis, and global.json specifying .NET SDK 9.0.201. The solution file (leaderboard.sln) was restructured to organize projects into logical folders (cache-strategies, shared, services, deployments) and includes new project references for the microservices architecture.
(repo-wide) · high confidence
Removals
Removed LeaderBoard service and data seeding infrastructure
The LeaderBoard module's core implementation has been removed, including the ScoreController, PlayerScoreService, and associated models, DTOs, and configuration classes. This eliminates the ability to add, retrieve, and rank player scores via the API, as well as the data seeding logic that populated Redis and the database with initial test data.
src/LeaderBoard · high confidence
Behavioural changes
Enforced commit message validation and code formatting on commit
The repository now enforces commit message standards and code formatting before changes are accepted. A new commit-msg hook runs commitlint to validate messages, while a new pre-commit hook automatically formats C\# code using CSharpier and stages the results.
.husky · high confidence
Updated write-read cache-aside diagram
The write-read cache-aside diagram has been updated and moved to a new location. The visual representation of the cache-aside pattern has been modified, with changes to element positions, versions, and bound elements, reflecting an update to the architectural documentation.
assets · medium confidence
Dependencies
Upgrade to .NET 9 and update dependencies
The project has been upgraded to .NET 9, with all server-side components now targeting the \net9.0\ framework. This change includes updating the .NET SDK and related packages to their latest versions, such as \Microsoft.EntityFrameworkCore\ 9.0.7, \Swashbuckle.AspNetCore\ 9.0.3, and \Microsoft.AspNetCore.OpenApi\ 9.0.7. Additionally, the frontend client dependencies have been updated, including Angular 16 and SignalR packages. The legacy \LeaderBoard.csproj\ targeting .NET 8 has been removed.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 49 → 50 (+1.4)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 86 → 68 (-17.9)
- Architecture 93 → 93 (+0.0)
- Maturity 74 → 78 (+3.7)
- Readiness 34 → 36 (+2.2)
- Security 67 → 62 (-4.8)
- Domain Modelling 60 → 66 (+6.1)
- Event-Driven 81 → 81 (+0.0)
- Event Sourcing 68 → 68 (+0.0)
- Accessibility 56 → 57 (+1.1)
- Performance 71 → 71 (+0.0)
Resolved (29)
- Bounded contexts not declared
- Coverage not included — suite not readable by the collector
- Duplicated block (10 lines × 2) (src/Server/Shared/LeaderBoard.SharedKernel/Reflection/ReflectionUtilities.cs)
- Duplicated block (11 lines × 2) (src/Server/Shared/LeaderBoard.SharedKernel/EventStoreDB/Events/EventStoreDBEventMetadataJsonConverter.cs)
- Duplicated block (12 lines × 2) (src/Server/CacheStrategies/LeaderBoard.ReadThrough/PlayerScores/Features/GettingGlobalScoreAndRank/GetGlobalScoreAndRankEndpoint.cs)
- Duplicated block (12 lines × 2) (src/Server/CacheStrategies/LeaderBoard.ReadThrough/PlayerScores/Features/GettingPlayerGroupGlobalScoresAndRanks/GetPlayerGroupGlobalScoresAndRanksEndpoint.cs)
- Duplicated block (12 lines × 2) (src/Server/CacheStrategies/LeaderBoard.ReadThrough/PlayerScores/Features/GettingRangeScoresAndRanks/GetRangeScoresAndRanksEndpoint.cs)
- Duplicated block (12 lines × 2) (src/Server/Shared/LeaderBoard.SharedKernel/Core/Projections/ProjectionPublisher.cs)
- Duplicated block (13 lines × 3) (src/Server/CacheStrategies/LeaderBoard.WriteBehind/Shared/Projections/EFCorePlayerScoreReadModelProjection.cs)
- Duplicated block (15 lines × 2) (src/Server/CacheStrategies/LeaderBoard.ReadThrough/Shared/Services/ReadThrough.cs)
- Duplicated block (15 lines × 2) (src/Server/CacheStrategies/LeaderBoard.ReadThrough/Shared/Services/ReadThrough.cs)
- Duplicated block (15 lines × 2) (src/Server/Services/LeaderBoard.GameEventsProcessor/Shared/Services/PlayerScoreService.cs)
- Duplicated block (15 lines × 2) (src/Server/Services/LeaderBoard.GameEventsProcessor/Shared/Services/PlayerScoreService.cs)
- Duplicated block (16 lines × 3) (src/Server/CacheStrategies/LeaderBoard.ReadThrough/Shared/Services/ReadThrough.cs)
- Duplicated block (19 lines × 2) (src/Server/CacheStrategies/LeaderBoard.WriteThrough/PlayerScore/Features/AddingOrUpdatingPlayerScore/AddOrUpdatePlayerScoreEndpoint.cs)
- Duplicated block (20 lines × 2) (src/Server/Shared/LeaderBoard.SharedKernel/Core/Data/Ef/Projections/EfProjectionBase.cs)
- Duplicated block (22 lines × 2) (src/Server/Services/LeaderBoard.GameEventsProcessor/PlayerScores/Features/AddingOrUpdatingPlayerScore/AddOrUpdatePlayerScore.cs)
- Duplicated block (7 lines × 2) (src/Server/Shared/LeaderBoard.SharedKernel/Core/Projections/ProjectionPublisher.cs)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 9 more
New (116)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- …and 96 more
API surface
- Unchanged — 3 HTTP endpoints
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
mehdihadeli/game-leaderboard-microservices was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 4b897da1de3aca3eeec139be78d30454528b44a1 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.