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

next auth limitations with server rendering?

https://github.com/KairuDeibisu/wysark Here's the skinny, I'm using planet scale for my back end then prisma to connect it to next JS....

How to connect planetscale database using pgAdmin?

So I created a database in planetscale. Let's say the connection information looks like this... ``` database: mydb username: myusername...

What statistics/analytics service to use?

Hey! Im building a crypto wallet. We wish to track how many transactions get sent over time, how much volume happens over time,...

How do I solve for a persisting session on Next-auth when User is deleted from DB.

I am currently finding that My user auth sessions are persisted even when I have cleared my db. What is the cleanest way around this. If possible kindly share a solution when using the jwt strategy as well

T3 Stack + custom Next.js server not working

Hi, I'm using t3 stack and trying to leverage Next.js custom server. But, unfortunately when I'm trying to run it using ts-node I'm constantly getting an error connected to module resolution (I guess it's because my next.config.mjs has .mjs extension):
[1] Error [ERR_REQUIRE_ESM]: require() of ES Module next.config.mjs not supported.
[1] Instead change the require of next.config.mjs to a dynamic import() which is available in all CommonJS modules.
[1] Error [ERR_REQUIRE_ESM]: require() of ES Module next.config.mjs not supported.
[1] Instead change the require of next.config.mjs to a dynamic import() which is available in all CommonJS modules.
...

Deployment options for Next (aside from vercel) for a small SAAS app

I know vercel is prob best for NEXT, just recently found however out that their free tier explicitly disallows commercial use which is such a bummer. What other alternatives are there for Next? Ideally, i'm looking for something that allows me to consume their free tier first, then as my app scales/grows, then i would really need to upgrade to their paid plans. This is basically because i don't (yet) have the money to fund my own apps so it doesn't make sense for me to try out vercel's $20/mo subscription if i'll get like ~2-5 paying users per month....

Tailwind or Chakra?

I'm creating a simple app and I'm curious what most people are using for styling. Is Chakra using it under the hood? I'm reluctantly willing to learn some css shit.

nextjs 13 protected api routes

What is the best way to protect api in the new nextjs release, something like an internal middleware?

Best practices for typesafe error handling

What are your best practices for error handling using typescript? Are you throwing (custom?) errors or do you return success/error union types? Or do you do something else?

Webhooks with Google calendar API on Vercel

Looking for any general advice on listening to events from google calendar, in order to sync changes via the Google Calendar UI to my database. The calendar api is a bit different from how Stripe or Clerk does webhooks. You need to create a transient notification channel which needs to be renewed after an interval (e.g 1 day or 1 week). My initial thoughts are to just use a vercel cron job or similar to get the job done. Happy to take alternative suggestions though....

Modify user model in Prisma on signup

Hi amazing people, I'm still learning the stack and I love the type safety! My question is: I added a new column to the user model called isSetup for when the user is new or need to have some required properties filled out. When the user uses nextauth to authenticate how can I add a default false value to the column on register through one of the providers?...

Prisma breaks when on production server (dedicated server, backend app)

```ts const fetched = await this.prisma.xpMultiplier.findFirst({ where: { type, selectorId...

Supabase vs Planetscale for a regular SAAS app

I'm pretty new to databases in general and i've been googling around lately and checking out YT videos on the topic. So far i've been able to narrow down my choices to supabase and planetscale. Can anyone elaborate on the pros vs cons of each provider, why theo prefers planetscale, etc? I'm also a bit confused about the pricing and how the privisions roughly translate to real-word usage, e.g., planetscale has 5GB storage for its free tier, while supabase 500MB DB and 1GB file storage. What exactly is planetscale referring to as the 5gb storage? (DB + file storage?)...

Deploying on Vercel, tailwind classes missing?

Does anyone have issues with deploying on vercel? Right now my app is deployed but my tailwind classes have no value, which is why my page looks wrong. Locally it looks fine with the dev and build command...

User Creation With Clerk

I have an app where everyone has to have an account to access it but only admins can grant new people accounts. Users don't have the ability to request an account. Right now we are just using devise from ruby to create an account and send a password reset email on creation to avoid creating a temporary password and let them set their own on the first login. Is there a way to establish something similar in clerk?

Build for production with custom server

Hey everyone! I've been struggling to create a T3 setup that includes a custom server on production. I've looked at a few Next.js custom sever example projects but the env.mjs seems to through a wrench in the build process. Does anybody have a working project example that builds a custom server using create-t3-app ?

Differences between DaisyUI and HeadlessUI

Hi all! I'm very new to Tailwind (but found about it through Theo's channel) and am having trouble comparing Headless UI to Daisy UI. From what I understand, Headless UI is a utility library for unstyled UI components, whereas Daisy UI is a style library that adds CSS classes for theming UI components, but also seems to have an unstyled option. I'm having trouble understanding the niches each of these libraries fill. Can/should I use them together? I understand that HeadlessUI is unstyled, but does it provide functionality (maybe in terms of utility/accessibility) that DaisyUI does not? Thanks in advance!...

TRPC async promise return type

Hello I am having some trouble with the types of the return values from the trpc router. I am unsure how to properly type and resolve this promise type error. I have a navbar component that I am calling the trpc router for the categories I am pulling from my db and ive awaited that call ```js...

What is the correct order to put files in S3 and update DB ?

I am doing something very simple. I need to update some content which has images. What is the correct order of doing the update: 1) optimistic - send update mutation to api (I am using rest but trpc will replace it soon*)...

tRPC router refreshes and gives 429 HTTP error

I am implementing a new "endpoint" as from what I have understood. The tRPC looks like the following: ```TS export const openai = new OpenAIApi(configuration); const getStory = async (storySummary: string, title: string) => {...