Skip to content
CAI
Software that uses CAICheck a score

profjordanov/sports-system

39.7

Weak · 20 September 2026

3.7k

lines of production code

C#

with JavaScript

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

JBet is a sports betting platform that allows users to register, place wagers on match outcomes, vote for teams, and post comments. It employs a CQRS and Event Sourcing architecture on the server side, utilizing ASP.NET Core with PostgreSQL and Marten, while the client is a React-based Progressive Web App. The system provides real-time updates for team voting via SignalR and enforces strict business rules such as preventing duplicate votes or bets.

Features

Added Redux authentication state management

The application now includes a Redux store to manage authentication state. This change introduces action types and creators for logging in, logging out, and loading the current user, along with an auth reducer that updates the user session and login status. The store is configured with Redux Thunk for asynchronous operations and immutable state checking, initialized with a default state indicating the user is not logged in.

client/src/redux · high confidence

Added commands and validation for placing bets on home and away teams

Users can now submit bets for specific match outcomes (home or away) via new command objects (\UserBetForHomeTeam\, \UserBetForAwayTeam\) and corresponding input models (\MatchHomeBetInput\, \MatchAwayBetInput\). These inputs enforce that the bet amount is between 3 and 1,000,000 and that the user ID, match ID, and bet selection are provided, ensuring data integrity before processing.

server/src/Jbet.Core/UserMatchBetContext · high confidence

Added domain view models for JWT tokens and user profiles

New view models have been introduced in the domain layer to structure data for API responses. JwtView now exposes a TokenString property for returning authentication tokens, while UserView provides a structured representation of user data including Id, Email, FirstName, LastName, and IsAdmin status.

server/src/Jbet.Domain/Views · high confidence

Added handler for match-specific comment creation

A new command handler (CommentMatchHandler) has been introduced to process comments associated with specific matches. This handler enforces a business rule that prevents duplicate comments from the same user on the same match, returning a conflict error if a similar comment already exists. Upon successful validation, it persists the comment to the database and publishes relevant domain events.

server/src/Jbet.Business/CommentContext · high confidence

Added handler for team voting commands

A new command handler, VoteForTeamHandler, has been introduced to process team voting requests. This component enforces a business rule that prevents duplicate votes from the same user for the same team by checking for existing records before saving. Upon successful validation, it persists the vote to the relational database and publishes the corresponding domain event.

server/src/Jbet.Business/VoteContext · high confidence

Added handlers for placing bets on home and away teams

New command handlers have been introduced for the UserMatchBetContext to support placing bets on specific match outcomes. The UserBetForHomeTeamHandler processes commands to add a home team bet, while the UserBetForAwayTeamHandler handles away team bets. Both handlers interact with the IBetsRepository to persist the wager and subsequently publish domain events to notify other parts of the system of the new bet.

server/src/Jbet.Business/UserMatchBetContext · high confidence

Added handlers for retrieving all matches and match details

New query handlers have been introduced in the MatchContext to support fetching match data. GetAllMatchesHandler retrieves a paginated list of matches and maps them to MatchView objects. GetMatchDetailsHandler fetches a specific match by ID, returning a MatchDetailsView wrapped in an Option type, and includes error handling for cases where the match is not found or mapping fails.

server/src/Jbet.Business/MatchContext · high confidence

Added match and comment view models

Introduced new domain view models to support match and comment data structures. MatchView provides a summary of matches including team names and start time, while MatchDetailsView extends this with team IDs, betting amounts, and a collection of comments. CommentView defines the structure for individual comments, including content, author username, and creation timestamp.

server/src/Jbet.Domain/Views/Match · high confidence

Added match comment submission and mapping

Users can now submit comments on specific matches via a new CommentMatch command, which validates that the content, user ID, and match ID are provided. The system also includes a mapping profile to convert Comment entities into CommentViews, ensuring the associated user's username is included in the output.

server/src/Jbet.Core/CommentContext · high confidence

Added match data retrieval queries and mapping profiles

The MatchContext now includes new query handlers for retrieving match data: GetAllMatches supports paginated retrieval of all matches with configurable start page and limit, GetMatchDetails fetches specific match information by ID returning an optional result, and a new MappingProfile configures AutoMapper to translate Match entities into MatchView and MatchDetailsView objects, including logic to calculate home and away team names and aggregate user bet amounts.

server/src/Jbet.Core/MatchContext · high confidence

Added team details query handler with voting status

A new query handler for retrieving team details has been introduced in the business layer. This handler fetches the team entity and maps it to a view model, while also checking the votes repository to determine if the current user has already voted for the team, returning a not-found error if the team does not exist.

server/src/Jbet.Business/TeamContext · high confidence

New utility files have been introduced in the client source to support common frontend operations. cookieUtils.js provides a function to retrieve specific cookie values by name. stringUtils.js adds custom trimStart and trimEnd functions for character-based string trimming. urlUtils.js introduces a joinUrlWithRoute function that safely concatenates base URLs and routes by stripping redundant slashes, leveraging the new string utilities.

client/src/utils · high confidence

Added vote submission capability for teams

Users can now submit votes for specific teams. This change introduces the core command structure (\VoteForTeam\) and its validation rules (\VoteForTeamValidator\) to ensure both a team ID and a user ID are provided, along with an HTTP request model (\VoteInput\) to accept the team ID from the client.

server/src/Jbet.Core/VoteContext · high confidence

Added web app manifest and HTML entry point for JBet

The application now includes a standard HTML entry point (index.html) and a web app manifest (manifest.json) in the public directory. This enables the JBet app to be installed as a standalone progressive web app on mobile devices and desktops, with the display mode set to standalone and the theme color configured.

client/public · high confidence

Initial Entity Framework persistence layer for sports betting domain

This change introduces the core Entity Framework configuration for the application's data model. It adds the \ApplicationDbContext\ which exposes DbSets for Matches, Teams, Players, Comments, UserMatchBets, and Votes, inheriting from ASP.NET Core Identity. It also includes \OnModelCreatingConfiguration\ to define primary key generation strategies and establish entity relationships, such as linking comments to users and matches, defining home/away team associations for matches, and configuring the many-to-many relationships for user bets and team votes.

server/src/Jbet.Persistence/EntityFramework · high confidence

Initial client application shell with routing, state management, and PWA support

The client application has been initialized with a foundational structure. This includes a React entry point that integrates Redux for state management and react-router-dom for browser history-based routing. Basic styling is applied via Bootstrap and custom CSS to constrain the layout width and style the navigation area. Additionally, a service worker implementation has been added to support Progressive Web App (PWA) features, enabling offline capabilities and faster subsequent loads in production environments.

client/src · high confidence

Initial database schema for sports betting platform

The persistence layer now includes the initial Entity Framework Core migration (20190711075422\_InitialCreate) and model snapshot, establishing the foundational database structure. This migration creates tables for ASP.NET Identity users and roles, alongside domain entities for Teams, Matches, Players, Comments, UserMatchBets, and Votes, enabling the core sports betting functionality to store and retrieve data.

server/src/Jbet.Persistence/Migrations · high confidence

Initial domain model and event sourcing infrastructure

The sports-system now includes the core domain entities required to manage the betting platform's data structure. This adds aggregate roots for Users, Matches, Teams, Players, Comments, Votes, and UserMatchBets, establishing the relationships between them (e.g., users commenting on matches, betting on matches, and voting for teams). Alongside these entities, the system introduces the foundational event sourcing infrastructure, including the IAggregate base interface, a generic IEvent interface extending MediatR's INotification, and an IEventBus abstraction for publishing domain events.

server/src/Jbet.Domain/Entities · high confidence

Initial implementation of user authentication and account management

This change introduces the core business logic for user registration, login, and profile retrieval within the application. It adds command handlers for registering new accounts (including duplicate email checks) and logging in (validating credentials and generating JWT tokens via a new JwtFactory). Additionally, it provides a query handler to retrieve user details by ID. These components establish the foundational identity management capabilities for the system.

server/src/Jbet.Business/AuthContext · high confidence

Initial implementation of user authentication and authorization commands

This change introduces the core command and query structures for the authentication system within the AuthContext. It adds constants for admin claims, policies, and cookie/query parameter names, alongside command objects for user login and registration with their corresponding FluentValidation rules. The update also includes configuration classes for JWT token settings (issuer, audience, validity), a mapping profile for converting registration inputs to user entities, and interfaces/queries for generating JWT tokens and retrieving user views.

server/src/Jbet.Core/AuthContext · high confidence

Initial persistence layer for sports betting and voting features

This change introduces the repository implementations for the application's core domain entities, enabling data access for user accounts, match betting, team voting, and comments. Specifically, it adds repositories for managing user registration and claims (UserRepository), recording home/away match bets and calculating bet sums (BetsRepository), handling team votes and checking for duplicate votes (VotesRepository), persisting match comments (CommentRepository), and retrieving match and team data with associated relationships (MatchRepository, TeamRepository). It also includes a UserViewRepository to map user data and admin status claims for API responses.

server/src/Jbet.Persistence/Repositories · high confidence

Initial project scaffolding with Docker support

The repository has been initialized with the core project structure, including a README describing the JBet sports betting system features (DDD, CQRS, Event Sourcing, etc.). New files have been added to support containerized development and testing: .dockerignore, .travis.yml, docker.compose.yml (for running the API and client with PostgreSQL), docker.compose.integration.yml (for integration tests with separate database instances), and shell scripts (run-app.sh, run-integration-tests.sh) to simplify launching the application and test suites.

(repo-wide) · high confidence

Initial release of the Jbet.Api server application

This change introduces the initial version of the Jbet.Api project, establishing the core ASP.NET Core web API infrastructure. It includes the application entry point (Program.cs), startup configuration (Startup.cs) for dependency injection, authentication (JWT Identity), and service wiring (AutoMapper, MediatR, SignalR, Swagger, and HATEOAS). The API exposes controllers for user authentication, match data, betting, team voting, and comments. It is configured to connect to a PostgreSQL relational database (jbet-relational) and an EventStore, with a Dockerfile provided for containerized builds targeting .NET Core 2.2. Default configuration files include settings for development logging, database connection strings, JWT secrets, and an initial admin account seed.

server/src/Jbet.Api · high confidence

Initial release of the sports betting API controllers

This change introduces the core API surface for the sports betting platform by adding a new base ApiController and eight specific controllers: AuthController (user registration, login, logout, and current user retrieval), BetsController (placing bets for home or away teams), CommentsController (adding match comments), HomeController (displaying top matches and teams), MatchesController (listing matches and viewing details), TeamsController (viewing team details and players), and VotesController (voting for teams). These controllers implement the HTTP endpoints that allow users to interact with the system's betting, voting, and social features.

server/src/Jbet.Api/Controllers · high confidence

Initial release of the sports-system v2.0.7 client UI

This change introduces the complete client-side user interface for the sports-system application. It adds the main App component with routing for Home, Login, Logout, and 404 pages, along with a UserProvider to handle session initialization via cookies. The update includes a full authentication flow with LoginPage and LoginForm components, a Header that conditionally displays navigation links (including Admin access for admins) and user greetings, and common UI primitives like Input and Errors. It also adds a HomePage displaying the application title and a link to the source repository, and imports Font Awesome for styling.

client/src/components · high confidence

Initial server configuration and database seeding infrastructure

The server application now includes a new configuration layer in the \Jbet.Api/Configuration\ directory that establishes the foundational startup behavior. This includes setting up the ASP.NET Core Identity and JWT authentication pipeline, registering dependency injection bindings for repositories and services, and enabling Swagger documentation. Additionally, it introduces database initialization capabilities: a \DatabaseSeeder\ that populates the application with initial sports data (teams, matches, and players) if the database is empty, and a \DatabaseConfiguration\ utility that ensures a default admin account is created and the Marten event store is initialized upon startup.

server/src/Jbet.Api/Configuration · high confidence

Initial server project structure and solution configuration

The server component now includes the initial project scaffolding, defined by the new \Jbet.sln\ solution file and a \.dockerignore\ file. The solution organizes the application into distinct assemblies: \Jbet.Api\, \Jbet.Business\, \Jbet.Core\, \Jbet.Domain\, and \Jbet.Persistence\, along with a \Jbet.Tests\ project. This establishes the foundational build structure and development environment for the server-side codebase.

server · high confidence

Introduces base command/query interfaces and handlers for the sports system

This change adds the foundational CQRS (Command Query Responsibility Segregation) infrastructure for the sports system. It defines core interfaces in Jbet.Core.Base, including ICommand, ICommandHandler, IQuery, and IQueryHandler, which standardize how requests are handled using MediatR and Optional types. In Jbet.Business.Base, it provides a concrete BaseHandler class that automates command validation via FluentValidation and error wrapping, as well as an EventBus implementation that synchronously appends events to the Marten document session and publishes them via MediatR.

server/src/Jbet.Business/Base, server/src/Jbet.Core/Base · high confidence

This change introduces a comprehensive set of HATEOAS (Hypermedia as the Engine of Application State) resources and link policies for the Jbet API. It defines resource models for key domain entities including Authentication (Login, Register, Logout, User), Home (ApiRoot, Home), Match (Match, MatchDetails), Team (TeamDetails), Bet (UserMatchBet), Comment (CommentMatch), and Vote (VoteForTeam). Each resource is paired with a policy that specifies available hypermedia links (such as self-links and routed links to controllers like AuthController), enabling clients to discover available actions dynamically. The implementation also includes base classes for resources and containers, a resource mapper for converting domain views to resources, and AutoMapper profiles to facilitate these mappings.

server/src/Jbet.Api/Hateoas · high confidence

Introduction of PlayerView for player data representation

A new PlayerView class has been added to the domain layer to represent player data, containing fields for full name, birth date, and height. A corresponding AutoMapper MappingProfile has been introduced in the core player context to map the existing Player entity to this new view, enabling structured data transfer for player information.

server/src/Jbet.Core/PlayerContext, server/src/Jbet.Domain/Views/Player · high confidence

Introduction of domain repository interfaces for core entities

The system now exposes a set of new repository interfaces within the domain layer to manage data access for key entities. These include IBetsRepository for handling home and away bet operations, ICommentRepository for match-specific user comments, IMatchRepository for retrieving match details and paginated lists, ITeamRepository for team lookups and voting metrics, IUserRepository for user registration, authentication, and claim management, IUserViewRepository for user profile views, and IVotesRepository for team voting logic. These interfaces define the contract for data persistence and retrieval, enabling the application to interact with bets, matches, teams, users, and votes.

server/src/Jbet.Domain/Repositories · high confidence

Introduction of structured domain error handling

The domain layer now includes a structured error-handling model with a new \Error\ struct and \ErrorType\ enum. This allows the system to represent errors with specific categories (Validation, NotFound, Unauthorized, Conflict, Critical) and associated messages, providing a more consistent and type-safe way to handle and communicate failures within the application.

server/src/Jbet.Domain · high confidence

New home page data aggregation logic

The application now retrieves and aggregates specific data for the home page view. A new query handler fetches the top matches based on betting activity and the best teams based on voting, mapping these domain entities into a dedicated HomeView that exposes topMatches and bestTeams to the presentation layer.

server/src/Jbet.Business/HomeContext, server/src/Jbet.Domain/Views/Home · high confidence

New team detail and summary view models

The domain layer now includes dedicated view models for team data: TeamDetailsView provides comprehensive information including team identity, founding date, website, nickname, associated players, voting status, and user vote state, while TeamView offers a lightweight summary containing only the team ID, name, website, and vote count.

server/src/Jbet.Domain/Views/Team · high confidence

New team details query and mapping profile

Added a new GetTeamDetails query and a corresponding AutoMapper MappingProfile within the TeamContext. The query retrieves detailed information for a specific team, including the current user's voting status. The mapping profile handles the transformation of Team entities into TeamView and TeamDetailsView objects, specifically calculating the total vote sum and ignoring the UserHasVoted field during mapping.

server/src/Jbet.Core/TeamContext · high confidence

Real-time team voting updates via SignalR

The API now supports real-time notifications for team voting events. A new TeamVotesHub has been added to handle SignalR connections, and a corresponding TeamVotesDispatcher listens for UserVotedForTeam domain events to broadcast updates to all connected clients instantly.

server/src/Jbet.Api/Dispatchers, server/src/Jbet.Api/Hubs · high confidence

Behavioural changes

Added C\# code analysis configuration files

The server configuration now includes an analyzers.ruleset and stylecop.json file to define coding standards for the C\# codebase. The ruleset configures Microsoft, SonarAnalyzer, StyleCop, and System.Runtime analyzers, suppressing several warnings while enforcing specific StyleCop rules (such as SA1300 as an Error). The stylecop.json file configures using directive ordering to be placed outside the namespace and disables the preference for system using directives first.

server/configuration · high confidence

Adds API filters for transaction management, validation, and exception handling

The API layer now includes three new action filters to standardize request processing. The \EntityFrameworkTransactionFilter\ automatically wraps controller actions in database transactions, committing on success and rolling back on failure while reloading entity states. The \ModelStateFilter\ intercepts requests with invalid model state, returning a structured validation error response instead of allowing the request to proceed. The \ExceptionFilter\ catches unhandled exceptions, returning detailed error information in development environments and a generic critical error message in production.

server/src/Jbet.Api/Filters · high confidence

Introduction of centralized API client and service layer with SignalR support

The application now uses a dedicated API client (\apiClient.js\) that standardizes HTTP requests, automatically handles authentication errors by redirecting to login, and displays error messages via toast notifications. This client is wrapped by specific service modules (\authService.js\, \homeService.js\) for authentication and home data retrieval. Additionally, a new WebSocket client (\webSocketClient.js\) has been added to manage SignalR connections, allowing components to subscribe to real-time events and automatically manage connection lifecycle.

client/src/api · high confidence

Test coverage

Added integration test infrastructure for the Jbet server; Added integration tests for API controllers; Added test customizations for AutoFixture data generation; Added test helper extensions for HTTP responses, Moq verification, and domain errors; Added test helper for Team context operations; Added tests for TeamVotesHub; Added tests for database configuration and seeding; Added tests for match registration and away-team betting; Added unit tests for API exception and model state filters; Added unit tests for AuthContext business logic; Added unit tests for the away team bet handler.

Dependencies

Initial dependency manifests for client and server projects

The project now includes explicit dependency manifests for the frontend and backend, establishing the baseline library versions for the application. The client (client/package.json) introduces React 16.8.6, Redux, React Router 5.3.4, and Bootstrap 5.0.0. The server side defines seven .NET Core projects (Jbet.Api, Jbet.Business, Jbet.Core, Jbet.Domain, Jbet.Persistence, and Jbet.Tests) targeting .NET Core 2.2 and .NET Standard 2.0, with key dependencies including AutoMapper (versions 8.1.1 through 16.1.1 across projects), Newtonsoft.Json 13.0.1, System.IdentityModel.Tokens.Jwt 5.7.0, and Npgsql.EntityFrameworkCore.PostgreSQL 2.2.4.

(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 42 → 40 (-2.6)
  • Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 46 → 46 (-0.0)
  • Architecture 85 → 85 (+0.0)
  • Maturity 59 → 59 (+0.0)
  • Readiness 29 → 29 (-0.2)
  • Security 63 → 61 (-1.4)
  • Domain Modelling 100 → 43 (-56.5)
  • Event-Driven 100 → 100 (+0.0)
  • Accessibility 50 → 53 (+2.7)

Resolved (10)

  • BareSuppressMessage (server/src/Jbet.Api/GlobalSuppressions.cs)
  • BareSuppressMessage (server/tests/Jbet.Tests/GlobalSuppressions.cs)
  • Build status unknown
  • LLM evaluation failed
  • Medium: security finding (details withheld)
  • No exposed public API
  • Scanner failed to run — not a clean result
  • Secret: generic-api-key (server/src/Jbet.Api/appsettings.json)
  • Test reliability not measured — no test run produced results
  • dormant codebase — no living knowledge left to concentrate

New (13)

  • Duplicated block (16 lines × 2) (server/src/Jbet.Api/Hateoas/Resources/Team/TeamDetailsResource.cs)
  • Duplicated block (18 lines × 2) (server/src/Jbet.Api/Hateoas/Resources/Match/MatchDetailsResource.cs)
  • End-of-life runtime: .NET netcoreapp2.2
  • High secret: WD-SECRET-0002 (server/src/Jbet.Api/appsettings.json)
  • Medium IaC: WD-DOCKER-0003 (client/Dockerfile)
  • Medium IaC: WD-DOCKER-0003 (server/src/Jbet.Api/Dockerfile)
  • Medium IaC: WD-DOCKER-0004 (client/Dockerfile)
  • No dependency advisory monitoring
  • Scanner failed to run — not a clean result
  • Scanner failed to run — not a clean result
  • Secret: generic-api-key (server/src/Jbet.Api/appsettings.Development.json)
  • redundant comment (server/src/Jbet.Business/Base/EventBus.cs)
  • redundant comment (server/src/Jbet.Business/Base/EventBus.cs)

API surface

  • Unchanged — 7 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

profjordanov/sports-system 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 20 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 7af55c2e2625e0b3fc6eff61f53fbb05c1be707b — 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.