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

good website examples

any publicly shared example of a website, maybe that is a bit more complex than standard app? something with multiple pages, example of front end / back end rendering, good organizational practice as far as code/security, and makes use of next-auth / tailwind / jwt / etc? just wanted to get a bigger picture view of a well coded site thats a bit deeper than t3 if anyone knows any šŸ™‚

Website for local/generic barber

I want to create and host a website for my local barber mainly as a hobby project to get some practical experience. Just think of a generic barber website.. Content will probably just include some pictures, maybe a contact form, opening hours and offerings so mostly static. Maybe an admin view to update content. I already have experience with the T3-Stack, vercel, planetscale, .net core mvc and bootstrap....

setInterval for placeholder changing

```js "use client"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input";...

Clerk Forces All Routes To Be Dynamic

Using ClerkProvider forces all routes to be dynamic, disabling caching. It cannot be override by setting {cache: "force-cache"} or export const revalidate = 0 . To test this locally, clone the repo and run build. All routes will be dynamic/server-rendered. Remove <ClerkProvider/> from root layout and build again, it will be static as it should be. Additionally, using Clerk components such as: UserButton, SignedIn, SignedOut will do the same. Repo: https://github.com/Apestein/clerk-bug-demo This is confirmed by my chat with Clerk support here: https://discord.com/channels/856971667393609759/1131185973758263337 ...

How should I host my apps given these requirements?

First of all its going to run on a single vps. It needs to support more projects in subdomains, if I add more projects. Plausible and glitchtip or similiar will be both self hosted for apps. It has to support database backups to storages, and configing everything up must be made with ansible....

Unit testing streams in node

Does anyone know how I can test streams, I am using a remote Api that streams the response, I need to write unit tests for that , but I was not able to make it work with jest.Anyone have any suggestions or ideas on how to achieve this

Config RSC on Edge

Hi, If I want to run RSC on edge do I need to put export const runtime = edge in the components too or just the page and then it will waterfall that down to the components? Thanks!...

File (images) storage with T3

Hi everyone, I know this has already been asked but I'm looking into it with a different objective. I am building an app in which users post articles (with images and text). I'm looking for a cloud-based file storage option for storing the images, with some requirements: • Pretty generous free tier (I need a free tier in which I can store about 500 images, idk if it's too unreasonable). • Scalable without being ridiculously expensive on it. • Easy to use....

Custom server setup with t3 (Express, socketio, puppeteer...)

im completly new to the t3 stack and i was wondering is there a way to make my own custom server but with the t3 stack on top, im struggling to get it to work with expressjs

Error when npm install a cloned next.js project

Anyone know how to fix this?
Solution:
Try deleting node_modules and trying again

Api route returns Fetch Failed

Hey, I have an api route that returns some posts, it works when I navigate to it, but when I try to request it using a RSC, it throws a Fetch Failed error, export ``ts async function getNews() { const res = await fetch(${env.NEXT_PUBLIC_APP_URL}/api/news`); if (!res.ok) {...

What is prefetching in TRPC server side?

I was able to create a TRPC server helper with "createServerSideHelpers". I am using it in my server function like this: ```ts import { helpers } from "~/utils/proxy"; import Client from "./Client";...

Correct way to fetch data in a server component and pass it to a client component? ReactQuery TRPC

Hi, I want to understand what are the best practices to deal with TRPC and react server components. Say that I want to have a server component that fetches data in the backend using trpc. I understand that if I am in the server I should use createCaller method from trpc. I tried to do it like so, and pass the data I fetch from the caller to my client component:...

Difference between server/client components? When to use?

I kind of just wanted to know when some good practices are when it came to using server/client components. First time using Next and I sometimes see people creating like a seperate api directory or something like that. If there's any resources you know that are helpful that would be awesome

How to store image path in database?

I use S3 compatible service: Storj for storing my images. So when you upload file you get bucket name and key. Do you store bucket and key in database? Or you just store url and extract bucket and key from in during deletion? Are you create several tables of images or create 1 image table and make many to many with other tables? Also if I possibly will have 2 image storage providers I need to store provider id....

Opinion on DX of this code, is it too confusing or easy to grasp?

```ts const roles = makeEnum("User", "Admin", "Owner"); // Type: "User", "Admin", "Owner" export type Roles = ExtractEnumType<typeof roles>; // "User" | "Admin" | "Owner" export const Roles = TrimEnum(roles); ...

How can I use login with username and password using NextAuth from T3-App?

I want to implement a custom login with username and password while storing data like username and password in a prisma database. I want to learn how I can implement it in T3-App since all the tutorials on youtube are provider based. Thanks for the help!

testing frameworks that work best with next 13 and the app router?

I'm interested in performing tests ("preferably integration") on entire app router pages. I'm having trouble doing so with next's built-in configuration for Jest, and I'm tired of digging through documentation and issues to find out what might be the cause of the problem. I think it'll be faster if someone points to something that has Just Worked.

Resend Email

hey, I'm created an enquiries page for people to send an email to the enquiries email address, I want to send the email from the email address they provided to my enquiries account, is this possible? this is my nextjs API route which is using Resend, ```ts import { env } from "@/env.mjs"; import { type ErrorResponse } from "resend"; import { z } from "zod"; import { resend } from "@/lib/resend";...

does anyone have a create-t3-app and shadcn starter repo?

I'm trying to install create-t3-app and then shadcn on top of that. However running into styling errors, like picture attached when combining the two. Any thoughts on how to fix this?...