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

Significant slow performace (in dev) with create t3 app

I recently tried out the create t3 app. I am using neon, next-auth, prisma and app router. I did not change any of the initial code, only added some env. I deployed it to vercel, and simple posting and retrieving latest post will take at least 3-4 seconds. Any clarification on this will be much appreciated.

How to properly add Google Sign In to existing application that has email login implemented already?

Hi, In my app I already have a working login system for email + password sign in. Now I would like to add Google Sign in as well. I already managed to allow user sign in with google but I wonder how I can properly handle user creation in the database in regards to username....
Solution:
Hey! 👋 For Google Sign-In, you can't get a unique username directly from Google. Here's the deal: Make username optional: In your User database model, allow the username field to be null at first. Also add a googleId field (unique) to link accounts. A isCompletedProfile flag is helpful too. Google Sign-In: Frontend handles the Google login flow. Backend verifies the token from Google (super important!), then gets the user's Google ID (sub) and email....

Fetching User Session Data on the Client Side with useSession

Hello! I'm having trouble retrieving the logged-in user's information on the client side. I need the user information for my component, but how should I fetch the current user's session data? Here is my code: ```ts...

T3 CreateApp globals.css file structure

Hello, I was wondering why in the create-t3-app the styles/ folder is placed in the src/ folder and not in the src/app/ folder? I was having some issues with my tailwindcss not working and when I looked at the docs for nextjs setup it says the style sheet should be in src/ and after moving it there it fixed my tailwindcss

Buying domain

Hey fellow web devs! 👋
I'm about to buy my first domain from Namecheap and had a couple of beginner questions:
1️⃣ How easy is it to connect a Namecheap domain to Vercel and Render? ...
Solution:
Haven't used Render, but with Vercel it's very easy to connect a domain to your project. You'll just have to add one or two DNS records to your domain via the Namecheap dashboard. I use the Zoho Mail free plan. You can connect one custom domain and create up to 5 users....

How am I supposed to learn to code when I have nothing to code?

I find coding fun and want to get better at it but I do not have anything to code. What do I do?
Solution:
Look for problems that you could solve with software (your problems, not other's) or find trends in the coding space that really interest you and figure out how to build projects that embrace them.

"Apps vs web", which video does Theo discuss this?

Screenshot is just a quick glance in this particular video https://youtu.be/cMApO0UhqEs?si=W6TCFek4pJxbKAMX&t=150 (I'm new to theo's channels)
No description

How to make animation just like in uploadthing

it looks like canvas so i wonder is that svg inside or png images that resize
Solution:
Hey, i think Rive was used for this. They offer a free tier which you can use. Think of it like Flash, but modern and for all platforms including React.
No description

Is it possible to import SVGs from a shared package in next 15?

In Next 14, I was able to import SVG files just fine as StaticImageData. After upgrading to Next 15, the only way I was able to get it to work was by adding this to my next config ```ts // Grab the existing rule that handles SVG imports const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg')); ...

customId for images

I want to get more context with an image upload and include a dynamic string or additional data. When viewing the uploaded images, I can see a column for customId. Is there a way to utilize customId(or something else I'm missing) to send additional data when uploading an image? I couldn't find anything in the docs, so if this is a simple "no," that's helpful too. Thank you for your time!...

turborepo setup

I created my project using:
npx create-turbo@latest
npx create-turbo@latest
Hello I am having problems to run my turborepo project. I have created structure as:...

202 accepted on API requests for nextjs13 help

Hi, I am building a website using nextjs13, prisma on an Aws ec2 container with docker. Whenever I test my website on production sometimes some API requests will return a 202 accepted status and those requests will never be processed. I’m assuming this is because the nextjs13 thread is busy handling other api requests or other cpu intensive tasks. Though the end points I have are not really cpu intensive. I was wondering if you guys think the solution is a combination of a horizontal scaling of...

Software engineer progression

Wasn’t particularly sure of where to ask this but has anyone else been through a wave of burnout + imposter syndrome + aimlessness and more? I joined a big tech company mid last year (can’t say which one but I’m sure you can figure it out if you’re really interested) and I just don’t know where to go from here. If anyone else has gone through this I’d love to learn about your experience and if you’ve gotten out of this ‘rut’ and how? Here’s what I’ve tried (but failed at miserably) 1. Building side projects - as soon as I start something I end up dropping it within the first 2 weeks because it gets too complicated too convoluted or too messy ...

t3.chat background texture?

Hey there 👋 any idea where I can find a simple texture such as the one used in t3.chat or motion.dev? I'd like one that works with both light and dark theme, but I am unsure where to begin looking. Any help is appreciated.

Improve Lighthouse Score

Hi, I am looking to optimize my Next.js website for lighthouse but I am really struggling to bring my Total Blocking Time (TBT) or main thread execution time to go down. I know lighthouse score isn't everything and the website feels fine in everyday use, but I am trying to do everything possible to improve SEO from a technical standpoint It's a very basic website build with App Router and shadcn and built with SSG...
Solution:
Hydration itself was taking a lot of time, moved some components to be lazy loaded for a small initial gain. Found out about lazy-hydration, using this library https://www.npmjs.com/package/react-lazy-hydration was able to bring down TBT to ~200ms from > 1s...

Improve perfomance with app-router

Does you some tips to improve the switch between routes?. I already using <Link> and SSR but it stills feels slow.

What's the best Nextjs architecture?

I have a Nextjs app where the current architecture is: - app -- [locale] --- /home...

t3: accessing static files server side

I'm trying to use fs.readFileSync to read PDFs and font files (.ttf) on the server (to dynamically build a PDF report in response to an API call), but I get ENOENT: no such file or directory no matter what I do. Even when the static file is in the same directory as the code trying to access it, I can't seem to target it. I noticed that __dirname targets /.next/server/app/api/trpc/[trpc] rather than the server-side file system, so I haven't been able to use it to help solve this probl...
Solution:
try using process.cwd() instead of __dirname reference: https://github.com/vercel/next.js/discussions/14341 in which dir have you stored those pdf and font files...

Looking for developer

Im looking to automate the backend of an anime streaming website pretty much needs to grab the best sources from indexers like nya download them into folders, organize, name, encode, remux etc.. and make the videos available Let me know if you're familiar we can have a call ...