TypeScript

Type-safe edges, untyped middles.

Why I validate at the boundaries and trust the middle. The pragmatic case for arktype/zod schemas where they actually pay rent.

By Dave Fajardo6 min read
04 — schemas
Mock editorial thumbnail. Replace with Sanity cover imagery when CMS content is connected.

The setup

Most ops teams don't need more software — they need the right pieces wired correctly. On a recent engagement we inherited a stack with eleven different SaaS tools doing roughly the same job. Cleanup wasn't a feature, it was the work.

Why it matters

When integrations fail silently, every other system inherits the bug. The fix is not "add monitoring" — the fix is to make the integration single-source-of-truth so there's no drift to monitor.

Build for the system you'll have in six months, not the one you have today.

How we did it

  1. Audit the moving parts. List every entry point and every webhook.
  2. Pick a backbone — Postgres, Supabase, or just a JSON contract you actually own.
  3. Migrate one feature at a time. Don't rewrite, replace.
Code sample
// Single source of truth — the rest of the system reads from here.
type OrderEvent = {
  id: string;
  status: "received" | "fulfilled" | "shipped";
  occurredAt: string;
};

Outcome

  • Three legacy services retired.
  • Mean-time-to-resolve down from hours to minutes.
  • Documentation got shorter, not longer — that's the tell.

If your stack feels like a Rube Goldberg machine, the answer usually isn't another tool. It's a sharper contract between the tools you already have.

Sources