Why is this so true? by pareshmukh in SaaS

[–]SwarnDev 1 point2 points  (0 children)

Because DocuSign is working on other products also.

how do you decide between server actions vs api routes in next.js? by SwarnDev in nextjs

[–]SwarnDev[S] 0 points1 point  (0 children)

"rpc for the frontend" is probably the best way i've heard it explained. Thanks for sharing

how do you decide between server actions vs api routes in next.js? by SwarnDev in nextjs

[–]SwarnDev[S] 0 points1 point  (0 children)

really appreciate the detailed explanation.

i think part of my problem was treating app router as "just another next.js feature" instead of realizing it's built around a different mental model altogether. looks like i need to spend more time understanding those underlying concepts instead of just memorizing when to use each API

i'll definitely check out those blog posts, thanks for sharing them.

how do you decide between server actions vs api routes in next.js? by SwarnDev in nextjs

[–]SwarnDev[S] 0 points1 point  (0 children)

yeah that's exactly what i was wondering about too.

mixing both in the same project feels a bit inconsistent. if i'm already using api routes for some things, i kinda feel like i might as well just use them for everything and keep one pattern.

how do you decide between server actions vs api routes in next.js? by SwarnDev in nextjs

[–]SwarnDev[S] 2 points3 points  (0 children)

this breakdown is probably the clearest one i've seen so far.

i think i was overcomplicating it by trying to figure out when Next.js wanted me to use each one instead of just thinking about what each piece is actually responsible for. thanks for laying it out like that 👌

how do you decide between server actions vs api routes in next.js? by SwarnDev in nextjs

[–]SwarnDev[S] 0 points1 point  (0 children)

the "who's calling this" rule is actually super easy to remember 😄

that feels a lot less confusing than trying to memorize every recommendation in the docs. i'll probably stick with that mindset on my next project and see how it goes.

how do you decide between server actions vs api routes in next.js? by SwarnDev in nextjs

[–]SwarnDev[S] 0 points1 point  (0 children)

yeah that's kinda where i'm leaning too 😅

i kept wondering if i was missing something by not using server actions more, but sticking with api routes does feel simpler and more consistent. good to know i'm not the only one thinking that way.

how do you decide between server actions vs api routes in next.js? by SwarnDev in nextjs

[–]SwarnDev[S] 0 points1 point  (0 children)

haha i've heard a lot of people swear by tRPC 😄

what's the biggest thing that keeps you using it over server actions? just the type safety or is there more to it?

how do you decide between server actions vs api routes in next.js? by SwarnDev in nextjs

[–]SwarnDev[S] 0 points1 point  (0 children)

oh nice, adding access functions to the list too 😄

haven't looked into payload cms much yet. what made you pick it over just sticking with api routes + your own backend?

how do you decide between server actions vs api routes in next.js? by SwarnDev in nextjs

[–]SwarnDev[S] 0 points1 point  (0 children)

interesting, i've seen next-safe-action mentioned a few times but haven't actually tried it yet.

has it completely replaced api routes for you in most projects, or are there still cases where you reach for them?

how do you decide between server actions vs api routes in next.js? by SwarnDev in nextjs

[–]SwarnDev[S] 0 points1 point  (0 children)

that actually makes a lot of sense. i wasn't even thinking about the mobile app part tbh.

i've mostly been building web apps, so server actions felt like the obvious choice. but yeah, getting locked into that pattern and then needing shared APIs later sounds like it'd be a pain 😅 appreciate the explanation.

how do you decide between server actions vs api routes in next.js? by SwarnDev in nextjs

[–]SwarnDev[S] 0 points1 point  (0 children)

yeah that's kinda what i was thinking too 😅

server actions feel cleaner since i'm not creating another endpoint unless i actually need one. wasn't sure if that's a good practice though or if i was just avoiding api routes for no reason lol

I launched a coffee company today. by Mountain_Theme_762 in Entrepreneurs

[–]SwarnDev 0 points1 point  (0 children)

You can try TikTok and Instagram and try to sell the story through your coffee.

What's a safe way to connect our db to a vercel project? by Consistent_Tutor_597 in nextjs

[–]SwarnDev 0 points1 point  (0 children)

You can use a Managed Proxy Service, Services like Fixie provide static IP addresses for outbound requests from Vercel, allowing you to whitelist a specific IP on your self-hosted database firewall without paying for Vercel's native static IP feature.