How to add nextjs to existing react app ? Can anyone explain step by step

I have created a react app using vite and I want to integrate with nextjs for server side rendering and folder based routing, please explain step by step.

I am expecting to make use of nextjs in existing react app.