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

Looking for code review on trpc method calls

As stated I'm looking for some code review on a blog that I've been working on using the T3 stack. I'm relatively new to web dev and am working on the app for personal use and have it working but I also know that I have made some programming fauxpas and more or less looking for "you are on the right track here" or "yeah... stop what you're doing here and refactor, try..." I don't know exactly if this is the correct channel to ask this sort of thing in.
Full repo here: https://github.com/L-Steinmacher/next-blog I know that the logic on this component needs some love badly with the trpc calls:https://github.com/L-Steinmacher/next-blog/blob/25c33410f19b4e0be4b6fb58122949b0d5c3026f/src/components/commentLayout.tsx#L52...

A client asked me to build a video course webapp. How would you build it?

A client asked me to build a video course webapp. How would you build it? CMS?

Connecting and managing planetscale branches

It seems very tedious to create a pscale branch then go in and create a password, copy the connection link, adding it to my .env and then starting to develop. The whole idea of branches (kinda like with git) is that is should be fast and efficient. Is there no other quick way to handle my local connection?

If recreating mailchimp like email marketservice with automations and campaigns - Kafka or RabbitMQ?

As per the title, super noob in terms of message broker services, but if recreating an email marketing service that should scale to many users, should one use kafka or is rabbitMQ sufficient to allow sending emails based on triggers, delays from past emails, and sending multiple emails at once. I assume part of the system architecture should involve using kafka or rabbitMQ and then the consumer still needs to use AWS cloudwatch to schedule the emails? I guess when thinking about it in this way though, maybe kafka or rabbitMQ aren't needed and I can schedule the emails in cloudwatch directly. But then other emails require delays from previous emails... Do I need kafka or rabbitMQ? If so, which one?...

Prisma/Planetscale issue

Hello, why can't I define an array of strings in prisma using mysql and planetscale? Edit: I understand the error message and "why" it doesn't work but I can't find a solution to the issue....
No description

trpc nextjs

anyone knows how to get nextauth session in trcp context in a caller? trying to get trpc working on server components but getting headers() expects to have requestAsyncStorage, none available

problems with next-auth

I have had problems with next-auth, with discord (or any provider), I downloaded the next authjs demo and it doesn't work either. https://github.com/nextauthjs/next-auth-example...

redirect with withAuth middleware

my goal is to be able to check the user role and redirect to a custom page but as i can see you can just return true or false and when you return false you get redirected to the signin page

Flutter or React-Native

As a web-developer looking to venture into mobile development for the first time, which of these tools is mostly advice to go with?? And what is the best and recommended way to learn mobile development?

What's the best way to implement Optimistic Updates with TRPC and NextJS App Router

What's the best way to implement optimistic updates in an app that uses experimental_createTRPCNextAppDirClient and experimental_createTRPCNextAppDirServer

Upload database using t3 stack

I have a database that I want to upload once and update frequently (400k rows for upload and 3-4k for update). This database also has relations defined using prisma so I can't reset the entire database. The current process I want to achieve is to upload the db file into uploadthing and then use fetch and upload the database using prisma. But I don't know how to run this process in server instead of frontend. If my process is correct please help me do it. If not tell me the correct method. Using...

Anyone having issues with /etc/hosts on MacOS ?

I'm trying to set up an entry in my /etc/hosts to map 127.0.0.1 to a website I'm working on. It's not working. The weird part is that when I ping it ping web.site it is correctly routing to 127.0.0.1 but it wouldn't work in the browser. I just bought my laptop a couple of days ago so this definitely isn't a browser cache issue or something like that (AFAIK at least) Any thoughts ?...

Optimistic updates not working?

Does anyone have a working code snippet using the latest create t3?

Custom type on express Request doesn't work on execution

I'm trying to set a user type on my req in my express server these are what i tried: req.user = user; req.user = user as User;...

Get Role and protected route

How could I let's say make an /admin route where if I am not authenticated it will redirect to directly the discord auth link and if I am it will check a db if the user has admin set to true. If yes it will then fetch another db for some data and return it. Please ping or dm when you respond

Serve pdf file in get route in Astro

Hi, im trying to serve a pdf file in a get route, as such: ```ts import fs from "fs"; export async function get({ params, request }) {...

Help in Nextauth EmailProvider

I am getting this strange error in emailProvider for nextauth. Does anyone know what I am doing wrong? ``` Type 'EmailConfig' is not assignable to type 'Provider'. Type 'EmailConfig' is not assignable to type 'EmailConfig & InternalProviderOptions'....

mutateAsync()

hey, I'm running into an issue where I can't figure out my way, I have a hook I use in my front to pass and create a checkout to my back but I have this weird error with mutateAsynch( { priceId } ) which cannot be assign apparently ```ts...

Running migrations on startup

First of all, hey there, I hope you are doing well. My question as a new next js space/ecosystem is revolved around db migrations. I'm building an app that aims to be easily self-hostable, but currently, I'm unsure what the best approach is when it comes to applying and continuously rolling out new migrations. I would imagine that running some code before server next js server start is what I am looking for. ...

I think somethings really wrong with my tailwind or styles

So I have this issue where if i reload the page, the styles changes somehow. But if i re-render it, with just going back and forth on the website, it looks just fine. It's only on the initial load of the page. Really werid, have no idea what's causing it, and i can't find anything about it. If anyone has any idea, or a way to debug what's happening, pls help...