// Engineering
Engineering notes
Write-ups on the decisions behind the projects in the directory: where data should live, what belongs at the API boundary, and what a client-rendered application actually costs. Each note names the project it comes from, and each project entry says whether its source could be inspected.
- APIsValidate once, at the boundaryWhy schema validation belongs in the HTTP layer, and how Zod turns a validation step into the single source of truth for a route's types.ZodExpressTypeScriptValidation3 min2 Oct 20264 sectionsRead
- Commerce logicDelivery and coupon rules belong in pure functionsZone-based delivery pricing and coupon logic look like data and behave like code. Keeping them pure is what stops the quoted price and the charged price from disagreeing.PricingTestingPure functionsDesign3 min2 Oct 20263 sectionsRead
- Frontend architectureServer state is not client stateA React app has two kinds of state, and putting both in a global store is how stale totals survive a successful order. TanStack Query as the boundary.ReactTanStack QueryState managementCaching3 min2 Oct 20264 sectionsRead
- Full-stackMongoDB from Next.js route handlersConnecting a Mongoose model to an App Router route handler without opening a new pool per request, and being honest about what the single-service boundary costs you.Next.jsMongoDBMongooseServer3 min2 Oct 20263 sectionsRead
- Frontend architectureThe cost of a client-only SPAAn empty mount point is not a rendering detail. What a Vite single-page app gives up in SEO, first paint and failure modes, and what the alternatives cost.ReactViteSEORendering3 min2 Oct 20264 sectionsRead