Which folders are required?
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.
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
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.tsxexists, 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
app/
└─ page.tsxYes, 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 fullstack
Short Answer
Interview readyA concise answer to help you respond confidently on this topic during an interview.