Elite
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Elite on 4/5/2025 in #questions
Best no sql db
So I have some pretty unstructured data and don’t really want a sql database. Would also like some ai capabilities like vector search and etc.
What is the best no sql db for Nextjs apps?
I’m coming from theos new tech stack vid and he doesn’t mention any no sql dbs
Using mongodb rn and may use their vector solution later too.
Pls ping me if you know
2 replies
BABetter Auth
•Created by Elite on 3/26/2025 in #help
newbie: are my conventions for checking if a user is logged in on client and server side fine?
hi so this is my first time rolling my own auth. ive used clerk before. the db im using with better auth is mongodb as my user data is there rn.
We only need google auth (no email/password). I've gone through the installation and setup and ive got google user logins registering in my mongodb collection.
The question I have is, am I properly checking if the users logged in (client and server side)?
for the client side, i made a "client-auth-guard" component that basically checks it.
So is it fine if I use this component for the client side:
https://gist.github.com/navincodesalot/e3fcd7581d92ae51ea1602cdb4ffe943
For server side checking if user is logged in, Iwould I have to use server actions? (https://www.better-auth.com/docs/integrations/next#rsc-and-server-actions)
but then how would the server side look like on a route handler? (my post, get, etc endpoints)
My middleware.ts: (follows a clerk pattern)
https://gist.github.com/navincodesalot/2f2d016202d298cafa7c3925a047e71c
Just wanted to know if I am approaching the checking on client and server side properly
thanks.
(Also I feel it’s a bit slow when checking if a user is logged in or not. And when I use my middleware to redirect users if they access locked routes, it’s chunky and slow. Is it cause it’s a dev server?)
4 replies
BABetter Auth
•Created by Elite on 3/26/2025 in #help
newbie: are my conventions for checking if a user is logged in on client and server side fine?
hi so this is my first time rolling my own auth. ive used clerk before. the db im using with better auth is mongodb as my user data is there rn.
We only need google auth (no email/password). I've gone through the installation and setup and ive got google user logins registering in my mongodb collection.
The question I have is, am I properly checking if the users logged in (client and server side)?
for the client side, i made a "client-auth-guard" component that basically checks it.
So is it fine if I use this component for the client side:
https://gist.github.com/navincodesalot/e3fcd7581d92ae51ea1602cdb4ffe943
For server side checking if user is logged in, Iwould I have to use server actions? (https://www.better-auth.com/docs/integrations/next#rsc-and-server-actions)
but then how would the server side look like on a route handler? (my post, get, etc endpoints)
My middleware.ts: (follows a clerk pattern)
https://gist.github.com/navincodesalot/2f2d016202d298cafa7c3925a047e71c
Just wanted to know if I am approaching the checking on client and server side properly
thanks.
(Also I feel it’s a bit slow when checking if a user is logged in or not. And when I use my middleware to redirect users if they access locked routes, it’s chunky and slow. Is it cause it’s a dev server?)
1 replies
TTCTheo's Typesafe Cult
•Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
So I have a webhook server that lets me know when a PayPal invoice has been paid.
And I have a dynamic route (/transaction/{id})
I want to immediately change my frontend when this invoice gets paid on the correlating id.
Rn I have a use state that checks for transaction status changes in mongodb.
So since the webhook runs on a route handler, I’m able to update the transaction’s state in mongodb, but Im not able to let the frontend use effect know that it’s been updating.
I don’t really want to poll as I want this flow to be as instant as possible, the user pays invoice in PayPal, frontend changes.
How could I do this?
54 replies
TTCTheo's Typesafe Cult
•Created by Elite on 5/6/2024 in #questions
nextjs cache questions with new react news
with the new react fetch stuff, if I want to use NextJS
unstable_cache
, do I need to also wrap a React.cache
over it?4 replies
TTCTheo's Typesafe Cult
•Created by Elite on 5/6/2024 in #questions
change typescript version in workspace to have typesafety for nextjs (const dynamic =)
how can I change the typescript version in my workspace to have typesafety for nextjs (const dynamic =)? I tried searching change ts version but use the workspace option doesn't exist.
Do i need to be in a ts file?
5 replies
TTCTheo's Typesafe Cult
•Created by Elite on 3/27/2024 in #questions
permanent and secure state storage
so for my app im checking if a user has paid a paypal invoice.
on the frontend I display a few buttons (so once they pay it, they click a button)
I basically time it so in 180 seconds the user has to pay it or it gets cancelled.
but the first 180 sec, they get a button that resets the time and lets them do it again without filling in a form.
im wondering how I can store the state of such things permanently (they can't reload the page to reset timers or whatever)
I was thinking local storage but users could edit the numebr of times they've clicked hte button to check (thats a state var)
2 replies
TTCTheo's Typesafe Cult
•Created by Elite on 3/25/2024 in #questions
does react ssr now?
Might be a stupid question but does react have SSR now with the introduction of server and client components?
2 replies
TTCTheo's Typesafe Cult
•Created by Elite on 3/24/2024 in #questions
invalid env variables
So Im using nextjs + drizzle + neon db
Ive setup a script to print my databse
i get this error:
`
here is my env.js:
https://gist.github.com/navincodesalot/e91d0cd5ffca574fe1a593ac48ae5311
Here is my server/index.ts:
https://gist.github.com/navincodesalot/bfda54ac39a0c5cdf88867fa3ad22eb5
Is there a reason I can't use process.env in my index.ts?
am I using it correctly
42 replies
TTCTheo's Typesafe Cult
•Created by Elite on 3/24/2024 in #questions
how do i get the vercel bot to comment on prs?
how do i get the vercel bot to comment on prs? Not sure why but it doesn't seem to do it on default
7 replies
TTCTheo's Typesafe Cult
•Created by Elite on 3/24/2024 in #questions
invalid env variable error with drizzle and neondb
So Im using nextjs + drizzle + neon db
Ive setup a script to print my databse
i get this error:
`
here is my env.js:
https://gist.github.com/navincodesalot/e91d0cd5ffca574fe1a593ac48ae5311
Here is my server/index.ts:
https://gist.github.com/navincodesalot/bfda54ac39a0c5cdf88867fa3ad22eb5
Is there a reason I can't use process.env in my index.ts?
am I using it correctly
2 replies
TTCTheo's Typesafe Cult
•Created by Elite on 3/21/2024 in #questions
invalid env vars with drizzle and neondb
So Im using nextjs + drizzle + neon db
Ive setup a script to print my databse
i get this error:
`
here is my env.js:
https://gist.github.com/navincodesalot/e91d0cd5ffca574fe1a593ac48ae5311
Here is my server/index.ts:
https://gist.github.com/navincodesalot/bfda54ac39a0c5cdf88867fa3ad22eb5
Is there a reason I can't use process.env in my index.ts?
am I using it correctly
7 replies
TTCTheo's Typesafe Cult
•Created by Elite on 3/21/2024 in #questions
server dir with nextjs and drizzle
So Im configuring a drizzle and nextjs app router application
In the server directory, my env keys dont work unless i add:
is there a reason for this?
i thought I jsut need to do process.env.VALUE (works in api routes)
4 replies
TTCTheo's Typesafe Cult
•Created by Elite on 10/31/2023 in #questions
shadcn ui help
hi so i used a template for my landing page, then i manually installed shadcn ui.
i'm trying to use the popover on it:
i get this look
https://media.discordapp.net/attachments/1166165842942242906/1166165843412009011/image.png?ex=65497f93&is=65370a93&hm=84c517c0be1cedfc47a0cde9e43f3fb80852b2c1aedf4af88965b99c93b14f8a&
my code:
popover.tsx:
Globals.css: https://gist.github.com/navincodesalot/4d4b6273511a903c13ba9cdf52d44779
Components.json: https://gist.github.com/navincodesalot/b7fdbf882d824475e5fc90a2915dbe83
Tailwind.config.js: https://gist.github.com/navincodesalot/4de9deda69be629e149c3206314854a3
2 replies
TTCTheo's Typesafe Cult
•Created by Elite on 10/24/2023 in #questions
shadcn ui help
hi so i used a template for my landing page, then i manually installed shadcn ui.
i'm trying to use the popover on it:
i get this look
https://media.discordapp.net/attachments/1166165842942242906/1166165843412009011/image.png?ex=65497f93&is=65370a93&hm=84c517c0be1cedfc47a0cde9e43f3fb80852b2c1aedf4af88965b99c93b14f8a&
my code:
popover.tsx:
Globals.css: https://gist.github.com/navincodesalot/4d4b6273511a903c13ba9cdf52d44779
Components.json: https://gist.github.com/navincodesalot/b7fdbf882d824475e5fc90a2915dbe83
Tailwind.config.js: https://gist.github.com/navincodesalot/4de9deda69be629e149c3206314854a3
2 replies
TTCTheo's Typesafe Cult
•Created by Elite on 10/24/2023 in #questions
shadcn ui - css scuffed

2 replies
TTCTheo's Typesafe Cult
•Created by Elite on 9/10/2023 in #questions
type errors even after disabling
my .eslintrc.cjs
1 replies
TTCTheo's Typesafe Cult
•Created by Elite on 9/8/2023 in #questions
type errors even after disabling
my .eslintrc.cjs
2 replies
TTCTheo's Typesafe Cult
•Created by Elite on 9/7/2023 in #questions
type errors i wanna change to warn
my .eslintrc.cjs
2 replies
TTCTheo's Typesafe Cult
•Created by Elite on 9/4/2023 in #questions
add on to the file object
without changing the type of
UploadedFile
, can i add a field to the file object so my frontend can read it after a file is uploaded6 replies