Skip to content

Data Flow

Data Flow

How a vehicle travels from a JSON file on disk to a card in the browser, and how a bid travels back. One rule shapes everything: derive, don't store. Windows, statuses, galleries, and the 100k inventory are all computed from stable ids, never persisted.

TheYard data flow: the read path from the seed file to the cards, top to bottom, and the write path of a bid beside it, every box a file

A preview. Open the data flow diagram in a new page to zoom in and follow it; every diagram on this site opens that way (ADR: Diagram pages). The source is docs/images/dataflow.svg.

Every box in the diagram is a file; each step below names its path.

Every HTTP endpoint lives in its slice under api/TheYard.Api/Features/, one folder per feature with a Module.cs that maps it. api/TheYard.Api/Program.cs is the table of contents: it calls the registrations in api/TheYard.Api/Shared/ (sources, then services) and each slice's module, then maps each module. A handler binds the request and hands straight off to the Application layer; the auction's handlers are queries and commands (ADR-115), and every query reads a vehicle through StandingReader (api/TheYard.Application/Shared/Auction/StandingReader.cs), which lays the catalogue, everybody's bids and the simulated room in the one order the rules need. ADR: Program.cs, explained walks the entry point top to bottom.

Route Handled by
GET /api/vehicles (filter/sort/page params) SearchVehiclesHandler → StandingReader.SearchAsync → Stock.SearchAsync, which plans the query and the store answers it (ADR: The store does the work)
GET /api/vehicles/{id} FindVehicleHandler → StandingReader.FindAsync, a point read in the store, which hands the vehicle back at its standing price with its sold flag
GET /api/facets ReadFacetsHandler → Stock.FacetsAsync
POST /api/vehicles/{id}/bids PlaceBidHandler → BidBook.PlaceBidAsync → BidRules
POST /api/vehicles/{id}/buy-now PlaceBidHandler → BidBook.BuyNowAsync → BidRules
GET / DELETE /api/bids ReadMyBidsHandler → StandingReader.BidsOf / ResetBidsHandler → BidBook.ResetAsync and Room.Forget
GET /api/docs/{slug} · /api/docs/diagrams/{name} the documents catalog and the diagram pages (ADR-017, ADR-020)
GET /api/docs/bicep · /api/docs/resume files on disk
GET /api/images/{file} static files (day-long Cache-Control)
GET /api/version build provenance (ADR-005)
GET /healthz · /readyz liveness and readiness
GET /api/health · /api/errors · /api/admin/azure the Admin tab (ADR-010)

In plain words

This page follows one vehicle from a data file on disk to a card on screen, and one bid on its way back. The rule behind it is to work facts out from stable ids each time (derive, don't store) instead of saving them, and to keep every auction rule on the server.

What that is worth: a developer can trace any request to the file that handles it, because every step names its path. The organization gets one home for the auction rules, so the screen shows what the server decided.

The read path

  1. Seed. The catalogue is read once at startup from the store, Azure SQL Database, Azure Cosmos DB or SQLite; data/vehicles.json (the challenge's 200 records, untouched) seeds a fresh store on first boot through JsonFileVehicleSource (api/TheYard.Infrastructure/Shared/Auction/JsonFileSources.cs), deserializing into the Vehicle record, which lives with the other pure data shapes in api/TheYard.Data/.
  2. Scale. SyntheticVehicleSource (api/TheYard.Infrastructure/Shared/Auction/SyntheticVehicleSource.cs) expands it to 100,000 deterministic variants: each new id is hashed (FNV-1a, api/TheYard.Domain/Shared/Auction/Fnv1a.cs) to vary VIN, year, odometer, prices, and bid state while inheriting the seed's make/model/trim mix.
  3. Enrich and cache. Stock (api/TheYard.Application/Shared/Auction/Stock.cs) applies each vehicle's photo gallery (hash-picked by api/TheYard.Domain/Shared/Auction/PhotoGallery.cs from api/TheYard.Api/photo-manifest.json pools, preferring the vehicle's own make) and fills the store's catalogue with them, which a page is then a query against: the process holds none of the hundred thousand in memory (ADR: The store does the work).
  4. Query. A request like GET /api/vehicles?make=Ford&status=live&sort=price-asc binds through api/TheYard.Api/Features/Vehicles/VehicleQueryParams.cs, which validates and produces a filter, a sort, and a clock (api/TheYard.Api/Shared/Instance/Clocks.cs): now, and the UTC midnight that began the day, the same for every caller, so schedule math (api/TheYard.Domain/Shared/Auction/AuctionSchedule.cs, AuctionClock.cs) puts every visitor in the same auction. Everybody's bids, then the simulated room's, overlay before filtering (StandingReader.Overlay in api/TheYard.Application/Shared/Auction/StandingReader.cs, each raise made by StandingRules.RaisedTo in api/TheYard.Domain/Shared/Auction/StandingRules.cs), so price bounds see the same figures the UI shows. Then Where → OrderBy → Skip/Take, in the store: Stock.SearchAsync resolves the filter to the store's own spelling and plans the page, and the store's adapter (EfVehicleCatalogue.cs over the Catalogue table, CosmosVehicleCatalogue.cs over the catalogue container) answers it off an index, so only the page comes back (ADR: The store does the work).
  5. Wire. api/TheYard.Api/Shared/Wire/VehicleWire.cs stamps the server-derived auction facts onto each vehicle (auction_starts_at, auction_ends_at, auction_status, min_next_bid, and sold, from everybody's standing), and the endpoint (api/TheYard.Api/Features/Vehicles/VehicleEndpoints.cs) responds with a snake_case envelope { total, vehicles }.
  6. Fetch. src/lib/data.ts is the browser's single seam: it debounces filter changes (500 ms), caches responses per query string (5-minute TTL; hits skip the debounce), and aborts superseded requests. The query string itself is built by src/lib/inventory.ts, the same serializer that feeds the address bar.
  7. Render. src/app/hooks/useAddressBar.ts holds the view and mirrors filters plus ?vehicle={id} into the URL; components (src/components/) format currency (src/lib/format.ts), tick countdowns from the server's window, and recompute live/ended locally as time passes (src/lib/auction.ts). No business math runs in the browser.

Step 4's overlay, read from this build. It is chosen once per listing, so a cold catalogue with no bid and no room pays for neither:

/// <summary>
/// The overlay a listing applies to every row: everybody's bids, then the room's. Each one only
/// raises the price (StandingRules.RaisedTo), so the page shows the highest of the dataset, the
/// bids and the room, and a competitor who has gone higher is what the buyer sees. It names the
/// vehicles it moves, because the store holds the dataset's figures and a listing that filters or
/// sorts by price has to work those vehicles out from the moved ones (ADR: The store does the
/// work). Null when nobody has bid at all, so a cold listing pays for neither. IsEmpty rather
/// than a snapshot count, because a snapshot copies the whole dictionary just to ask whether it
/// is empty.
/// </summary>
private ListingOverlay? Overlay()
{
    if (bids.IsEmpty && room.IsEmpty)
    {
        return null;
    }
    var moved = new HashSet<string>(StringComparer.Ordinal);
    if (!bids.IsEmpty)
    {
        moved.UnionWith(bids.Standing().Keys);
    }
    if (!room.IsEmpty)
    {
        moved.UnionWith(room.Snapshot().Keys);
    }
    return new ListingOverlay(moved, AsItStands);
}

/// <summary>The vehicle at the price it stands at: the dataset, then everybody's bids, then the room's.</summary>
private Vehicle AsItStands(Vehicle vehicle) => room.Apply(bids.Apply(vehicle));

Live from api/TheYard.Application/Shared/Auction/StandingReader.cs, region overlays, read from this build at 99df7a8.

Step 6's seam, the one function every list view goes through:

// The one function every list view goes through. Three things share this seam:
// a cache keyed by the exact query string and the UTC day (a filter
// combination revisited renders instantly, and nothing cached before the
// server re-seeds at UTC midnight is served after it), an AbortSignal so an
// effect's cleanup can cancel a request the visitor has already typed past,
// and forceRefresh for the paths that must not read a cache (retry buttons,
// the periodic status refresh).
export interface FetchVehiclesOptions {
  sort?: SortKey;
  offset?: number;
  signal?: AbortSignal;
  /** Skip the cache and overwrite it with a fresh response. */
  forceRefresh?: boolean;
  /** Nobody clicked for it (a timer, the room's round): it never locks the page. */
  background?: boolean;
}

export async function fetchVehicles(
  filters?: InventoryFilters,
  { sort, offset = 0, signal, forceRefresh = false, background }: FetchVehiclesOptions = {}
): Promise<VehiclePage> {
  const query = queryString(filters, sort, offset);
  const key = cacheKey(query);

  if (!forceRefresh) {
    const hit = cachedPage(key);
    if (hit) return hit;
  }

  const url = query ? `/api/vehicles?${query}` : '/api/vehicles';
  const response = await counted(() => fetch(url, { signal }), { background });
  if (!response.ok) {
    throw new Error(
      await problemDetail(response, `The inventory API responded with ${response.status}`)
    );
  }
  const page = (await response.json()) as VehiclePage;

  // Re-inserting moves the key to the back, so eviction drops the stalest.
  queryCache.delete(key);
  queryCache.set(key, { at: Date.now(), page });
  if (queryCache.size > CACHE_MAX_ENTRIES) {
    const oldest = queryCache.keys().next().value;
    if (oldest !== undefined) queryCache.delete(oldest);
  }
  return page;
}

Live from src/lib/data.ts, region fetch-vehicles, read from this build at 99df7a8.

The write path (bids)

  1. src/components/vehicle/BidPanel/BidPanel.tsx posts { amount } to POST /api/vehicles/{id}/bids via src/lib/data.ts; the clock is the server's. api/TheYard.Api/Features/Bids/BidEndpoints.cs hands it to PlaceBidHandler, which measures it against the room's standing price as well as everybody's bids.
  2. api/TheYard.Domain/Shared/Auction/BidRules.cs is the sole authority: sold first (a vehicle anybody has bought takes no bid and no second purchase, a fact BidBook supplies from everybody's standing), then the live-window check, the tiered minimum increment, and the buy-now override (a bid at or above buy_now_price wins outright at that price).
  3. Accepted or won bids are written to the store first, Azure SQL Database or Azure Cosmos DB through IBidStore, and then to the in-memory standing in api/TheYard.Application/Shared/Auction/BidBook.cs, under the signed-in account's id (ADR: Accounts and per-user bids); rejections return 400 with a human-readable reason the panel shows.
  4. The response carries the updated vehicle (fresh min_next_bid included); src/lib/data.ts clears the query cache and the client (src/hooks/useBids.ts) refetches, so lists, filters, and totals all reflect the new bid, because the overlay in read-step 4 feeds the same pipeline every read uses.

Step 2's first check, read from this build. Sold is a fact the rules cannot know from the vehicle alone, so the caller that holds everybody's standing supplies it, and it is asked before the clock and before the buy-now shortcut:

/// <summary>
/// The sentence a sold vehicle answers every bid and every purchase with.
/// One string, because the store's fact and the page's words should not be
/// able to drift apart.
/// </summary>
public const string SoldReason = "This vehicle has been sold.";

/// <summary>
/// <paramref name="sold"/> is whether anybody has bought this vehicle
/// outright, which the rules cannot know from the vehicle alone: the
/// dataset has no such field and the schedule has no such state. The caller
/// that holds everybody's standing says so, and it is asked before the
/// clock and before the buy-now shortcut, so a second account bidding the
/// buy-now price on a vehicle already bought is refused, not told it has
/// won (ADR: Accounts and per-user bids, the addendum on the second buyer).
/// </summary>
public static BidOutcome ResolveBid(Vehicle vehicle, int amount, AuctionClock clock, bool sold)
{
    if (sold)
    {
        return BidOutcome.Rejected(SoldReason);
    }
    // Before the buy-now shortcut, so an absurd number is refused rather than read as a
    // purchase, and before any sum, so no price this method adds to can overflow.
    if (amount > MaxBid)
    {
        return BidOutcome.Rejected($"A bid can be at most ${MaxBid.ToString("N0", CultureInfo.InvariantCulture)}.");
    }
    var status = AuctionSchedule.StatusFor(vehicle.Id, clock);
    if (status == AuctionStatus.Live && vehicle.BuyNowPrice is { } buyNow && amount >= buyNow)
    {
        // Instant win, charged the buy-now price rather than the overbid.
        return BidOutcome.Won(buyNow);
    }
    if (status == AuctionStatus.Upcoming)
    {
        return BidOutcome.Rejected("This auction has not started yet.");
    }
    if (status == AuctionStatus.Ended)
    {
        return BidOutcome.Rejected("This auction has ended.");
    }

    int min = MinNextBid(vehicle);
    return amount < min
        ? BidOutcome.Rejected($"Bid must be at least ${min.ToString("N0", CultureInfo.InvariantCulture)}.")
        : BidOutcome.Accepted(amount);
}

public static BidOutcome ResolveBuyNow(Vehicle vehicle, AuctionClock clock, bool sold)
{
    if (sold)
    {
        return BidOutcome.Rejected(SoldReason);
    }
    if (vehicle.BuyNowPrice is not { } buyNow)
    {
        return BidOutcome.Rejected("This vehicle has no Buy Now price.");
    }
    return AuctionSchedule.StatusFor(vehicle.Id, clock) == AuctionStatus.Live
        ? BidOutcome.Won(buyNow)
        : BidOutcome.Rejected("Buy Now is only available while the auction is live.");
}

Live from api/TheYard.Domain/Shared/Auction/BidRules.cs, region sold, read from this build at 99df7a8.

Store

The Yard, home

Steven StoutStaff .NET engineerRemote

Production .NET that stays up. Built with AI, measured on every version.

Steven Stout

Hi, I'm Steve. I build the systems that make delivery boring in the best way, then coach people inside them.

  • 200+

    production releases, none took the platform down

    Conway Investment Research, 2019 to 2024. Sole engineer for the first three years on a live financial advisory platform.

    See how
  • 50%

    shorter release cycle

    Storee Construction, 2024 to 2026. Four ASP.NET applications onto one .NET 10 platform on Azure, with a four-person team I hired and mentored.

    See how

01Verified

Steven Stout

A real person, and the work is mine.

  • Identity

    Checked by LinkedIn, not by me.

    LinkedIn verified my government ID.

  • Running system

    You are looking at it.

    Version 1.0.5.273 is live. Nothing ships unless it passes the automated gates first.

That's who I am. Here's how I work.

02Strengths

Ten strengths, each with the proof beside it. The numbers match my resume and LinkedIn, and the live ones are read from this site as you look.

  • 01

    Keeps production alive

    200+ releases on a live financial platform, and none took it down. Sole engineer for the first three years.

    See the Conway work

  • 02

    Simplifies messy systems

    Four ASP.NET applications onto one .NET 10 platform on Azure, and a release cycle 50% shorter.

    See the Storee work

  • 03

    Marries dev and infrastructure

    Blue-green releases at Storee that flipped in about 5 seconds with nobody signed out, and Azure Front Door at two employers.

    See this site's cloud

  • 04

    Designs data that holds up

    White-label clients on one shared database, the isolation built into the data, and no cross-client issues.

    See the Conway work

  • 05

    Keeps AI-written code honest

    15 quality numbers that may only improve: 273 releases in a row with none worse.

    See the quality numbers

  • 06

    Resourceful

    $30,000+ cut from Azure and vendor spend at Conway. This site's Azure bill is public, resource by resource.

    See the bill

  • 07

    Builds people up

    Hired and mentored a four-person team. 13 colleagues recommend me by name.

    Read the recommendations

  • 08

    Takes ideas to production

    This site: designed, built and run solo, with 352 versions measured through one gate.

    How it was built

  • 09

    Writes clearly

    Posts on real engineering problems, in plain words.

    Read the blog

  • 10

    Owns decisions

    153 decision records, each with its tradeoff and the call I made.

    See the decision records

Built with AI. Gated so quality never slides.

Steven Stout’s showcase: a used-vehicle auction on .NET and React, built and run by one engineer, live on Azure, with its decisions written down.

No quality number has gotten worse at any release since 1.0.5.1 on 10 November: 273 releases in a row.

One engineer, an AI agent and a gate that checks 15 quality numbers on every release. 352 versions measured, with every result public, the worst days included.

82 releases in the last 7 days, each through the same gate.

Async methods with no CancellationToken, may only fall

11091.0.3.1391.0.5.2731.0.4.115, the ratchet
Every number, on the Quality page

TheYard, right nowLive

Answering in

unread

02505007501,000

server time at p95, the usual five minutes of the last day.

Azure this month

unread

the bill, by resource, read from Azure. The Admin tab shows every line.

Since the last roll

unread

 

rolled in place by the pipeline, behind one gate.

People who have visited

unread

30 days agotoday

Scanners, my own tools' and my own reads left out.

03Start here

04Where teams are heading

How I see engineering with AI, and the setup on this site that backs it.

AI-augmented teams · Architecture and ownership

AI writes more of the code. Someone still has to own what ships.

Teams are going to be heavily AI-augmented. That moves the senior job toward architecture and technical ownership: deciding what to build in pieces small enough to verify, and owning what ships.

  • Task tracking will get automated too. Judgment stays human: seeing a design fail at scale before it does.
  • On this site the AI's first design held the whole catalogue in memory. I caught it when the App Service plan hit 82 per cent and moved the work to the store.

What the AI wrote, what I decided

07Tech stack

  •    
  •    
  •    

Read from the build, never typed by hand

What TheYard runs on

What we use, where it runs, its AWS twin, the version as built, and the file that proves it.

Cloud patterns, not one vendor: every Azure piece in this stack has a named AWS twin. Mapped, not yet run on AWS.

  • .NET 1114 projects
  • React 19.3TypeScript 7.0
  • Azure9 Bicep files
  • 11GitHub Actions workflows
The whole stack, with the file that proves each line

The last release the gate stopped was 1.0.5.258 on 2 December, at its browser 1 of 2 job.

08How it is built

09How it is run

10Who and why

Next step

11What has to work, where is it today, and what does success look like?

Book 20 minutes opens an email to me with those three questions in it, and I answer with a time.

Book 20 minutes

Your email app should have opened with this message. If it did not, copy it and send it from any mailbox.

Or message me on LinkedIn