Skip to main content
doc0blade47/next.jsdocumentation home
Sign in

Project Directory Structure

Last updated Oct 12, 2026100% grounded

Overview

Introduction to Project Structure

Organizing your project correctly helps keep your code clean, maintainable, and easy for the system to understand. A standard project directory structure typically includes folders for your web pages, public assets, and configuration files. You can choose to place your application files directly under the project root or keep them neatly organized inside an optional src folder.


Key Directory Folders

Understanding where different files belong ensures your project builds and runs smoothly.

Folder NameDescription
app/ or pages/Contains your application pages, routing layouts, and user interface components.
public/Stores static assets like images, icons, and files that are served directly to visitors.
src/An optional folder that can wrap around your app/ or pages/ directories to keep the project root clean.

Note

If you use both an app/ and a pages/ folder, they must both live under the exact same parent folder (either directly in the project root or both inside the src/ folder).


Placing Public Assets

To make images, logos, and other static files available to your visitors, store them in the public folder.

  1. Create a folder named public directly at your project root.
  2. Place your static files (such as images or icons) inside this folder.
  3. Reference these assets in your code by pointing directly to the filename from the root (for example, /next.svg).

Tip

The older static directory name is deprecated. Always use the public directory for your static assets.


Configuring Settings

Project-wide configuration files let you customize how your application behaves, builds, and formats code.

Supported configuration filenames include:

  • next.config.js
  • next.config.mjs
  • next.config.ts
  • next.config.mts

Warning

Ensure configuration files and public asset folders are placed correctly at the project root level so the build tools can locate them automatically.

Was this page helpful?