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

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 ?

Best ui tools for drag/drop with folders and lists in a sidebar nav ?

My app has alot of lists in the sidebar and i need to add folders, i want users to be able to add a folder and move lists into a folder all in the sidebar - im thinking a bit like how apple music desktop app sidebar works. I looked in a few popular css libs and cant see anything like this? also i dont really need a full lib just a solution for this - thanks

onMouseDown not accessible for keyboard users

I was watching this theo video https://www.youtube.com/watch?v=yaMGtiPckAQ and started to implement onMouseDown isntead of onClick for all my buttons. However I ran into a problem where now users cant use the buttons anymore with tab + space. Anyone has a fix for this instead of making a custom button component?

How to await params?

Hello, scoured stackoverflow and enlisted the help of some LLMs but couldn't figure this out (maybe i need sleep). I get the error: Error: Route "/[baseId]" used params.baseId. params should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis at ProjectPage (src/app/[baseId]/page.tsx:14:24) 12 | export default async function ProjectPage(promise: Promise<{ params: { baseId: string } }>) {...

T3App session not set

Spun a new app with AppRouter, NextAuth, TRPC and prisma with sqlite, have added my discord auth and can confirm working (can see session in db). However session is still undefined and have no idea why. I can technically fix it by adding SessionProvider but I dont think this is the right choice when using AppRouter. Thanks!...