Theo's Typesafe Cult

TTC

Theo's Typesafe Cult

Join the community to ask questions about Theo's Typesafe Cult and get answers from other members.

Join

zod array still required?

Somehow following in my zod schema still requires my field
tags: z.string().array().nullish(),
tags: z.string().array().nullish(),
...

Cross platform stack (web & mobile)

Do you folks have any recommendations on what an optimal stack from a developer point of view would be for a cross platform app (web & mobile) with backend included and full type safety? Technologies/libs I have been considering to use but I'd gladly take other suggestions. FE Related:...

Initialized Project, just seeking clarification on next steps

I've just spun up a t3 app. It defaults to sqlite but I want to use postgres. So, I've spun up a postgres docker container and changed the .env database URL. Other than uncommenting the annotations in the prisma schema, is there anything else I need to do to migrate to the new DB properly so I can start building out my data model?...

Better-uptime or an alternative?

curious to what people are using to monitor their apps we have many running projects different langs/frameworks and by proxy many ec2 instances we also have internal servers so not everything is publily acessable but still want to monitor uptime on it...

ts types dumb question

dumb question, what's the difference between
{input}:{input:string} Or input:string
{input}:{input:string} Or input:string
in a jsx.element passed as prop for example...

Multi-tenant - easy no?

Am I missing something in plain sight ? Is there a well trodden path / mature framework within typical Next.js Prisma Vercel stacks for implementing a solid multi-tenanted SaaS ? Or is it that everyone rolls their own.

Standalone CLI in t3 project

Hi! So I wrote a question a while ago about making a little script for interacting with my db through prisma (https://discordapp.com/channels/966627436387266600/1024739607553786011) I was recommended ts-node to run the file, but that doesn't work at all. I think it has something to do with es6 imports/exports but it's really cryptic and I can't find much information about it. The error message looks like this: ``` PS E:\Github\frazzot-portfolio> npx ts-node .\src\utils\dbUtils.ts...

Cant understand this javascript syntax

Hey guys can someone explain me the meaning of that syntax ? thanks var varname1 [= value1] [, varname2 [= value2] ... [, varnameN [= valueN]]]...

nextjs middleware i18n rerouting based on IP

Has Anyone done nextjs middleware rerouting based on IP locale? Because Accepted-Language is not really correct way on setting language for user.

Why is Prisma the exception to ORM hate?

I've never used an ORM, but for years have heard mostly negative things across various languages. People throwing terms like anti-pattern etc. Yet Prisma touts itself as the "Next-generation Node.js and TypeScript ORM" and people suddenly seem to be more lenient with the idea. Random example:...

tRPC and WebSockets

``` Error [ERR_REQUIRE_ESM]: require() of ES Module /home/xxxxx/Projects/xxxxxxx/xxxxxxx/src/env/server.mjs not supported. Instead change the require of /home/xxxxx/Projects/xxxxxxx/xxxxxxx/src/env/server.mjs to a dynamic import() which is available in all CommonJS modules. at Object.<anonymous> (/home/xxxxx/Projects/xxxxxxx/xxxxxxx/src/server/db/client.ts:6:22)...

railway app websockets?

Any clue if railway supports a server using websockets?

What's the best way to do real time with T3?

I was thinking just using webhooks with the frontend but I'm not sure.

Zob nested object with react hook form?

I have a schema like this in zod: ```ts import { z } from "zod"; const createClientSchema = z.object({...

What are your preferred methods to offer account deletion?

Building on this GH discussion on nextauth: https://github.com/nextauthjs/next-auth/discussions/3935 Do you currently add your own with CSRF etc.? Would be curious to know if anyone here has some strong opinions on that....

Reusable Datatable (Typesafe)

Hey! I'm trying to make a reusable Datatable component, I envisioned basically sending the getter function (tRPC endpoint) as a prop into this component, but the types for this are a bit crazy... Has anyone ever done anything like this before? If so, any tips? Or any other ideas how to approach this problem? Thank you so much!...

Zod validation on client side and server router?

Hi, I am currently using zod to validate my react-hook-form on the client side, I see that the t3 creation has also zod on the backend server route, should I validate using the same zod schema? I thought of extracting the schema to import it on the client and on the backend to not have duplicate schemas. Not sure if there is a difference.