Where does next.js go in the stack? Middle-end?
Although I feel confident that Next is more-or so the middle-end of an application. Sometimes I find myself hypothetically questioning if Next is right for the job for hypothetical projects.
Let's say for whatever reason platform like facebook was to be rewritten, would Next be suited for handling that and where would it go in the stack?
It's definitely for the front end with BYOB(Bring Your Own Backend)
Although it's possible to do some backend work in Next.js, you should only do it to support the UI. Not to serve data.
You could definitely attach arbitrary routes to your next server (examples: https://github.com/zeit/next.js#custom-server-and-routing), but we don't recommend it.
It's much better suited to plugging into other backends and APIs. For example, you can host your microservices on https://now.sh and query them to get your data (see the examples in the README using fetch).
Thanks for your question!