本页还没有译文
本页 100 段还没译成한국어,下面显示的是英文原文。Project Structure and Organization
还没翻译译自英文(nextjs.org)本页 100 段都还没译
This page provides an overview of all the folder and file conventions in Next.js, and recommendations for organizing your project.
Folder and file conventions
Top-level folders
Top-level folders are used to organize your application's code and static assets.

Top-level files
Top-level files are used to configure your application, manage dependencies, run proxy, integrate monitoring tools, and define environment variables.
| Next.js | |
next.config.js | Configuration file for Next.js |
package.json | Project dependencies and scripts |
instrumentation.ts | OpenTelemetry and Instrumentation file |
proxy.ts | Next.js request proxy |
.env | Environment variables (should not be tracked by version control) |
.env.local | Local environment variables (should not be tracked by version control) |
.env.production | Production environment variables (should not be tracked by version control) |
.env.development | Development environment variables (should not be tracked by version control) |
eslint.config.mjs | Configuration file for ESLint |
.gitignore | Git files and folders to ignore |
next-env.d.ts | TypeScript declaration file for Next.js (should not be tracked by version control) |
tsconfig.json | Configuration file for TypeScript |
jsconfig.json | Configuration file for JavaScript |
File conventions
_app | .js .jsx .tsx | Custom App |
_document | .js .jsx .tsx | Custom Document |
_error | .js .jsx .tsx | Custom Error Page |
404 | .js .jsx .tsx | 404 Error Page |
500 | .js .jsx .tsx | 500 Error Page |
Routes
| Folder convention | ||
index | .js .jsx .tsx | Home page |
folder/index | .js .jsx .tsx | Nested page |
| File convention | ||
index | .js .jsx .tsx | Home page |
file | .js .jsx .tsx | Nested page |
Dynamic routes
| Folder convention | ||
[folder]/index | .js .jsx .tsx | Dynamic route segment |
[...folder]/index | .js .jsx .tsx | Catch-all route segment |
[[...folder]]/index | .js .jsx .tsx | Optional catch-all route segment |
| File convention | ||
[file] | .js .jsx .tsx | Dynamic route segment |
[...file] | .js .jsx .tsx | Catch-all route segment |
[[...file]] | .js .jsx .tsx | Optional catch-all route segment |
AI 翻译查看英文原文