Foambyte Engineering Series
How I designed and built Foambyte, a brewing production platform: React, Capacitor, Hono, Cloudflare Workers, PlanetScale Postgres and more, in the order it happened.
Foambyte is a production-management platform for craft brewers that I co-founded with my brother Diego, a brewmaster who leads the product as CPO. I designed and built the platform. These 15 posts document its architecture as it evolved: each one explains a decision, the alternatives, and why it was the right trade-off at the time.
2025
-
Adopting the React Compiler Early in a React 19 + Vite App
Why I turned on the React Compiler (RC) in Foambyte's React 19 + Vite app, how to set it up with Babel and ESLint, and the rules I follow so it can do its job.
-
Choosing Authentication for a Web + Mobile SaaS: Why better-auth
Why Foambyte uses better-auth with Hono and Drizzle instead of Clerk, Auth0 or Supabase Auth, and how cookie sessions work across the web and Capacitor apps.
-
ArkType vs Zod: Why I Standardized on Zod Across Forms, API and Database
I started Foambyte with ArkType and switched to Zod. The deciding factor wasn't speed or syntax but integrations: drizzle-zod, zod-openapi and TanStack Form.
-
Testing Brewing Math: Unit Tests for IBU, Color and Carbonation Calculators
How I test Foambyte's brewing calculators with Vitest and Zod: reference values, round trips, behavior checks and 330+ tests for IBU, SRM and CO2.
-
Offline-First Editing with TanStack Query Persistence and Last-Write-Wins Patches
How Foambyte kept recipe edits working offline: a persisted TanStack Query cache, a last-write-wins patch queue, and one merge function shared with the server.
-
From Path Aliases to a Real Package: Lessons from a pnpm + Turborepo Monorepo
How Foambyte's React app and Hono API share code in a pnpm + Turborepo monorepo, why path aliases broke Docker builds, and the setup that works.
-
Self-Hosting a Turborepo App with Docker, Bun, nginx and Traefik
How Foambyte's React SPA and Hono API ran on a VPS: multi-stage Docker builds for a Turborepo monorepo, a Bun runtime, nginx, Traefik and Docker Swarm.
-
Building a Recipe Calculation Engine in TypeScript: IBU, SRM, Fermentability and FG
Designing Foambyte's brewing recipe engine: an ordered chain from volumes to OG, IBU, attenuation, FG, ABV and SRM, built as pure TypeScript functions.
2026
-
One React Codebase for Web, iOS and Android: Vite, TanStack and Capacitor
Why I built Foambyte as a React 19 SPA packaged with Capacitor instead of React Native or Next.js, and the TanStack Query pattern that keeps it maintainable.
-
End-to-End Type Safety Without tRPC: A Shared Hono + Zod OpenAPI Contract
How Foambyte's React frontend and Hono API share one type-checked contract in a Turborepo monorepo: Drizzle, drizzle-zod, zod-openapi and shared route paths.
-
Hono on Cloudflare Workers: Leaving a Docker VPS and Getting the Middleware Order Right
Why I moved Foambyte's API from Docker Swarm to Hono on Cloudflare Workers, and the middleware chain for rate limiting, CAPTCHA, sessions and plan gating.
-
Migrating from SQLite to PlanetScale Postgres 18 and TimescaleDB on Cloudflare Workers
Why Foambyte moved from SQLite to PlanetScale Postgres 18 with TimescaleDB through Cloudflare Hyperdrive, and the playbook for a short, verifiable cutover.
-
Integration Testing a Cloudflare Workers API Against Real Postgres with PGlite
How Foambyte runs 330+ Vitest integration tests against an in-process Postgres 18 with PGlite in about 10 seconds, including multi-tenant isolation tests.
-
How I Use Claude Code on a Production SaaS Without Vibe Coding
The guard rails behind AI-assisted development at Foambyte: CLAUDE.md as a contract, pinned skills, permission denies, diff review, audits and deploy gates.
-
Vite+ 1.0 Is Out: Should Foambyte Trade Its Toolchain for One Command?
What VoidZero shipped in Vite+ 1.0, a unified vp command for Vite, Vitest, Oxlint, Oxfmt, tsdown and caching tasks, and the pros and cons we're weighing for Foambyte.