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

How much do y'all charge for your apps?

I have created two complete custom apps for clients, took 40-60 hours a piece. Just curious how y'all price your stuff....

Drizzle client side vs server side?

hi can someone help explain to me a bit about drizzle? as far as i can tell, its doing client side api calls and requires me to use NEXT_PUBLIC env variables which isnt secure right? is it possible to put my drizzle calls into server and therefore not need to expose the env variable to browser?

t3-turbo + next-i18n + tRPC doesn't work on Vercel only locally

Hi. I tried to implement server side localisation in tRPC according to this article https://levelup.gitconnected.com/add-i18n-to-t3-stack-apps-8010e88a3a81 and this linked repo https://github.com/EugenVolosciuc/t3-i18n-demo. It is not turbo repo (just create-t3-app) and works both locally and on Vercel. My implementation with turbo repo https://github.com/martin-prochazka/create-t3-turbo-next-i18n works only locally (it is fork of create-t3-turbo simplified for this showcase): https://create-t3-turbo-next-i18n-nextjs.vercel.app/...

Anyone have an exampe of two nextjs applications in a single repo?

Basically I want to have a website for the customer facing site and another for the admin portal to manage customers. I am planning on having it share Prisma schema.

Recommendations for validation library?

in t3 docs under other recommendations section, there is no validation library there https://create.t3.gg/en/other-recs
pls give me some...
Solution:
Zod?

superplanet conection fails in production mode

I need help with next auth / planetscale connection. my app works fine in localhost but does not connect to the databank in production after deploying to vercel for some reason. I have a production branch with safe migrations enabled and the enviroment variables set, is there any other steps involved ?

Question about next auth.

Hey all, The stack and full stack development in javascript in general is new for me. I finding my way around while using the documentation. But I was wondering what the best way/ implementation should be to use next auth to call a query from another API. Old API that is still in use for verification. I can make this call with the correct credentials . Afterwards i want to check in the same function for the email and password via a trpc query in a table in my database and return the result (unique user with that email and password) as my user in the session. But i'm kinda stuck on the big picture here i guess. ...

Why does `npm create t3-app@latest` use the /pages directory. How can I use the app router?

I want to build an application which uses the latest nextjs app router, however the create t3-app@latest command creates an app which uses the /pages router.

nextjs13 do get request with searchbar

Hi, I am currently building a nextjs 13 project, trying to get in touch with the app router and server components. I currently have a searchbar, which is a client component, and I want it to do a get request from an api with the input from the searchbar. Should that request be done in a client component with something like react-query or is there some work around to be able to fetch inside a server component?...

How to sent a mutation procedure from the client

updateUserStats:protectedProcedure .input(z.object({ id:z.string().nonempty(), protein:z.number().int(), carbs:z.number().int(),...

Server Actions high level questions (scale, request library, exposing to other clients)

1) how are you supposed to scale a backend if your business logic is in react components? if this was never the idea then what's the point of server actions bar the ability to make requests to the server without shipping js 2) what's the new meta for requests? i didn't see a successful trpc implementation yet, will that not fit in the new paradigm? just react query and sharing a zod validator? 3) do i avoid server actions if i plan to make mobile client that will also consume the api? in a t3-turbo way...

upload thing jest

how to i set up testing with jest on components that include uploadthing? [2:40 PM] seems like it keeps throwing this error Cannot find module '@uploadthing/react' from 'src/common/tests/components.test.tsx'...

NextJS and Bare Metal

What all features would break/may not work if I decide to deploy to NEXTjs to bare metal instead of serverless?

Cloud storage solutions for collaborating on local files

I want to collaborate on .md files (via Obsidian. for developer documentaion) and video recordings with my team mates. I've tried pCloud and iCloud (and other solutions) that allow you to sync local folders. And share such a folder with team mates who will then have a synced version locally and changes it's contents. But this is only viable when files that have been changed start syncing near instantly....

cold starts

I’m having an issue with my first queries after the db going idle taking about 11s to 12s which is causing my vercel app to timeout as I am using SSR. I'm using standard t3 stuff (prisma, trpc) hosted on vercel and on neon. Is there a way to speed these up? I’ve - changed prisma to version 4.14.1...

Android emulator cannot connect to my Expo without tunnel

Hello, I am building an app with create-t3-turbo in windows 11. I keep getting the error connection timed out from the Expo Go in the emulator. I've tried to turn off my firewall, set the REACT_NATIVE_PACKAGER_HOSTNAME environment variable, but all of these do not solve the issue. However, when I use the tunnel mode to open my app, it just works without all of the configurations....

is this middleware is good for longterm?

hello guys, in these code snippet i want to check if user is subs and valid, but i im wondering if this thing is good to do for long term, and what is the pros and cons of this thankss ```ts const enforceUserIsSubscribed = t.middleware(async ({ ctx, next }) => { if (!ctx.session || !ctx.session.user) {...

Bidrectional Infinite Scrolling Implementation

Hi guys have you ever implemented something like this in a chat application? or any application for that matter, where your infinite scrolling is able to to scroll 2 directions and add items to the initial items either at the start or at the end of the items based on the direction of the scrolling of the user, I find this really hard to implement. Currently using react-infinite-scroller. Any help would be greatly appreciated! Thank you!

Is it possible to generate a github action to build a preview of a pull request in nextjs?

Im looking for a way to generate preview for my nextjs project but I didnt find a way to do it that works for me.

File Uploads to Local Storage

I'm building a website for my brother's shop. They want an admin panel where they can add new product pages. I'm mostly done except for image uploads. I got it working using normal api routes but couldn't find a way to achieve it in trpc. Since all of the project is typesafe back-to-front there are a lot of warnings and errors in my file upload api. They're already paying a hosting company for storage so I don't want to upload to S3, public folder in the server is quite ok. Is there a template o...