Elite
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
TTCTheo's Typesafe Cult
•Created by Elite on 9/2/2023 in #questions
uploadthing/react not showing up or smth
5 replies
TTCTheo's Typesafe Cult
•Created by Elite on 6/6/2023 in #questions
use a skeleton when rendering a component
was wondering if i could add a skeleton for my navbar client component that is in my layout.tsx
not sure how to do this
8 replies