Skip to content

feat: Add zod-prisma-types for better type-safety and out of the box experience #2131

@ZiedYousfi

Description

@ZiedYousfi

Is your feature request related to a problem? Please describe.

Currently, the developer experience around Prisma schema validation and input/output typing could be greatly improved. The default setup doesn’t offer strong type-safety guarantees when moving between Prisma models and validation layers. This often leads to duplicated types, manual syncing between schemas, or potential runtime errors that TypeScript cannot catch.
It can be especially frustrating for newcomers or rapid prototyping when you expect things to "just work" out of the box.

Describe the solution you'd like to see

Integrate zod-prisma-types or a similar approach directly into the create-t3-app template. This would generate Zod schemas from Prisma models automatically, ensuring type-safety and consistent validation on both backend and frontend. Ideally, users could scaffold an app and have strong type-safe validation ready-to-go without extra manual steps.

Describe alternate solutions

  • Continue using manual Zod schemas, but this requires maintaining two sources of truth and can easily get out of sync with the Prisma models.
  • Stick to runtime checks or ad hoc validation, but this sacrifices a lot of the type-safety benefits that T3 aims for.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions