Next.js Discord

Discord Forum

NextJS, TRPC Structure

Unanswered
Spot-billed Duck posted this in #help-forum
Open in Discord
Avatar
Spot-billed DuckOP
Hi guys, I encounter some architecture issues:
I'm using TRPC, DrizzleORM.

How I should structure my data ? For the frontend, for the back,
My types are generated by drizzleOrm, and get by my trpc backend.

But for the front, should I use the same types ? For forms for example

Thnaks

1 Reply

Avatar
Spot-billed DuckOP
that for example:
schema.ts
export const userSchema = createInsertSchema(users).omit({
    emailVerified: true,
    password: true,
    isStaff: true,
    image: true,

}).extend({
    type: z.string()
})




export const insertUserSchema = createInsertSchema(users)