Update the codebase to the latest Next.JS. The backend and frontend code should be merged into a single next.js application