Next.js Discord

Discord Forum

I’m building a Shopify storefront using Next.js and I’m unsure which architecture to choose

Unanswered
Abdullah Aly posted this in #help-forum
Open in Discord
I’m building a Shopify storefront using Next.js and I’m unsure which architecture to choose.

Option 1: Pages Router + React Query (sending requests directly to Shopify)
Option 2: App Router + React Query with internal API routes for each action (e.g. get products, get cart, etc.)

I want to use React Query either way. I’m looking for clarity on which setup is more stable, scalable, and better suited for a production storefront. Any input is appreciated.

12 Replies

.
.
Asian black bear
Please don't bump your post more than once every 24h.
Havana
I would just always use the app router over the pages router
And use server functions instead of seperate api routes
@Havana And use server functions instead of seperate api routes
ok what about get details
like products
like cart
in cart i think i need to use react-query
Sloth bear
yeah for products I would use server functions, fetch data in a server component and pass it down into client
for cart yes, some kind of query lib connected to api route