Diagram: a push to main passes a pre-push type check that checks nothing, while the real Docker build fails and the old container keeps serving a two-months-stale site. The fix: verify with the build command and have the healthcheck report its version.

I wanted to write this series because we spend a fair bit of time helping customers get ready for AI, and at some point I realized I hadn’t had to run any of it myself. Designing a Copilot readiness roadmap for a client is one thing. Being the person who finds out that a vision model returned malformed JSON overnight and quietly poisoned a week of user-facing averages is a bit different. The first teaches you the architecture, and the second teaches you what that architecture actually costs.

So I built a product. Diamond Elite is an AI analytics platform for baseball and softball. A parent or coach uploads a video of a swing, and the system returns a phase-by-phase mechanical breakdown, a score, annotated frames, and drills specific to what it saw. It also ingests game data, builds scouting reports, tracks player development across a season, and generates highlight reels. It’s live, real families are using it, and honestly it has taught me more about production AI engineering than any readiness assessment we’ve ever run.

This is the first of five posts on how it’s built and what building it taught me. In this part I’m going to cover the overall shape of the system, and the single most expensive infrastructure lesson I learned along the way.

The Stack Is Deliberately Boring

Let’s start with the stack. Diamond Elite is a TypeScript monorepo, roughly 190,000 lines across a client and a server. The client is React 19 on Vite 7 with Tailwind and react-router. The server is Express 4 on Node, running tsx in development and compiled JavaScript in production. The AI layer is the Anthropic SDK calling Claude Sonnet. Pose estimation for the skeleton overlay is MediaPipe’s PoseLandmarker, which is loaded from a CDN and runs entirely in the browser. Reports are generated with PDFKit.

Diamond Elite player directory controls: search, sort and switch views. Demo data.

You’ll probably notice what’s missing. There’s no message queue, no Kubernetes, no service mesh, and no GraphQL layer. For a long stretch there wasn’t a database at all, just JSON files on disk.

That last one is the decision engineers usually react to, so I’ll explain my thinking. The product started as a question: could a vision model usefully critique a swing at all? I didn’t know, and neither did anyone else. Answering that took a video upload path, a frame capture path, a prompt, and somewhere to put the result. A schema migration framework wouldn’t have helped answer it. A swings.json file did, because I could write it in an afternoon and open it in a text editor whenever something looked wrong.

The product now runs on SQLite, with a dedicated migration path from those original JSON stores. With that said, it moved when the file-based approach started costing more than it saved: concurrent writes, query patterns that wanted indexes, and per-tenant scoping that wanted a real WHERE clause. It didn’t move because file-based storage was embarrassing. Personally, I think infrastructure you adopt before you’ve felt the pain of not having it usually ends up being infrastructure you maintain without really being able to say why.

Surface Area Grows Faster Than You Plan For

What did surprise me was how wide it got. The server now has more than eighty route modules, and the client has over ninety pages. The original scope, upload a swing and get feedback, is maybe six of those files.

Three statistics: the original scope is about 6 files, the server has more than 80 route modules, and the client has more than 90 pages.

The rest showed up because real users have related problems that only become obvious once they’re using the thing. Someone analyzing swings wants to compare two side by side with synced playback. Someone comparing swings wants to see the whole season. Someone tracking a season wants scouting data on the opponent. Someone with scouting data wants a report to hand the coach, and someone with a report wants it on a schedule. Each of those is a reasonable half-day of work, but add them all up and you’ve got a platform.

This is another place where the boring stack pays off. Eighty route modules that all follow the same Express pattern, share the same helper libraries, and compile under one tsc invocation are eighty modules a small team can still reason about. I don’t think I could say the same about eighty microservices.

The Lesson That Cost Us Two Months

This is the failure I’d most like other teams to avoid, because it’s silent and, from what I’ve seen, it isn’t rare.

Side-by-side comparison: a typecheck that silently checked nothing versus verification that matches the build and confirms the deployed version.

Production is a Docker build deployed on Railway, triggered by a push to the main branch. The client build step is tsc -b && vite build, and the server step is tsc. A healthcheck endpoint confirms the container is alive. It’s a clean pipeline, and for two months in 2026 it was completely broken without anyone noticing.

The cause was the client’s root tsconfig.json. It’s a project-references shell, meaning it declares an empty files array and delegates to referenced sub-projects. That’s a perfectly normal TypeScript pattern. The problem is what it does to the obvious verification command. If you run tsc --noEmit against that config, it type-checks nothing at all and exits zero, every time.

So the pre-push check passed. It always passed, and it would have passed on an empty repository. Meanwhile eight real type errors piled up, including a page importing a component that had never been written, which would have crashed at runtime, and every production build failed. Because the deploy failed instead of deploying something broken, the previous container just kept serving traffic. The site was up, but it was two months stale, and the signal that should have told us was a green check mark that didn’t mean anything.

Three things came out of that:

  • The verification command must be the build command. Client type-checking is now tsc -b, which matches exactly what Docker runs. If a check doesn’t reproduce the build, I don’t really count it as a check.
  • A green result from a command you have never seen fail deserves suspicion. Introduce a deliberate error and confirm your check goes red. If it stays green, it isn’t actually checking anything, it’s just a step you run.
  • Deploy success needs positive confirmation, not the absence of alarms. The healthcheck now returns an explicit version string that gets bumped on notable releases. “Is the site up” and “is the site running the code I just wrote” are different questions, and in my case only the second one was ever in doubt.

There’s a related shell trap I want to mention, because it hid the broken typecheck twice. In a pipeline like npm run typecheck | head, the exit status you read back belongs to head, not to the typecheck. Use ${PIPESTATUS[0]}, or just don’t pipe it.

What Good Looks Like Now

Today, deploys land in under a minute and are verified by comparing the built asset hash against what production is actually serving. If the hash is identical, the code is identical, and there’s no guessing involved. The type check is the build, and the healthcheck names its own version. Three deploys in a single night with zero failed builds is now just an ordinary evening.

None of that took new infrastructure. It took removing one false signal and replacing it with a true one.

Getting Started

If you’re running an internal application or an AI pilot and want to avoid the same trap, here are three concrete steps I’d recommend:

  1. Break your CI on purpose. Introduce a type error, a failing test, a lint violation, and confirm each check actually goes red. Any check that stays green is telling you nothing, and you’re trusting it anyway.
  2. Make your verification command byte-identical to your build command. Not equivalent, identical. In my experience, the gap between “what CI runs” and “what the build runs” is exactly where silent failures live.
  3. Give every deployed artifact a version it can report. A healthcheck that returns “alive” only tells you the container is running. Have it return the release string, and check that instead.

We build these systems for ourselves before we recommend them to anyone. In the next post in this series, I’ll go inside the part everybody asks about: how a video of a swing actually becomes structured coaching feedback from a vision model.

If you’re standing up an AI application and want the architecture reviewed by people who have run one in production, feel free to contact us.

CB5 Solutions is a Microsoft Solutions Partner specializing in Microsoft Security, Data & AI, Modern Workplace, and Azure Infrastructure.