Platform Evolution
Assessment run-2026-07-27-1 · 213 of 213 repos assessed
Repos / trainline-api

trainline-api

.NET 8 API that receives Trainline order-confirmation and refund-completed files, stores/archives them in MongoDB and publishes Trainline transaction events onto Redis streams for the Phenix estate.

98 · greenlowlooseOn-premZDD: no excuseapi

Health score

98

0 to 100 across seven weighted factors; nothing is hidden. Green is 75 and above, amber 50 to 74, red below 50. How scoring works.


Runtime currency / 25
25
Runs on supported modern .NET
Legacy transport / 15
15
No legacy WCF or SOAP surface
Test posture / 15
15
Good test coverage
Security hygiene / 15
15
No credentials found in source
Dangerous coupling / 15
15
No dangerous coupling detected
Activity / 10
8
Last commit six to twelve months ago
Deployment hygiene / 5
5
CI in place
Health over time
2026-07-24 (run-2026-07-24-1): 982026-07-27 (run-2026-07-27-1): 98
No change since 2026-07-24 (98 to 98).

Facts

Languagescsharp
FrameworksASP.NET Core 8, FluentValidation, FluentResults
Runtimes.NET 8
Tests / CIgood / CI in place
Last commit2025-12-02
OwnerOwner unknown (mapping to be curated)
DomainSelling and quoting (system generated; curate in repo-owners.json to override)
Product areaPhenix
HostedOn-prem Deployed to our own machines
  • Release "trainline-api": QA: deployment-group phase (agents on our own machines)
  • Release "trainline-api": Staging: deployment-group phase (agents on our own machines)
  • Release "trainline-api": Production: deployment-group phase (agents on our own machines)
  • Release "trainline-api": Training: deployment-group phase (agents on our own machines)
  • Release "trainline-api": DR: deployment-group phase (agents on our own machines)
Releases1 release pipeline(s): trainline-api
Integrationrest, redis-streams
SourceOpen in Azure DevOps

Risk flags

No risk flags recorded.

Each flag links to its glossary definition.

Dependencies in context

Laying out the graph…
greenamberreddata store (square, dashed link)Node size follows fan-in. Click any node to open it.

Entanglement

loose No binding mechanisms apply: this system needs no untangling work.

    Migration playbooks

    Generated from this repo's assessment data: what is feasible, what blocks it, and the steps in order. Ratings: green means actionable now, amber means sequence other work first, red means blocked, grey means not applicable.

    ZDD adoption

    No excuse

    Nothing technical is holding this repo on the three-week release. It either already deploys without downtime (AWS) or is a modern, well-tested service the automated stealth path can carry today. Modern runtime, good tests, no hosted legacy transport: the automated stealth path can carry it today.

    Dependencies and gotchas
    • 2 system(s) depend on this repo; during a rolling deploy they will talk to old and new versions at once, so responses must stay compatible
    • Serialized state or messages in flight (Redis or queues): new code must deserialize objects written by the previous version
    Steps
    1. Adopt the four-stage discipline from the ZDD engineering standard: pre-deployment compatibility, deployment, feature activation behind a flag, post-release cleanup.
    2. Make every change dual-version safe: backwards-compatible APIs (new major version for breaking wire changes), expand and contract for any schema change, and consumers tolerant of unknown fields.
    3. Audit serialized data: anything in Redis, queues or shared caches must deserialize cleanly across adjacent versions.
    4. Wrap behaviour changes in feature flags so code deploys dark and release becomes a business decision, not a deployment event.
    5. Route deployments through the Workflow Engine's automated drain, deploy, health-check, return cycle (the path proven by the first automated production run in mid-2026).
    6. Verify with area-scoped regression rather than the whole-platform cycle, and watch error rates after rollout with automated rollback on alert.

    SQL Server exit

    Not applicable

    No SQL Server dependency is recorded for this repo. Nothing to migrate.

    Containerisation

    Ready to containerise

    Modern runtime, no hosted legacy transport: this service can follow the estate's proven container path (Dockerfile, shared pipeline template, ECS via Terraform).

    Steps
    1. Add a Dockerfile and make the app read all configuration from environment variables and the secrets manager, never from machine-local files.
    2. Log to stdout and expose a health check endpoint so ECS can supervise it.
    3. Adopt the shared ci.yml pipeline template with the container parameters (awsRegion, containerAfterBuild, ecsTerraformRepo), which is exactly how the estate's existing AWS services deploy.
    4. Define the service in the Terraform repo, deploy to a non-production environment, then shift traffic and disarm the deployment-group release pipeline.

    Recommended actions

    No specific actions for this repo. It either needs only normal maintenance, or its work is covered by an estate-level action. See the full programme.

    Assessment notes

    trainline-api

    Purpose

    Ingestion point for rail bookings made through Trainline. Controllers accept order-confirmation and refund-completed JSON files plus an archive endpoint; services validate, persist and archive the files in MongoDB, and the companion TC.Phenix.Trainline.Events library maps them (resolving the owning sales person via the Phenix User API by branch number) into TrainlineTransactionEvent messages published on TC.Streams.

    Tech stack

    C# .NET 8 ASP.NET Core using TravelCounsellors.ApiTools, FluentValidation, FluentResults, MongoDB.Driver with TC.ScriptRunner.Mongo index scripts, TC.Streams over Redis, Swashbuckle, Nerdbank.GitVersioning. MSTest with AutoFixture/Moq.AutoMock/AwesomeAssertions.

    Deployment

    prod_application, release_count 1. Two YAML pipelines: build.yml for the API (shared templates, .NET 8, AWS eu-west-1 container parameters — containerAfterBuild: false, namespace trainline) and build-trainline-events-lib.yml publishing the events NuGet package. Build pipelines trainline-api and phenix-trainline-api feed the trainline-api release pipeline. Served under /API/TrainlineAPI.

    Dependencies

    Internal packages: TC.ConnectionBroker.* (Api, Mongo, Redis, HttpClient), TravelCounsellors.ApiTools, TC.Streams.*; the events library also uses TC.UserAccount.ServiceClient/ServiceContract (backoffice-useraccount-service) and calls the Phenix User API over HTTP (phenix-user-api). External: Trainline as the upstream file source.

    Data stores

    MongoDB database Trainline (order-confirmation files, refund files, archived files with scripted indexes on order reference and Phenix booking id). Redis is used for stream publishing, not caching.

    Integration points

    Inbound REST for file submission. Outbound REST to the Phenix User API and event publication over Redis streams consumed elsewhere in Phenix.

    Code health

    Two test projects covering the API (controllers, services, mappers, validators — with real Trainline sample payloads) and the events library. No README at all. Last commit 2025-12-02; low churn but healthy.

    Modernisation risks

    Low: modern .NET 8, YAML CI, decent tests, no SQL coupling. Gaps are documentation (no README) and a hard dependency on the Trainline file formats; the AWS container parameters in the pipeline suggest a partially adopted containerisation path (containerAfterBuild disabled).