Running npm run export/yarn export in the frontend directory will automatically compile the Next.js frontend and export it to backend/static where it will be read from when starting the server via cargo run.
npm run export
yarn export
frontend
backend/static
cargo run