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

Dependent select boxes in form

I'm using TanStack Query to fetch a configuration from an API. Once fetched, I'd like to populate two select boxes with the first available configuration in the response. options is an alias for the data returned by useQuery. Both vehicle_type and validity are initially set to "" (empty string)....

AWS Amplify

I want to deploy my T3 stack app on AWS Aplify. It builds as normal but when i visit the deploy link it says "Internal Server Error". here is my YAML file and build log as well. what could be the problem
No description

How to use uploadthing using REST APIs?

I was able to create presigned URL using /v7/prepareUpload and then when i use curl -X PUT --data "@filename" "presignedURL" I am getting this error {"statusCode":415,"code":"FST_ERR_CTP_INVALID_MEDIA_TYPE","error":"Unsupported Media Type","message":"Unsupported Media Type: application/x-www-form-urlencoded"} ...
Solution:
Solved it by using v6 APIs
No description

Uploaded Files Returning utfs.io URLs Instead of ufs.sh

Hey everyone, I'm using UploadThing for image uploads in my project. According to the documentation, files should be served from:
https://<APP_ID>.ufs.sh/f/<FILE_KEY>
https://<APP_ID>.ufs.sh/f/<FILE_KEY>
However, when I upload a file, the response only includes URLs in the https://utfs.io/f/ format. Example response:...

create t3 app build error

Hey, The default config for create t3 app, with the following installs: prisma tailwind...

AWS Elastic Beanstalk

i am trying to deploy my application on AWS Elastic Beanstalk, but i am getting this error and it does not work. what am i doing wrong. to upload the project i compressed the T3 app without the node modules.
No description

Looking for someone to help me implement Directus and Authjs (next-auth v5) and refresh tokens

Hey there, I am positively ripping my hair out :) I have yet to find anyone to help me with this issue nor any guide or docs that helps it either. If you've not heard of Directus it's a headless CMS with lots of fun databasing tools. It's basically supabase or prisma but with more emphasis on low-to-no code. However, many silly people like myself use it as a sort of backend to nextjs. So we can develop nice webapps for internal tools but also have no-code users be able to interact with the data through a flash CMS backend app. HOWEVER, for the absolute life of me I cannot understand why I cannot build a nextjs/t3-stack app that successfully refreshes the user's session through refresh tokens. I have read all possible docs thousands of times and even dug into the source code and I just can't understand it. ...

How to create a GitHub Action that upload assets to a existing/new release?

I am working on a C# project and trying to create a GitHub Action that handles building project, creating a zip and then uploading it to a existing release.
Solution:
Thank You @Utilyre So much. Got it running. Didn't used any of pre-built actions instead just used gh cli, to upload binaries in existing release. makes it way similar. But still, thank you replying and helping....

Dynamic pages issue on server pages

I just joined an org which uses ftp, cpanel, for the server and normally they create out folder and put it on the server but due to server side dynamic pages not being supported we are unable to host it as it's throwing error. we installed node to solve this but it still doesn't work. What should be the way to go about this?

UploadThing file accept type restriction

I'm trying to find how I can allow the <UploadButton /> to only accept images for example with extensions of (.png, .jpg ...etc). Because currently my users are able to upload .gif for example and I don't want to allow that. I searched the docs but there is nothing regarding image type restriction or acceptation. Unless I missed something......
Solution:
Thanks that solves it for me. However if I used this I wont be able to set maxFileSize and maxFileCount ```tsx...

Create 10,000 dummy React Views (Windows 11)

Does anyone know how to create a batch script to create dummy views. Just need 10,000 files with the pattern of something like View$i.tsx and then content is just random HTML that is 100KB in size. It's a weird set of requirements but is needed for performance testing.
Solution:
this worked ```cmd
"View!fileNum!.tsx" echo export const testFunction!fileNum! = ^(^) =^> {
>> "View!fileNum!.tsx" echo return ( >> "View!fileNum!.tsx" echo ^<div^>...

Stripe integration

Trying to follow Theos Stripe tutorial, turns out I got some skill issues and not understanding the kv setup as I haven't done this before. Can anyone please assist in the setup of it?

Best Way to Model Integrations in Postgres?

Hey everyone, I need advice on modeling data for a system with multiple integrations. Currently, I plan to support 4-5 integrations (e.g., BigCommerce, Shopify), each requiring unique information like API keys. For now, an organization can only have one integration, but I want to design the model so it’s easy to expand to multiple integrations per organization in the future. I’m using Postgres and wondering about the best practices for structuring this. How should I model these integrations to handle their unique data while keeping things scalable and maintainable? Any suggestions or examples would be greatly appreciated!...

whats the best database to use (like sql, postgress and those stuff)

the topic basically
Solution:
sqlite for simplicity and portability, postgres and mysql if you need scale, like huge scale. The difference between postgres and mysql isn't worth looking into if you're still new

Simple typescript function

It has been several hours since I have been trying to create a simple function that I know is possible to create, because I once somehow managed to do that, but not now. I just want to create a function that takes other functions. ...callbacks Each of those functions will be called inside, and a single value will be passed (context). Context: It is an object that takes the result of the previous callback. execution. so like [0]: number, [1]: {a: number} ...

Neos Postgres vs PlanetScale

Theo has recently mentioned that planetscale is way better than Neon. I really want to know much more about this. What's wrong with Neon? (I am shipping Neon for my startup and I am super interested in hearing anything you know!)

Typescript Eslint

I'm not sure if the structure for plugins has changed for eslint but after updating some packages, I'm now getting type error when providing strings.
No description

Tanstack table

Can I add style to column group border in tanstack table?
No description

Hosting option for app serving lots of images

I have an application that serves a lot of ~40-80 kb images, the project is deployed using vercel but I already used up the free tier's perks for image optimization. I haven't tried deploying using a VPS because I've heard of the amount of overhead that comes with it as well. Would love any input on this as I am kind of a noob when it comes to handling these things. Thanks!