QDG Knowledge Base Read-only viewer QWebHub
overview

Overview

Version 1 · Initial project documentation for the qds-router solution

QDS Router

qds-router is the QDG horse-racing data platform: a .NET 8 solution (QDG.sln, remote github.com/TPL-Tech-Titans/qds-router) that serves racing data out of MySQL, generates racing PDFs, and fingerprints outbound customer feeds. Every project targets net8.0 with nullable reference types and implicit usings enabled.

Domain

The platform covers thoroughbred, greyhound, and harness racing (discipline codes T / G / H). It exposes race cards, race results, barrier trials, meetings, weather, and lookups, and produces review and final-report PDFs.

Two source databases sit behind it:

  • rs — the results / RAS source, holding the bulk of the tbl* racing tables (meetings, races, runs, pre-race data, ratings, sectional times).
  • qdb / qds_dev / temp-qdg — the QDG domain database (weather, generic_lookup, course, barrier-trial runs).

Projects

Project Type Purpose
API.DataRouter ASP.NET Core Web API Central data-feed API; routes racing data from MySQL and applies per-customer fingerprinting to outbound feeds. The only project with a Dockerfile / compose.
BarrierTrialsApi ASP.NET Core Web API (EF Core) Imports steward / in-running comments and writes them onto matching trial_run records.
Data.PdfGen ASP.NET Core MVC + API Generates racing review and final-report PDFs from the rs database using iText7.
DataFingerprinting Class library Deterministic, customer-specific feed watermarking so leaks can be traced to a customer. See the [[data-fingerprinting]] page.
DataFingerprinting.Tests xUnit test project Locks the fingerprinting algorithm (golden hash vector, determinism, distribution, isolation, safe defaults).
Domain Class library Shared EF Core entities (Course, TrialRun); used only by BarrierTrialsApi.
QDG ASP.NET Core MVC Default-template MVC shell sharing the solution name; currently a skeleton.
AuthService External (referenced) Authentication service expected as a sibling repo at ..\QdgAuth; not present in this checkout.

Architecture notes

  • Data access is split. API.DataRouter and Data.PdfGen use raw ADO.NET (MySql.Data / MySqlConnector). BarrierTrialsApi is the only project using EF Core (Pomelo). Domain entities are EF-only and consumed solely by BarrierTrialsApi.
  • Namespace overlap. The QDG.* namespaces used at runtime (QDG.Services, QDG.Controllers, QDG.DTOs) physically live inside API.DataRouter, not the QDG project — a naming overlap to be aware of when navigating the code.
  • Authentication is external. The X-Api-Key header in API.DataRouter only identifies a fingerprinting customer; it does not authenticate or authorize requests. Real authentication is the responsibility of the external AuthService.

Building and running

Open QDG.sln in Visual Studio 2022 or build with dotnet build. The full solution expects the external AuthService cloned as a sibling of qds-router (..\QdgAuth\AuthService\AuthService). API.DataRouter can be containerised via its Dockerfile / docker-compose.yml (exposes port 8080).

Run the fingerprinting tests with:

dotnet test DataFingerprinting.Tests/DataFingerprinting.Tests.csproj

Security

Live MySQL connection strings are currently committed in the appsettings.json / docker-compose.yml of API.DataRouter, BarrierTrialsApi, and Data.PdfGen. These, along with customer FingerprintKey values, should be treated as secrets and moved into user secrets / environment / a secret store before deployment.

Updated by Claude on Aug. 4, 2026, 12:28 p.m. · Task: updatewiki create project documentation