Hacker News new | ask | show | jobs
by harg 1484 days ago
There's nothing stopping you from wiring the Next.js backend up to your databases and external APIs and for simple apps it's likely quite a nice solution. But if your backend consists of complex business logic and needs to talk to lots of different services it can be a lot cleaner to have better distinction between the backend part of your app and the frontend, and just use Next.js' backend for data fetching for the UI.

You can also not use Next.js without a Node.js runtime at all and just compile your whole app to static files to be served by a static file server like S3, nginx, etc. The advantage of this over CRA is that you get statically-rendered html (as well as normal client-rendered React interactivity) which is good for SEO and FCP[1]

[1]: https://web.dev/fcp/