First of all, pick the tools you are comfortable with. Next.js is a good start and you can extract the backend / API parts eventually as you outgrow the framework. Don't overengineer your project from the start.
That being said, personally I wouldn't pick Next.js for more complex APIs. Their "API routes" functionality provides poor primitives for building complex backends and you spend a lot of time reinventing abstractions other frameworks provide for you out of the box – frameworks like NestJS, FeathersJS, Adonis, Meteor…
For example, at superface.ai we use Next.js as a stateless frontend, while the backend is built with NestJS and exposes an API for the frontend, our SDK, and CLI. This works especially well if you have dedicated developers for frontend and backend parts.
First paragraph says it all. Don't over-engineer. Long term I think next's api layer is pretty basic and you'd benefit from having a dedicated api. But until you start to hit those pain points, or if your app is small, or during early development, then sure why not.
First of all, pick the tools you are comfortable with. Next.js is a good start and you can extract the backend / API parts eventually as you outgrow the framework. Don't overengineer your project from the start.
That being said, personally I wouldn't pick Next.js for more complex APIs. Their "API routes" functionality provides poor primitives for building complex backends and you spend a lot of time reinventing abstractions other frameworks provide for you out of the box – frameworks like NestJS, FeathersJS, Adonis, Meteor…
For example, at superface.ai we use Next.js as a stateless frontend, while the backend is built with NestJS and exposes an API for the frontend, our SDK, and CLI. This works especially well if you have dedicated developers for frontend and backend parts.
Thanks Jan, for such a detailed comment. I got your point of view.
First paragraph says it all. Don't over-engineer. Long term I think next's api layer is pretty basic and you'd benefit from having a dedicated api. But until you start to hit those pain points, or if your app is small, or during early development, then sure why not.
Thanks Jack, It helps a lot.