Skip to content

ADR: One folder per component

ADR: One folder per component

Status
accepted
Date
2026-09-28

Steve's plan for the frontend's layout: one folder per component, grouped by section, with an index.ts that re-exports it so imports read components/<section>/<Name>, and src/lib and src/hooks left where they are. Shipped as 1.0.3.35 with the Admin stylesheet split, the edge warm-up, the prefetch, the first activity read and the keep-warm loop.

In plain words

This page decides how the site's screen code (React components) is filed: each component gets a folder of its own holding its code and styles, and the folders are grouped by the part of the site that draws them. A piece that two parts both draw goes in a shared folder.

What that is worth: a developer finds a component and its stylesheet by walking folders instead of knowing file names, and the organization's code can grow section by section without one flat folder holding everything.

Context

By 1.0.3.34 src/components held 49 files in one flat folder, and the Admin tab's twenty-four files in a second flat folder under it. A component and its stylesheet sat next to each other only because their names sorted together, the badges a vehicle card draws sat beside the Admin workbench, and a reader looking for the inventory had to know its file names to find them. The Admin tab's one stylesheet, 1,766 lines and 164 classes, had no folder its classes could move into.

Decision

Every component has a folder of its own, and the folders are grouped by the section of the site that draws them.

  • A folder holds the component's .tsx, its .module.css when it has one, and an index.ts that re-exports it. An import names the folder, components/<section>/<Name>, never the file inside it. A file imports its own folder's neighbours directly (./Ribbons), never through its own index.
  • The sections are layout (the rail, the store band, the brand, the intro strip, and the page's ground as Background), inventory, vehicle, account, docs, landing, shared, and admin, which holds the workbench (admin/AdminPanel), the shared card helpers (admin/shared), the charts (admin/charts), the table (admin/DataTable) and a folder per card.
  • A component another section renders goes to shared. The rule is read off who imports a file, not off what the file is about.
  • src/lib and src/hooks do not move, and src/lib still imports nothing from React.
  • The lazy imports stay lazy: the Admin tab from App.tsx, each card from the workbench, and the markdown renderer and the Author layout from the document dialog are each still a chunk of their own, since a dynamic import of a folder's index.ts splits exactly where a dynamic import of the file did.

Where the rule moved a file off the first plan

The plan put the vehicle's badges in vehicle and the sheet icons in layout. Read by who imports them:

  • AuctionCountdown, ConditionBadge, ReserveBadge, TitleStatusBadge and VehicleImage are drawn by the inventory's VehicleCard and by the vehicle's VehicleDetail, two sections, so they are in shared.
  • SheetIcons is drawn by the rail (layout) and by the landing page (landing), so it is in shared.
  • DocsMenu stays in docs although the rail opens its dialog and the landing page reads its menus. It is that section's own front door: the catalogue, the menus and the dialog are the docs section, and a section may open another section's front door through its index.ts. What shared is for is the small pieces two sections both draw, and moving the whole docs section there would leave docs empty.
  • CountUp and ErrorBoundary each have one user (the landing page, and main.tsx), and stay in shared as the plan put them: nothing in the rule sends a one-user component into its user's section, and both are general pieces rather than the landing page's own.

What held it

The move changed no value, selector, class name or behaviour; App.tsx draws <Background /> where it drew the ribbons and then the watermark, and Background is a fragment of those two in that order, so the page's markup is the same. The tests that read components as text read every folder: icons.test.ts globs components/**, the unit-test build reads any component sheet as text wherever it sits (vite.config.ts), and StyleRulesTests reads the Admin tab's files recursively. Every link and live sample that named a file by its path names the new one, and so does every test.

Addendum, 2026-09-28 (1.0.3.36): DocsMenu leaves docs, and the shell leaves src

The same day, the two largest files were split by job (ADR: The React configuration, explained, the addendum on the split). DocsMenu was not a component: most of it was data (the documents and what each section holds), with the document window at the end. It is now src/library, a folder beside components rather than a section in it, and src/components/docs is gone; the sections are layout, inventory, vehicle, account, landing, shared and admin. App.tsx and its stylesheet moved the same way, to src/app, with the hooks that hold what the app knows under src/app/hooks. Neither folder is a component folder, so neither has an index.ts: an import names the file, library/sections or app/hooks/useAddressBar, and every file in both opens with a header saying what it does, what it does not, and which files use it. The rule above is unchanged for everything under src/components, and icons.test.ts and the unit-test build now read src/app and src/library too.

Addendum, 2026-10-02: the large components split by job

Eight files of the Admin tab, the rail and the account page ran past 300 lines. Each is split by job, and the part a file's own header already named became a component with a folder of its own under the same section, the way this record lays out every component: for example AdminWorkbench/, AdminStatStrip/, ActivityPlot/, MachinesKeptWindow/, RailSectionShell/ and SignInForm/. The file that kept the original name is now the short list that composes its parts, so nothing that imported it changed. A part keeps reading the original component's stylesheet rather than splitting it, and that sheet's "Used by" line names every part, which FileHeaderTests checks.

Where it sits

This is a front end decision about src/components, where each component gets a folder with its .tsx, its stylesheet and an index.ts, while src/lib and src/hooks stay put. It supports single responsibility, one reason to change, at the folder level: a folder holds one component, and sending any piece two sections draw to shared keeps each section's folder about that section. It cost an index.ts per folder and longer import paths to walk. A codebase small enough to read in one flat folder would not need it.

Files

Enforced by

Not machine-checked. Held by review.

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