Next.js Discord

Discord Forum

is NextJS my best option?

Answered
Black-tailed Gnatcatcher posted this in #help-forum
Open in Discord
Black-tailed GnatcatcherOP
Hi guys,

Trying to build a big app with lots of data fetched constantly, will have a GO backend for data handling and a NestJS one for my global API, wondering if NextJS is my best option here or if you guys would recommend taking a different approach. I’ve thought about NextJS being a BFF and how it might not be needed for my case since I already have an external backend. Thoughts ?
Answered by B33fb0n3
no, your website content will be delivered thought SSR (maybe on demand). Your auth works fine with nextjs as well. You can build for example a middleware inside your project and check your auth there. Then render the page (maybe fetching your stuff from your backend: server to server ...). Having a database for example is also just another server somewhere. So it's nearly the same thing. I fetch my database to get data and you fetch your own GO backend to get data
View full answer

7 Replies

@B33fb0n3 nextjs is not just backend. With nextjs you can build fullstack apps and of course you can also use your GO backend
Black-tailed GnatcatcherOP
In that case where I’m using next, since I’m aiming for performance do I just do every request fetching client side ? And how would auth ideally would work here ?
no, your website content will be delivered thought SSR (maybe on demand). Your auth works fine with nextjs as well. You can build for example a middleware inside your project and check your auth there. Then render the page (maybe fetching your stuff from your backend: server to server ...). Having a database for example is also just another server somewhere. So it's nearly the same thing. I fetch my database to get data and you fetch your own GO backend to get data
Answer
@Black-tailed Gnatcatcher Isn’t using SSR and nextjs’ backend going to add latency ?
not really. Most of the static pages are build statically, so they can be served instantly. So there is no delay for static pages. For dynamic pages the specific parts of your pages will be streamed. So the user can already see the content of the page, while other parts are streamed in
Black-tailed GnatcatcherOP
Great, thanks for the tips, will be very useful
@Black-tailed Gnatcatcher Great, thanks for the tips, will be very useful
sure thing. Please mark solution