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

Recommendation on the tailwind pattern to style this footer gracefully

Here is what I'm working with atm and its honestly just not looking very good. ```html <div className="align-center mx-auto flex flex-col justify-center border border-button bg-white py-8 pt-12"> <div className="flex basis-11/12 justify-evenly">...

How to refactor to create-t3-app?

I have the following setup. I have a Django backend and a Nextjs frontend. In Next, I replicate my Django models and have api functions for accessing the api endpoints from Django. How would I refactor this setup to an app that's created with create-t3-app Product/index.ts...

jotai-trpc and create-t3-app

Hi! Can anybody help to implement jotai-trpc? When I try to shift 'createTRPCNext' to 'createTRPCJotai' there is TS error I also tried edit api to edit 'createTRPCJotai' like in documentation but, when I got error in _app - because 'createTRPCJotai', don't have 'withTRPC' func May be somebody have working example? ...

Modal in a list

Hi i'd like to ask for best practice for these kind of implementation lets say i have a CRUD feature that the list could go on to hundreds each row have their own delete button and when clicked would show up Delete Modal ...

Dev stack for almost completely static website

Hi 👋 I'm about to build a very small, 1 page website, with no dynamic data or any reactivity really. Just a site to display some info and put a contant number. Maybe in the future add a small form and minor reactivity, but not for now. My question is, what is the best way to approach this quick project? I think most frameworks would be overkill here, what's best?...

google next-auth error: invalid_client even if client id is correct

my auth was working fine but now I keep getting this error [next-auth][error][OAUTH_CALLBACK_ERROR] https://next-auth.js.org/errors#oauth_callback_error invalid_client (Unauthorized) { error: OPError: invalid_client (Unauthorized) at processResponse (/home/blue/Projects/tracker/node_modules/openid-server.js:157:99 {...

migration from CRA to webpack

Hey hey. Having issue with webpack. In the screenshot, relative path should be ./roboto….. . ...

How to protect my app against abuse

I'm getting ready to release my app next week and I'm trying to make the final preparations. I have ip-based ratelimitting with upstash so users cant make more than 10 requests per 10s from the same IP. However, I'm a bit concerned about people who might abuse the app and drive up the costs on my serverless backends. My app runs tournaments and currently uses the following services: - Google Cloud Firestore for maintaining the state of each tournament and pushing it to clients in realtime - Google Cloud Storage for holding profile pictures and thumbnails for the tournaments - Algolia for fuzzy searching of the tournaments...

External (Django) middleware

In my current project, there's a Django middleware attached to my current and non-t3-stack Next app. What would the best approach be for migrating to create-t3-app in terms of tRPC and Zod? I still need to call the Django's API routes...

Hey I am getting an error in my newly generated ct3 app saying that it cannot read file tscofig.json

I am creating a new ct3 app but for some reason after creating the app via the cli any file that I open this comes up ?

what is this dumb typescript rule

'Unsafe assignment of an any value.' I don't remember it some time ago when creating t3 apps, for example it's yelling at me here: ```ts import ws from 'ws'; const wss = new ws.Server({...

Wanting to save some data every 30 days from an external game server on my t3 app server database.

So I have a function that gets the 'total accounts' from an external api, every 30 days I want to save that number to my prisma database (running on the create-t3-app server), what would be a smart way to save this data I am thinking I would need to check if its been 30 days since the last data save, if yes then insert a new value with the date If not then wait ? But I am not sure how to do this properly...

integrating a global state manager

I'm not sure if I even need a global state manager, I may be not understanding trpc\tanstack query fully. I feel like a certain design requirement forces me to use a global state manager. Adding a pic of the data flow in my app. So basically, TaskBoard holds the columns and tasks data that I get form the server using api...useQuery. The problem I am facing is that my Navbar renders a button which opens the modal....

Inconsistent Vercel deploys.

I have a project that i deployed under vercel. First time i uploaded - it seemed to be working. But today when i opened the website, there was an error saying deploy has failed, then i opened it again after a few minutes - no errors, websites works. So what might the issue? Maybe it has to do with me using experimental version of next.js (app directory)?

env vars in prisma db seed (prisma/seed.ts)

What's the easiest way to use env vars from src/env.mjs in this prisma/seed.ts file? I tried import { env } from '../src/env.mjs' but got this error `Error [ERR_REQUIRE_ESM]: require() of ES Module /app/src/env.mjs not supported. Instead change the require of /app/src/env.mjs to a dynamic import() which is available in all CommonJS modules. An error occurred while running the seed command:...

TRPC useContext, not seeing trpc react-query helpers

Hey, I want to create optimistic update, but my trpc useContext does not see methods that are mentioned in docs. Anyone tried doing that? Do I need to add something to the config? I'm attaching screenshot of my code. ...

Including multiple tables on prisma

Is there a way to include more than 1 relation in a prisma query? When I write: ``` include: {...

Disable Refetch on Focus in TRPC

Hello! I believe trpc refetches data when the user focuses on the window due to using react/tanstack query under the hood, and I know you can disable refetching on window focus in react query. Where would I adjust that in the context of trpc in a create-t3-app?

Is it possible to refresh a nextAuth session?

I thought that using router.push('/') etc would refresh the session state, but it doesn't. I'm assuming a page refresh would do it, but either way. Is there a good way refresh the session?

Hashing oauth username and email in auth. Js?

Would that work to improve privacy of users and would it even work? To do that I would need to modify database adapter but it may not be too much of work. What other ways there would be to improve privacy?...