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.js middleware + Axios

is it possible to set a middleware.ts in next.js to use axios interceptors for certain pages on my app? The code in the snippet below explains better what I want to implement in my middleware.ts for some of my pages....
No description

Uploadthing and S3

Hi, I would like to ask one question and one problem that I probably don't understand much. I'm making a website and I'm deciding between S3 and uploadthing, if I understood correctly so through uploadthing for 10$ I can have 100GB storage and I don't pay for any requests (GET, POST...). Unlike S3 where I pay both for storage and for the number of requests made. I'm making a website that will be visited by about 8k people a month and I need somewhere on the third party to upload about 70 images and some PDFs so they can edit it themselves through the admin panel.
Could I ask your advice or what you would do? Or how it is and if I understand it well?...

Uploadthing file handling

hey everyone! I am currently using uploadthing to do file uploads (images, audios) from my frontend. I am getting into the following problem: 1. User opens the form....

Trying to convince boss to switch from Angular to something else, he only accepts React.

So, we have a project, it's a Dashboard app, I coded both the frontend and the backend all by myself, the backend is a Go dedicated backend, but I hate everything about working with Angular, and every second of needing to deal with every little Angular problem frustrates me deeply. My boss mentioned using React, but I haven't used React in a while (even before NextJS was a thing), so, in my case SSR is a still a good idea? Or just keep with SPA? What are even people using for Angular SPAs now? Just Vite? I usually work with Svelte for personal projects, so I don't know what to do in this sense....

im getting this error

how can i fix this i didnt understand what it says
No description

T3 Turbo Auth Proxy - Correct Setup Help

Hi Folks, Trying my hand at the T3 Turbo repo to get a cross platform app setup. Hopefully someone can help. I have generally kept everything as is but running into issues trying to login to Discord on the mobile sim. Here’s what I’ve done: - repo pulled locally and pnpm installed + db pushed - deployed auth relay on vercel - setup app on Discord...

How to add a next.js subdomain

I have a server with multiple directories under /var/www/html I access them via Apache. Basically you type: mydomain.com/app1 And then the index.html under var/www/html/app1 gets loaded Everything so far is working great....

OurFileRouter type errors ??????

the our file router error that keeps telling me the file expects 2 or more arguments. but only got one. has anyone ever got an issue with this ?

Do you have to check type by using Array.isArray in TypeScript when you know the type?

Hi guys, I'm moderately experienced dev (4 years of JavaScript/TypeScript, 3 years of React) and I'm currently looking for a job. In the recent home task during interview process, I've got a feedback that I have a mistake in this component https://github.com/JonasMerxbauer/siteone/blob/master/src/components/CheckboxForm.tsx where I should be checking if the checkboxes is actual array by using Array.isArray(checkboxes). But I feel like that it's not necessary because there is no way that I would have a anything else than array there unless someone else would do weird shenanigans like const a = "str" as boolean[] or that I would be getting the array from api/db but then I would be checking the type at the place where I am fetching the data so I have always correct type down the line and not in component....
Solution:
their side is off and wrong

best resources for Data Structures & Algorithms prep?

hey guys - what would you recommend for a guy who's programmed a decent amount (js/python) but isn't really proficient in CS fundamentals (specifically DSA, but other things too - OOP principles, etc)?

do i create a sepreate notification and user_notifications table in my database

I am working on a chat app using prisma and mysql here are some details my app it will include rooms where users can join like servers in discord you can add friends to the room , create your own room kinda like discord, i am currently in the phase of structuring my database , i am currently structuring the notifications , i am a bit struggling on how to go about my notifications structure in the database my chat app will have friend request notifications and other types of notifications i t...

[t3-turbo]: Redirect does not work in app

I am using t3-turbo stack and not able to automate close the signIn window after succesfull sign in, when I close it by hand the sign in session did not get passed.

anyone else want to learn?

I am a 23-year-old male looking to enter the tech industry. Currently, I work in a factory sanding steel doors all day. Where I work right now is more of a job than a career. I’m looking at getting into the tech industry. Ideally, I would find a group of individuals who would like to learn about tech as well. Starting from zero is going to be a challenge, but I am ambitious enough to make it happen. If anyone would like to join me on my journey, feel free. For those who already have careers in t...

Using hardcoded data for comparison in unit tests with toEqual?

Hi there, I have a React app and I want to create a unit test for a function that removes scattered zeros inside of an array. Basically my idea is to have a src\mocks\data\IndexadorDataMock.ts file with hardcoded dirty data, and then the (also hardcoded) clean data - aka the expected output. For example: ```js // src__mocks__\data\IndexadorDataMock.ts export const itemsMockData = [ 0,...

What is a tool that can help me update packages to latest?

No, not npm-check-updates. Something that starts with "r" I think. I overheard it and couldn't ask for clarification and now it doesn't let me rest. I tried to google, tried to search on npm, github, but couldn't find it.

shadcn dialog and form

guys has anyone here tried to build a dialog with a form inside it ? if so what are the thoughts on it and how did it work. im having issues with the submit button and clicking it. im getting this error Error: React.Children.only expected to receive a single React element child....

How would you make a package that serves a web page across multiple frameworks AND nodejs?

Just starting a project and was wondering the best way to do this sort of thing, would I export jsx components and the main thing separately or?

Good react time picker

Do you have any recommendations for a GOOD react time picker - Works well on mobile and desktop - Fast to use (the UX is fast and without unnecessary modals, popups...) - Customizable enough to do things like "only in 5 minute intervals... ...

How to handle Nextjs with external REST API

How do you guys handle using Next.js with external REST APIs? Is it okay to wrap all fetch calls within actions (in order to use revalidateTag)? How to handle jwt auth in that scenario?