One month after launch, I threw our order system away
EngineeringInertia.jsAdonisJSCITanStack QueryRewrite
Flair v1 took every order from October 2026. A month in, every click waited on a progress bar and CI took over an hour, so I decided to rewrite a live system.
On 1 November 2026 I wrote a short document called “Flair: stack decision”. Its first line said Flair would be a single TanStack Start app, rewritten from AdonisJS.
Flair v1 had been taking all our orders for about a month. It had 813 commits, CHIP payments, GoGet delivery, a WhatsApp inbox and an MCP server. It worked.
It went to production in October, and a month in, every click felt slow. So I switched to v2.
Rewriting a live system is the classic mistake. Every developer has read the warnings. So why do it?
Every click waited
Flair v1 was AdonisJS with Inertia.js and React, on Postgres, on our VPS in Malaysia. Inertia’s idea is simple: the server sends each page with its data, and the React side just renders it.
The cost is that every click goes to the server first. You tap an order, Inertia asks the server for that page’s data, and nothing changes until it arrives. While you wait, a thin progress bar runs across the top. Nothing is cached in the browser between pages, so going back to a page you just saw waits again.
The database wasn’t the problem. The rewrite plan says it plainly: Flair felt slow because every click waited on the server, not because the database was slow.
The odd part is that I’d chosen this. I’m a fan of TanStack Start and TanStack Query. But Adonis has its own way to fetch data: Inertia page props, a useHttp hook, and Tuyau, a typed client for Adonis routes. There’s a TanStack Query integration on top of that too. Put together, there were several ways to load the same data, and the models mixed them up. Clear rules in AGENTS.md didn’t stop it.
So on 11 September, early in v1, I removed TanStack Query and moved every page to an Inertia-first data flow. The goal was a clear separation of concerns: one owner for each kind of data. The frontend rules ended up with a decision table that names, for every case, which of Inertia, useHttp or Tuyau owns it.
It worked, in the sense that the agents stopped mixing them up. Two months later, the cache I’d given up was a big part of why I wanted to leave.
CI took over an hour
The second problem was CI. We ran the full suite on every pull request, then again on the merge to main. That burned through GitHub’s free Actions minutes fast.
So on 8 October I moved CI to self-hosted runners on a separate VPS. There, the CPU became the bottleneck. Many tests turned flaky, failing for timing and not for bugs. One pull request plus its merge to main took over an hour, when it should take 20 to 30 minutes.
I spent October trimming it. Pull requests ran only the core checks. Caches stayed on the runners. Main skipped suites the pull request had already passed. Even so, CI was one of the two things that tipped me into a rewrite.
For someone building with AI agents, that hour mattered. The code arrived quickly. Proving it worked didn’t.
Why rewriting was the safer choice
Here’s the answer to the classic-mistake question. Two things made the rewrite less risky than staying.
First, the app was about to get smaller anyway. The redesign removed stock, tasks, follow-ups and production tickets, as I wrote in the last post. If a large part of the code is going, that’s a good moment to change the stack under the rest.
Second, the fix for the speed problem was in the stack, not in the code. A frontend that keeps data cached and loads a page before you click it can’t be bolted onto Inertia. The rewrite plan put it plainly: keeping Adonis and Inertia was rejected, because the progress-bar wait comes from how Inertia loads every page.
So Flair v2 preloads a page’s data when your pointer hovers its link. TanStack Query shows cached data at once and refreshes it in the background. And release CI now runs only the tests a change affects.
Flair v2 went live on 11 November. Now pages open before you finish the tap. My co-founder said it’s fast compared with both Charm and Flair v1.
The lessonRewrite when the cause is the foundation, not the code on top of it.
What I’d tell anyone thinking of a rewrite
- Find the cause first. Our database was fine; the waiting came from the page model.
- Rewrite after you cut scope, not before. A smaller app is a smaller rewrite.
- Count CI as part of speed. If a change takes an hour to prove, everything slows down, not just deploys.
- Keep the old system untouched for a while. We kept v1 for 30 days, as somewhere to look things up.
The decision was made on 1 November. The first thing to decide was what to rewrite it on, and that came down to 153 lines against 94.
