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 to use bun or elysiajs with t3stack ?

is there anyway to use elysia js or bun in t3stack , also what about performance , does next js will decrease performance because of its bottleneck ?

Discord bot stack

I want to create a Discord Bot that, after typing in a description of a dream school, finds the most fitting one in the database and displays the data to the user on Discord. I would like the backend and database to be in Poland and the whole infrastructure to be as fast and light as possible. I can TS, use BUN and am thinking about Hono. What do you think about most efficient stack in this case?...

Cors-like error in server actions + github codespaces

Hey, for various reasons I some times use github codespaces to develop. I’m struggling with this error when calling server actions from the client. ``js x-forwarded-host header with value domain…-3000.app.github.dev does not match origin header with value localhost:3000` from a forwarded Server Actions request. Aborting the action. POST /testing 500 in 7ms...
Solution:
Solved, needed both the domain and localhost in allowed origins…

How to type react element arguments

I want to take a string like this
const Example = (guid : string) => { ... }
const Example = (guid : string) => { ... }
but when i call it like this it says ...

transformations

Are there any plans to introduce image transformations directly in the UploadThing API?

does nextAuth provide phone otp authentication?

are there any cost effective options for phone authentication?

Rich Text in Postgres DB

What is the recommended way for me to save multiple paragraph product descriptions for my online store? I'd like to include <Link> tags to other pages of my app, as well as use <em> and <strong> tags for formatting.

Data Fetching Patterns for User Session

What approaches do you typically use for data-fetching in multitenant applications built with Next.js 14+? Specifically for managing things like the current organization, user profile, or dynamic navigation links: Do you store some state in the URL (e.g., organization ID)? ...

Where to host a static website for my company?

Got a company website I want to host, wondering where to host it Anyone have an idea if for example Github Pages is good enough? Stack is vanilla js, html, css, so veery lightweight and has a couple different views only. Noob question...

tRPC route undefined at runtime

I'm getting a 500 error in my dev environment [ Server ] Error: Cannot read properties of undefined (reading 'getAllForUser') for a trpc query I added. It's the same getLatest query for posts just changed to findMany instead of findFirst. I'm struggling to figure out what could make the site compile and have getLatest working but then have getAllForUser missing at runtime. The site is working fine locally using railway db and discord auth and only breaks once I try to add a component for getting all user books (reworded from the posts example) Repo public here https://github.com/TiKevin83/DiveableNext/blob/e664211df268ff843544db98c0baeec9a11f4d2e/src/server/api/routers/book.ts#L29...

How to modify the fetch function for client uploads so I can include credentials

Hi folks, I am new to UploadThing and got file uploads working with my React client and Fastify API. One issue I am having is that I had to get rid of http-only cookie based auth for my JWT storage and had to fallback to local storage just so I could send my token over the wire from the file upload dropzone in the react code to my Fastify app. I use the token to validate that the user is authenticated and then upload the url to my db. Obviously storing the token in local-storage is less secure than an http-only cookie, but I cannot seem to include credentials in the uploadthing component. ...

RFC: Does this syntax make sense?

Hey! I am writing a RPC solution in TS (that goes out to a lot of other languages), and not really sure what channel this should go in (it is a question, but a question asking for feedback), but I would really like comments on how I wish to handle situations where you might have an atomic set of functions where one result can go into another (batching can also be done this way whilst sharing the transaction). How do people feel about a syntax like this? ```ts const [iban, paymentId] = client.atomic((client, { variable, pluck }) => { // Defines a variable to store the IBAN. Note that this is syntactic sugar for what will happen...

How to get OpenAi API Key

I want to use the OpenAI API so i need a key, it says for that i need to verify my phonenumber and opens a pop up. When I enter my phone number i get a code, when i enter the code i get suck here. What to do now ? (I don't have other phone numbers to try)...
No description

Add React to .NET Api

I have written a .NET Api and now i want to create a web app that uses it. And i want to set it up that the .Net server serves that app on the / route (or better any out that's not /api/*). There is some info from microsoft but that almos exclusively to creating a new combined empty project with an VisualStudio template, but i don't want a new empty .NET app and i don't have VS.
Solution:
Serve Files from wwwroot folder ```C# var builder = WebApplication.CreateBuilder(args); ... var app = builder.Build();...

Nextjs deployment on Docker

Any recommendation for good open source CI/CD tool to deploy Nextjs on Docker (better to o work with Swarm too) and with similar Vercel DX when it comes to automatically deploying on git push?

Error: The string to be decoded is not correctly encoded when using @clerk/nextjs in Next.js 15.0.3

I’m running into an issue while setting up a Next.js app (v15.0.3) with u/clerk/nextjs. When I try to run the development server, the app compiles but fails with the following error:
⨯ Error [InvalidCharacterError]: The string to be decoded is not correctly encoded. at (rsc)/./node_modules/@clerk/nextjs/dist/esm/server/constants.js (/app/.next/server/vendor-chunks/@clerk.js:615:1) ...
⨯ Error [InvalidCharacterError]: The string to be decoded is not correctly encoded. at (rsc)/./node_modules/@clerk/nextjs/dist/esm/server/constants.js (/app/.next/server/vendor-chunks/@clerk.js:615:1) ...
Key Details:...

Struggling to Choose a Type-Safe Backend for a Podcast Streaming Service Without a Monorepo

I’m building a podcast streaming service using Next.js for the web and a React Native app for mobile. I’m not sure what to do about the backend. I really want to use tRPC for both, but tRPC feels a bit complex since I don’t want to use a monorepo (it’s an extra headache). I want to keep them in separate repositories. Here’s my current idea: - Use raw Next.js API routes (without tRPC) and consume that API in the React Native app....

UT dropzone error for unaccepted file types

I'm struggling to figure out why UT dropzone (react, nextjs) is throwing an error when I try dropping an unaccepted file type. Error from dropping a Docx:
Something went wrong. Please contact UploadThing and provide the following cause:"TypeError: undefined is not an object (evaluating 'data[0].key')"
Something went wrong. Please contact UploadThing and provide the following cause:"TypeError: undefined is not an object (evaluating 'data[0].key')"
...
Next