I'm using this approach to have centralized route config in Next.js. I don't have the fully automated solution. Right now I'm writing route configs and links manually to figure out if it works and what are the drawbacks.
I believe the automation is the last step to make it completely seamless.
This is the only file that needs to be wrote manually.