Suggest an editImprove this articleRefine the answer for “Which folders are required?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)In **Next.js** there is no "strictly required" structure - everything is maximally lazy, but there is a minimum without which the application makes no sense. **Key point:** only `app/` or `pages/` is required, and inside `app/` at least one `page.tsx`.Shown above the full answer for quick recall.Answer (EN)ImageIn **Next.js** there is no "strictly required" structure - everything is maximally lazy. But there is **a minimum without which the application makes no sense**. ## Required folders (in practice) ### `app/` **or** `pages/` **At least one of them** - `app/` - the modern standard (App Router) - `pages/` - the old Pages Router Without one of them, **there will be no routing at all**. --- ## What is required inside `app/` ### `page.tsx` **At least one page** ```txt app/page.tsx → / ``` Without `page.tsx`: - the build will succeed - but **there will be no pages at all** --- ## Not required (but often needed) ### `layout.tsx` - **not required** - but if `page.tsx` exists, Next creates a default layout itself > However, in a real project a layout is almost always needed --- ### `loading.tsx` Skeleton / fallback Not required --- ### `not-found.tsx` Custom 404 Not required --- ### `error.tsx` Error Boundary Not required --- ## Other folders are entirely optional | Folder | Required | Purpose | |---|---|---| | `components/` | No | UI components | | `features/` | No | FSD | | `shared/` | No | utilities, UI | | `styles/` | No | global styles | | `lib/` | No | helpers, services | | `public/` | No | static assets | | `api/` | No | backend routes | | `hooks/` | No | custom hooks | Next **requires none of this**. --- ## Minimally valid project ```txt app/ └─ page.tsx ``` Yes, **this is genuinely enough**. --- ## Common misconceptions "`layout.tsx` is required" → no "`components/` is needed" → no "`_app.tsx` is needed" → only in `pages/` "without `public/` the project won't start" → it will start --- ## Practical takeaway **Next.js ≠ a framework with a rigid architecture** It: - provides **routing rules** - but **does not impose a structure** You decide: - FSD / MVC / flat - monorepo / single - frontend-only or fullstackFor the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.