Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk6 min

How We Built Fair Fight: An Honest Build Retrospective (TanStack Start + Stripe + Clerk + Postgres)

Fair Fight's build retrospective shows why a handler that passes unit tests can still return 404 in production, and how the team designed Stripe payments, data ownership, and feature gates.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Fair Fight team’s build retrospective makes one point clearly: a handler that passes its unit tests has not proven that the route exists in production. The team found an API route that returned 404 when deployed even though direct tests of the handler passed. Their account of how they fixed that, and how they designed payments, data ownership, and feature gates around similar gaps, is a useful checklist for any small team shipping a TanStack Start app with Stripe, Clerk, and Postgres.

The article is a first-party engineering retrospective by the Fair Fight team, published under the byline fairfight and dated September 16 (the year is not shown in the copy we reviewed). It describes the team’s own implementation and observed behavior. It is not an independent review, a security audit, or proof that the product is running in the configuration described today.

As an Amazon Associate I earn from qualifying purchases.

What Fair Fight is, and the boundary the team draws around it

Fair Fight is described as a mobile-first legal-education workspace for self-represented litigants and people preparing to talk with a lawyer. Its stated tasks are organizing case facts, understanding legal issues in plain English, and reviewing candidate legal arguments linked to public legal sources.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The team is explicit about what the product is not. It does not provide legal advice, representation, or filing-ready documents, and it does not guarantee deadlines or outcomes. Readers are directed to verify deadlines with a court or a licensed attorney. That boundary matters for the rest of the article, because several of the engineering decisions were made to keep the product from implying more than it does.

The reported stack

  • Routing and server functions: TanStack Start, using file-based routing and server functions
  • UI: React 19, built with Vite and styled with Tailwind 4
  • Authentication: Clerk, through @clerk/tanstack-react-start and @clerk/backend
  • Database: Neon serverless Postgres, accessed through its HTTP driver
  • Payments: Stripe Checkout for a one-time, per-case Pro Case Analysis purchase
  • AI tools: Gemini and Groq, used for the candidate-argument and document tools

The article reports the price as $99 per case when payment access is enabled. That is the team’s stated configuration at the time of writing. The article does not establish that this offer is live now, so treat the figure as a historical reference rather than a current price. The team also says the product uses first-party analytics and no ad-tech scripts.

Lesson one: a handler in a route file is not a mounted route

The first lesson is the one the team leads with. An API handler sitting in a route file does not automatically become a deployed endpoint. In the example the team gives, a self-serve export and deletion endpoint passed direct tests, yet the deployed route returned 404 because it was never mounted.

The permanent fix had three parts: an explicit createFileRoute(...) registration block, a smoke test that hits the mounted route rather than the handler function, and a team convention requiring that registration block in every API file. The takeaway the team draws is to test the running route boundary, not only the function behind it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Each verification layer answers a different question, and none of them answers the others:

Verification layer What it shows What it does not show
Direct handler unit test The handler logic returns the right result when called directly Whether any URL reaches that handler after deployment (the team’s 404 case)
Mounted-route smoke test The deployed path responds through the registered route Whether the surrounding UI flow, payment, or account state works end to end
End-to-end flow check before enabling a feature The complete user path works as built and deployed Anything outside the flow that was tested, such as other routes or future changes

Payments: the Stripe webhook as an authorization boundary

The team treats the payment webhook as an authorization boundary, not a plumbing detail. The design it describes, in the order the request is handled, is:

  1. Reject any request with a missing or invalid stripe-signature header with a 400 response, before any client or database call is made.
  2. Verify the event asynchronously with stripe.webhooks.constructEventAsync(...). The team chose the async variant because the synchronous one produced a Bun SubtleCryptoProvider context error in its environment.
  3. Record event IDs in a ledger so that a repeated delivery is handled idempotently.
  4. Check the exact amount, currency, mode, payment status, and configured price ID against the expected purchase.
  5. Confirm, on the server, that the paying user owns the case the purchase is meant to unlock.
  6. Treat a refund as a change in payment state, so entitlement is denied afterward.

These are the team’s reported design and its observed behavior in its own setup. The article does not present them as independently audited, and a reader should not read the list as a certification that the flow is secure.

Why the checks are exact rather than approximate

The checks on amount, currency, mode, and price ID are what stop a valid Stripe signature from being enough on its own. A correctly signed event can still describe a different product, a subscription rather than a one-time payment, or a session that did not complete. Matching the configured price ID and requiring a paid status closes those gaps. The ownership check then ensures that a valid payment for one user’s case cannot unlock another user’s case.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Feature gates: nothing customer-facing ships as “working” until it is verified

Flows that involve money or sensitive data sit behind a single restrictedFeatures module. A gate opens only after the flow has been built, deployed, and verified end to end. While a feature stays gated, existing entitlement records are preserved rather than deleted, so turning a gate off later does not lose anything a customer already has.

The team sums up the rule in one sentence, which it presents as its stated product principle: “We will not claim a feature works until it is actually verified end-to-end.” That is a statement of intent about how the team works. It is not an independent check that every feature was verified in the way described.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Server-function validation and a sign-in bug

The team also reports an authentication problem with a POST server function that used .validator(). A signed-in session received “Sign in required,” while a counterpart without a validator authenticated correctly. The fix was to move to explicit per-field validation and sanitization inside the handler.

This is the team’s experience in its own codebase. It is not a general finding about TanStack Start validators, and the article does not claim that validators should be avoided. Readers hitting a similar symptom should compare their own validator and session setup before drawing a broader conclusion.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Ownership, evidence storage, export, and deletion

Child records, including analyses, timeline entries, calendar events, and evidence, are scoped to their owner through cases.user_id. Evidence metadata lives in an evidence_files table. Binary payloads are stored in a BYTEA NOT NULL column.

The stated limits on evidence are:

  • A 10 MB limit per file, enforced on the server, as the article reports it.
  • Accepted types of PDF, JPG, PNG, WebP, and TXT.
  • No claim of legal-grade evidence preservation. The team describes the system as educational tooling.

Readers who keep original paper or digital records should keep those originals; the app’s storage is not a substitute for that. Export and deletion are built as user-facing controls:

  • Export: a JSON snapshot of the signed-in user’s dataset. It includes evidence metadata but omits binary evidence.
  • Deletion: removes that user’s rows inside a database transaction, writes an audit record with per-table counts, and then makes a best-effort attempt to delete the Clerk account. Because the Clerk step is best-effort, a deletion can complete in the application database while the external account removal fails, and the team’s description does not say how that case is surfaced to the user.

Analytics without cookies or third-party scripts

Analytics are sent with fire-and-forget navigator.sendBeacon requests to POST /api/track. The endpoint validates a small set of route, session, referrer, and UTM fields and inserts a row. The team states there are no cookies and no third-party scripts, and that analytics cannot change payment or entitlement state.

What this article does not establish

The retrospective is useful, but it has clear edges:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • It is a single first-party account. It has not been independently audited, and the article does not claim that it has.
  • It does not confirm the current deployed state, the current status of the feature gates, or the current price.
  • The publication year is not shown in the copy available here, so the account should be read as a snapshot of the team’s build at that time.
  • Its specific findings, such as the Bun context error and the validator sign-in issue, describe one environment and may not apply to other stacks.

For the original account, read the Fair Fight retrospective on DEV Community, which the article says was originally published at fairfight.ctonew.app.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.