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

Unable to apply certain CSS-attributes to Radix components

I am working on a dropdown menu and text-based properties like text-xl, font-medium were applied, but not bg-lime-400 Looking at the DOM I can see that bg-lime-400 is in the classname, but looking at the styles tab in dev tools I see no mention of background-color being applied or overridden. Here is the code snippet in case it proves useful:...

How nextJS optimizes application for SEO?

If it's still an SPA why we can't have good SEO with CRA?

tRPC with mobile apps?

What's the suggested way of working with tRPC when it comes to mobile apps? How do you ensure that your CI doesn't let you push a new backend to production if it breaks the mobile app in production?

How to secure DB secrets in T3 stack (Next.js)

I am getting up and running with the T3 stack and I am wondering where I can keep my database secrets so they aren't bundled into the client. For instance, I want to use firebase-admin on my server which requires me to have a firebase config file. How can I tell NextJS "please keep these secrets only on the server side"?

tRPC vs nextJS API routes

In a T3 app, are there any advantages to still using plain old nextJS API routes? Or, do you find yourselves just putting everything in your tRPC router?

how do I get the name of the component passed as Outlet?

I'm using react-location for routing, and I'm passing some components as children to a this sharedLayout component. ```html <sharedLayout> <Outlet /> </sharedLayout>...

NextAuth - should I use JWTs or DB sessions (adapter)

I've watched the video where Theo rants about NextAuth, sessions etc. However my question is still which option should I use and why (between DB session and JWTs)? For example, I understand that the adapter is useful when you need to keep track of all the sessions, refresh tokens, invalidate sessions etc. and that JWT have their drawbacks, like you can't unset them once they are defined. However, in my case I don't really use those features (refresh tokens) at all because all I need from Auth is confirmation to let them login, after that I don't need any provider services because of which I would need to refresh. That's why I also don't need all the other information I get from the providers and It also makes managing the db simpler, because of some of my use cases....

Env import in `next.config.mjs` for Docker Image

Hey, in the docs of create-t3-app it states that I should remove the import { env } from "./src/env/server.mjs"; when deploying with Docker. How exactly am I able to do this only for production? Because I'd like to keep it for development to check env vars.

fetching data from external api with trpc

So i've watched a couple trpc videos, but I still don't know how to fetch data from some api for example: https://pokeapi.co/ with TRPC. TRPC is for sure the most confusing part of the stack for me. Am I just dumb?

picking new tech quickly

What's your advice of picking new tech quickly? I was invited to do a task for recrutation in Django, the problem is Ive never used Django before (job is for jr backend i mainly do front these days but why not give it a shot) I did something with flask in the past, don't know how similiar they are. The task doesnt look that hard and I have 7 days but still not knowing Django sucks 😵

Content Repositories - Please not WP!

We need a content repo for users to create structured content which gets used in an t3 app. Why build this when there should be good solutions out there. What's your experience in accessing and using them in your t3 application?

React Take home ideas?

Anyone have good ideas on what to give prospective interns as a technical assessment/take home for react? I was thinking like a todo app using zustand or something. They have a week to do it, but it's assuming like total beginner with react and possibly JS. Any advice is welcome. I'm just worried of making it too hard 🤣...

Realtime replacement for Cloud Firestore

I'm trying to rewrite / refactor an app I've been working on for some time. I made a lot of bad decisions because I didn't know what I was doing back when I started it. One of these decisions using Cloud Firestore as the database, which has been quite limiting. I was watching Theo's video on databases and he said that Supabase has basically replaced the need for Firestore right now. However, contrary to the video the realtime support seems really half-baked. "Presence", as they call it, seems basically undocumented and not type safe. I haven't actually gotten it to work yet so maybe I'm just missing something. Has anyone built a realtime application with supabase or can anyone give me another realtime database recommendation?...

Vite with Jsconfig

The code works fine with CRA, but when migrated to vite, the import statement throws error. Its apparently assuming utils as a package because I dint prefix it with "../utils", but I don't technically have to anymore since I'm using jsconfig and it worked well in CRA Attaching the code and error...

How does NextAuth save user info to the database with the prisma adapter?

Is it possible to see the function that nextauth calls to save user info to the database? Is there a way to console.log what the Provider returns after signing in? I'd like to add one more field to the User schema like their Facebook Public Profile ID after signing in when using FacebookProvider but I don't know where to start....

Supabase Magic Link Auth with Expo

Anyone ever successfully get this working? I get all of the necessary tokens back with the callback url but I'm not really sure what I should be doing with them. From what I can gather from the documentation (which isn't great) supabase.auth.onAuthStateChange should be firing but it's not.

Setting up token auth to a redis cache

Has anyone tried doing this? I'd love to just throw money at the issue but I havent been able to find anything that does what I want. Basically I want to use token based auth with connection limits to connect to the redis server but uhhh I've never done this before. The image shows what flow I'd like to mirror...

What does nextjs do after router changes?

I saw the theo's last video about under the hood of nextjs. Realizing after the first html loaded and hydration is done, then everything is like SPA. This is so clear before I change the route. In my case, I use a state call isDesktop to render mobile/desktop version of a page which depends on media query(default is false when runs on node) ...

T3 Stack Form Validation

In general, I think I can safely say that good form validation requires both: - the client UI to tell the user when form fields are valid - the server checks all of the fields and validates them before accepting a request ...

How do I detect mock GPS location?

I want to detect mock/fake GPS location using React Native (Or any language/whatever for that matter). If any of you people have done anything similar or have an idea on how it's done, let me know! Couldn't find much by searching. May not exactly be the server for this, but this is the only place I expect senior-ish and reliable answers from.