Skip to main content

Loading…

Skip to main content
HomeProjectsPostsResourcesContact
Justin Tsugranes LogoJustin Tsugranes Logo

Justin Tsugranes

HomeProjectsPostsResourcesContact

Stay in the loop

Occasional notes on what I'm building, lessons earned, and the studio behind it.

By subscribing, you agree to receive No spam. Unsubscribe in one click anytime. from Justin Tsugranes. No spam. Unsubscribe anytime. Privacy Policy

© 2026 Total Ventures LLC. All rights reserved.

Privacy PolicyTerms of ServiceCookie Policy
Inky's Secret: One Schema, Two Languages, Zero Mismatches | Justin Tsugranes | Justin Tsugranes
Xinf
Inky's Secret: One Schema, Two Languages, Zero Mismatches
←Posts

Building & Operating

Inky's Secret: One Schema, Two Languages, Zero Mismatches

Tired of client-server mismatches? Inky's iOS app and backend share a single Zod schema, generating Swift types directly. This means your client and server always agree on data shapes, eliminating common integration headaches.

Justin Tsugranes·July 9, 2026·4 min read
On this page
  1. The Problem with Manual Type Management
  2. How Inky Solves It: Zod as the Single Source of Truth
  3. Generating Swift Types from Zod
  4. Benefits of This inky-build Approach
  5. Implementing This in Your Own Stack
  6. The Future of Type Safety

If you've ever spent hours debugging a mobile app because the client expected one data shape and the server sent another, you know the frustration. With Inky, that problem doesn't exist. The Inky iOS app and its backend never disagree about a shape, because the Swift types are generated from the same Zod schema the server validates against. One source of truth, two languages — the client cannot drift from the contract.

This approach cuts out an entire class of bugs that plague mobile development. You define your data contract once, in a language-agnostic way, and then let tooling handle the translation. It's a fundamental shift in how you manage your API surface, moving from manual synchronization to automated consistency.

The Problem with Manual Type Management

Most mobile applications, especially those with a small team or a single operator, rely on manual type definitions. You might have a User struct in Swift and a User interface in TypeScript or a User class in Python. When the backend changes the User object — maybe adding a new field or changing a type — you have to remember to update the client-side definition. And vice versa.

This process is brittle. It's easy to forget a field, misspell a property, or get a type wrong. These small discrepancies lead to runtime errors, silent data corruption, or unexpected UI behavior. The more complex your data models and the more endpoints you have, the higher the chance of these mismatches. For a solo operator, every minute spent on these avoidable bugs is a minute not spent building new features or improving the product.

How Inky Solves It: Zod as the Single Source of Truth

The core of Inky's solution is Zod, a TypeScript-first schema declaration and validation library. Zod allows you to define your data shapes with a rich, expressive syntax. But the real power comes from its ability to be a single source of truth for both your backend and your client.

On the backend, Zod schemas are used to validate incoming requests and outgoing responses. This ensures that the data flowing through your API adheres to the defined contract. If a request comes in with an unexpected shape, Zod catches it immediately, preventing bad data from entering your system.

Generating Swift Types from Zod

The magic happens when you extend this concept to the client. Instead of manually writing Swift Codable structs, we use a custom script to generate them directly from the Zod schemas. This means:

  1. Backend defines the schema: The backend team (or the solo operator) defines the canonical data shape using Zod.
  2. Swift types are generated: A build step runs a script that reads these Zod schemas and outputs corresponding Swift Codable structs.
  3. Client uses generated types: The iOS app imports and uses these generated Swift types for all its network requests and responses.

This workflow guarantees that the Swift types in the Inky app are always in perfect sync with the Zod schemas on the server. If a field is added to a Zod schema, the generated Swift type will automatically include it. If a field is removed, it's removed from Swift. There's no room for human error in translating the contract.

Benefits of This inky-build Approach

This automated type generation offers several significant advantages, especially for a lean operation:

  • Eliminates Client-Server Mismatches: This is the primary benefit. You simply cannot ship a client that expects a different data shape than the server provides. The compiler will catch it.
  • Faster Development Cycles: Developers spend less time writing boilerplate Codable structs and more time on features. When the API changes, updating the client is a matter of re-running a script, not manually editing dozens of files.
  • Increased Confidence: Knowing that your client and server are always speaking the same language reduces anxiety during deployments. You can be confident that data parsing won't be a source of unexpected crashes.
  • Improved Code Quality: The generated code is consistent and follows a predictable pattern, reducing cognitive load and making it easier to onboard new developers (should that ever happen in a solo studio).
  • Clear API Documentation: The Zod schemas themselves serve as living, executable documentation for your API. They are the definitive source of truth for what data looks like.

Implementing This in Your Own Stack

While Inky uses a custom script, the underlying principles are applicable to any stack. You'll need:

  1. A schema definition language: Zod is excellent for TypeScript/JavaScript, but OpenAPI/Swagger definitions can also be used to generate types for various languages.
  2. A code generation tool: This could be a custom script (like Inky's), an existing library, or a tool built into your API gateway.
  3. An automated build step: Integrate the type generation into your CI/CD pipeline so that client types are always up-to-date with the latest backend changes.

This isn't just about saving a few lines of code; it's about building a more robust, reliable system. It's about applying agentic engineering principles to a common problem, letting the machine handle the tedious, error-prone work of synchronization.

The Future of Type Safety

As AI continues to collapse the cost of building software, the focus shifts to the quality of the underlying systems and the judgment of the operator. Eliminating entire classes of bugs through automation is a prime example of this shift. It allows you to build more with less, focusing your precious attention on what truly matters: delivering value to your users.

This approach to inky-build is a small but critical piece of the larger operating system that runs Total Ventures. It's one of many ways to cut unnecessary complexity and ensure that the products I build are solid from the ground up. What kind of synchronization headaches are you still solving manually?

RecommendedFree

Free download

Get the Launch Checklist →
If this resonated

Here's where the rest of it lives.

The free guides, the playbook, and a done-with-you sprint — the whole ladder, on one page.

See the resources
  • Free guides

    The Studio Launch Checklist + four operator guides, free.

  • Builder's Playbook

    Six reports with the architecture, funnel, email, and money systems — the decisions already made.

  • Solo Launch Sprint

    A fixed-scope, done-with-you sprint — walk out with it decided, sequenced, and live.

Studio Notes

How I’m building the studio.

The operator’s log — systems, decisions, and what’s working.

JT

Written by

Justin Tsugranes

Founder, Total Ventures

Solo-founder building a multi-brand product studio with AI agents. Writing about building, operating, and shipping.

ShareXLinkedInFacebook
#inky-build#zod schema generation#swift type safety#client server synchronization#api contract management

On this page

  1. The Problem with Manual Type Management
  2. How Inky Solves It: Zod as the Single Source of Truth
  3. Generating Swift Types from Zod
  4. Benefits of This inky-build Approach
  5. Implementing This in Your Own Stack
  6. The Future of Type Safety