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

pnpm / turbo monorepo - how to structure shared dependencies

I'm fairly new to monorepos, even more to turbo does anyone have advice on what's the least headache-prone way of structuring shared deps (e.g. one typescript version, one zod version) across a monorepo? one way ig would be to to create a package, e.g. packages/zod, then use that packages whenever you need zod...

Is there a way to Export chat?

Just answered my own question.. Yes, to MD, right click on chat and select Export

NestJS optional Body Fields

How can i accept a partial object as Body using NestJS ```ts import { ApiProperty } from '@nestjs/swagger'; import { IsOptional, IsString } from 'class-validator';...

ERROR! XHR failed 400

I was uploading pretty well images till yesterday but on waking up I'm getting this error, is there a breaking change somewhere... [02:55:01.726] ERROR (#166) handleErrorRequest=3ms: Invalid signature

I was trying to introduce credentials provider alongside my already existing emailprovider

I am using app-router. I broke my application, I am now trying to just get back to using my emailprovider, I reset everything I can, removed jwt as the session strategy, deleted my .next directory, my node_modules, cleared my browser cache. When I build my application I get no errors, so I really don't know what else I can do. Help would be sincerely appreciated...
Solution:
I fixed it had to delete my users unfortunately :( this was the solution so I do think it was a db issue I caused...

Python script in upload thing

Hello just wondering why when I'm trying to upload a python file text/x-python it does not fall into either text or blob Also I don't even have an option to add the text/x-python file type to allowed content types...

T3 Env - Handle Dev vs Prod

How do you all handle prod vs dev values using t3 env

Keys

Is key={crypto.randomUUID()} an okay-ish way of setting keys in TSX/JSX maps? I won't be needing the key for anything later but I'm not sure if this is a good way of going by it
Solution:
you want to ensure that your key is something that is the same for the same state and different for all other states, a uuid is perfectly fine for this but it should not be randomly generated on the fly

v0 quirk or am I dropping the ball?

Using https://v0.dev for a quick and dirty project.. when I go to add a component to an existing project using the provided shadcn cli command it adds a new /app folder? Not just that, but half of the files get added to the correct /app folder and the others do not.. I would like to think that I am the one dropping the ball here, but I can't seem to find an efficient solution that works.. I have resorted to downloading the zip and manually transferring every file that I need.. Please advise..

Text editor for React

Is React Quill New a fork of React Quill still a good choice for new projects needing text editor feature ? Or there is anything out there which has same features but better DX ?
Solution:
From what I understand — it is, just trying to stay (more) up to date with QuillJS version updates. I was looking for a customisable WYSIWYG text editor and settled on https://tiptap.dev/. It was pretty great to use. All that you need there is open source and free...

What app would you recommend for getting a project demo/prototype ?

Hey guys. I'm having a bunch of ideas at the moment but struggle to get them started. Feels like setting up frontend and implementing all the design features is getting absolutely boring for me. I would rather do backend features all day long instead of that boilerplate frontend code. What app / ai tool would you recommend me that can make frontend designs/features decently ? PS: I come from a Theo's youtube video where he tested out multiple platforms that couldn't do much of the stuff he wanted, but I want to hear others opinions. Loveable did a pretty good job at doing the frontend but totally missed out on the backend....

Help with React Native dev

Hi everyone I don't know if I can post something like this but tell me if not, I'll delete it. I want to get into mobile development with React Native, but I'm feeling a bit overwhelmed by all of it. I followed this course on YouTube: https://www.youtube.com/watch?v=sm5Y7Vtuihg After that, I tried to dive into the developpment of my own app, but maybe I was trying too hard to do everything perfectly. I did a lot of research on the best stack, the best architecture, etc., but I really don't know enough about it. The course was quite basic, although I learned a lot. It's been a few months now since I've put my project on hold because of the mental hurdle....

Video Editor App

Hello Somebody is offering me a job helping to create the UI for an Online Video Editor that can delete and add parts of a video and add music and text to the video. I will talk with this person, but I wonder what I should know. It is quite a new area for me. Before, I tried to create a custom player and had some Canvas API experience. What tools and libraries can I use? What should I be aware of? ...

Hot swapping models due to demand? Good ideas on solutions?

I have a product I’m working on where I want the cheapest fastest model to do a single thing (OCR) and was mostly just using Gemini 2.0 lite. Thing is, when developing last night and it appeared to be degraded and was giving me 400-500 responses. I am not super picky on model usage, Gemini, Gemini lite, mistral 3.1 small, any will do the singular task I want. Does OpenRouter or some other service exist to balance responses between model providers? Ideally give a priority (on price) but have fall...
Solution:
…literally the first page of the open router docs:
OpenRouter provides a unified API that gives you access to hundreds of AI models through a single endpoint, while automatically handling fallbacks and selecting the most cost-effective options....

AITA? - Swapping components in-place with state in React Native

I’m a junior-level frontend developer. I’ve been with my company for only a year and this is my first job as a frontend dev. I was hired to help write our new app, as the one we were using was a template app maintained by a vendor. We’re writing the new app in React Native and it feels very nice to be able to create native interfaces using JSX and syntax I already know from personal projects. We’re using Expo, React Native Paper, React Navigation, etc. My question is this: I’m one of two people working on the frontend of the app. My coworker tends to use a special pattern when designing linear flows of screens for sign-in, forms, or really anything. Here's a generalized example of what a “Flow” component looks like:...

What would you recommend?

What would you guys recommend when building an application? Going with something like trpc + react query, or going just with server components?

How to store user's tier?

I use Theo's recommendation for Stripe integration. However, I have a question. I don't know how to store the tier of the user (free,plus or pro). ...

How to define `waitUntil`?

I saw function waitUntil in Theo's Stripe recommendation. How should I define that function?...
Solution:
I suppose it's in this way:
import { after } from 'next/server'
import { after } from 'next/server'
...

need advice with building e-commerce application

Hey folks I'm building E-commerce app for the first time obviously I will need an Storefront and Admin Dashboard for this considering I have this domain example.com Storefront will be hosted on example.com while Admin dashboard on subdomain admin.example.com first thing is this approach good or I should have entirely different domain for both thing and second thing I need help with how should I approach the auth for this a centralize approach with RBAC( Role Based Access Control ) where I...

is there anything wrong with data fetching , accessing state in next js templates?

i am fetching data of my app inside a template.tsx the data is set as state using zustand , i then access that data using the zustand store this is all being done in template.tsx file of my home directory which has almost all the application pages is there anything wrong with this current implementation ?