Steps to create Next app with “src” directory
Step 1: Create a new Next.js project with the given command
npx create-next-app my-app
Step 2: Move to project and Create an src directory inside the root directory of your Next.js project called src.
cd my-app
mkdir src
Step 3: Move necessary files to the src directory, such as your pages, stylesheets, or any other files that your project may need.
mv pages/ src/
mv styles/ src/
mv public/ src/
Next.js src Directory
The Next JS src directory, short for source directory is the primary location for your application’s source code. It is an alternate project format that typically contains all the components, pages, styles, and other assets needed for your application to function. In a Next.js project, the src directory is where you will spend most of your time coding.