devve2kcc
Explore posts from serversTTCTheo's Typesafe Cult
•Created by devve2kcc on 2/18/2025 in #questions
Using Next Js with GRPC Backend
I'm interning at a friend's startup building a SaaS for textile companies. The backend is in Go with gRPC, and I’m handling the frontend. While Angular is the proposed framework, I'm more comfortable with Next.js, which offers easy server-side rendering and data prefetching—crucial for our data-heavy tables and pagination.
I’m exploring options like React Query or tRPC for managing data fetching, but I need to integrate them with gRPC without adding unnecessary complexity. What’s the best approach to efficiently prefetch data, handle pagination, and communicate with gRPC in this context?
Anyone worked in a similiar codebase?
2 replies
TTCTheo's Typesafe Cult
•Created by devve2kcc on 2/16/2025 in #questions
Correct way to add clerk auth to trpc
Hi, after 3 days of learning t3stack, i encounter some problems trying to create an privateProcedure, that using getAuth from and passing the "req", does not work, showing something like headers not defined, so i tried to modify api route, to only pass req, and not headers but also not working, im using app router, and i search on internet, and all solutions is for pages router,
TypeError: Cannot read properties of undefined (reading 'headers'); The error will be redacted in production builds
example code
but i found one dev.to blog, that shows the same problem that me, and the way he found to fix it, is use currentUser from next js, and seems to work fine, but is this the correct way to do it? t3stack seems to be an amazing way to create apps, but i think we do not have alot of docs or guides to use it.
2 replies
TTCTheo's Typesafe Cult
•Created by devve2kcc on 1/27/2025 in #questions
Next js server actions
Hi, its my first time using server actions, i always use an api and make requests using react query, So I'm used to handling query invalidations, through react query, and now using actions, to simplify my code base, since it's a very simple project, would this be the best way to update data after removing files? by the way, does the code structure look correct?
2 replies