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

does uploadthing have a progress bar?

I want to know if there is any way to get progress percentage on image/video loading for the project https://docs.uploadthing.com/

Consuming external API with TRPC.

Hi so I have created this TRPC query that consumes an api from a node server: ```export const leadsRouter = createTRPCRouter({ getAllLeads: privateProcedure.query(async () => { const response = await axios.get(LEADS_BASE_URL + "api/leads/all");...

how can i select this object using "."

I am hitting an external api, and to my greatest surprise, the response is something like this ```json { "status": "success",...

lib folder and best practives

What do you think about lib folder? I am moving from old project and want to move ``` formatDate.js generateRssFeed.js...

How to call a server function without tRPC?

Hi! I'm kinda noob on the T3 stack. I created a t3-app without nextAuth and tRPC. However, the scaffolded code doesn't cover a use of the server side code and I wasn't able to figure out how to do it. I tried to export a variable from the server directory, but I got the following error in the app page: Error: ❌ Attempted to access a server-side environment variable on the client...

How would you fix USA flag stars?

Was browsing https://www.ufc.com/event/ufc-288 and noticed that the USA flag stars do not render well due to the image being so small. I was just wondering what would be a good solution if I was to run across a similar problem? Do you just use a flag with less stars so it doesn't mess with it as much?

Best testing framework(s)

Hey guys, I'm relatively new to testing but I want a testing framework with the most features in one thing. What would fit the best?

Running tRPC as a standalone!

A monorepo with multiple clients calling the same api. ``` . └── my-repo/...

SST

Anyone tried deploying this stack with SST? I'm currently a few days in with no measurable progress.. Just looking to see if anyone has accomplished this, and would be willing to share tips.

Is there a way of getting search / query parameters on the server instead of client with app dir?

I would like to get the ?s query parameter but according to the next docs it looks like the hook for it only works on the client side? https://beta.nextjs.org/docs/api-reference/use-search-params...

Code architecture best practices for large codebases in the context of t3 stack

What do you think of this code architecture in the scenario where you are working in large codebase with many apps ``` . β”œβ”€β”€ apps/ β”‚ β”œβ”€β”€ nextjs-app...

Best practices for data migrations/historical data changes?

I'm using t3 + Vercel + Planetscale and would like to add a field like user.apiToken as an example. A new field that every user should have pre-generated and ready to use So I need to generate tokens for my existing users. - Prisma migrations are SQL-only by default (right?) so that doesn't play nice...

How to fetch based on session? Getting 'session possibly null' with useQuery...

Let's say I am getting the session from the useSession hook and with ReactQuery I am setting the enabled status if the user is authenticated like so: ```js const { data: userProjects } = api.project.getByUserId.useQuery( { userId: session.user.id,...

Good articles on auth?

Curious how auth works in bigger companies, any articles would be helpful

Calling a 'fire and forget' webhook from trpc without waiting

I would like to call a webhook from a trpc endpoint. Right now I simply call the webhooks without awaiting them so I can get on with returning the response immediately. The problem is that the serverless endpoint is killed as soon as the trpc endpoint returns so sometimes the webhook doesnt run. I want to send a response and THEN process the webhooks so the client isnt waiting. Is there a way to do that?

Best practice on running tRPC in a monorepo.

In create-t3-turbo I noticed that what actually runs the tRPC sever is the nextjs app inside the apps folder. Meaning that the package api dose not run by itself and depends on it. If I got it right, what happens when you have multiple web applications consuming the same api? Isn’t it best practice to isolate it to its on service?...

Github CI with PNPM?

Hey everyone, I'm new to GitHub CI and I'm trying to write a simple workflow for a T3 stack repository that uses PNPM. Can someone please share a sample GitHub CI workflow that I can use as a reference?

which code is best to create a class for an express app

code on the left or the code on the right?

Is there a way to force data to update on a new page with t3 without having to click the page

I guess in principle this shoudn't be possible without some aspect of concurrency and clicking on the page does retrieve the data right away . But is there some way to avoid having to click on page for rerender or is that just nature of how code is rendered as I think it is?