Back to Community
5 months agoTips & Tricks

How I structure my Next.js projects

After building 20+ Next.js apps, here is my folder structure that works best: ``` app/ ├── (auth)/ ├── (dashboard)/ ├── api/ components/ ├── ui/ ├── feature/ lib/ actions/ ``` The key is to group by feature, not by file type. This makes it easy to find and maintain code.

nextjscodestructure
3 Comments

3 Comments

Dao Phommachanh4 months ago

This is super helpful! I have been struggling with my project structure. Going to refactor my current project using this layout.

Maly Xaiyavong4 months ago

I use a similar structure for WordPress projects too. Grouping by feature makes everything so much easier to maintain.

Phet Manivong4 months ago

Love this! For the components folder, do you also separate client and server components?