Next.js Discord

Discord Forum

Best folder structure for scaling apps

Answered
Tomistoma posted this in #help-forum
Open in Discord
TomistomaOP
I've tried many folder structure ways, but i want to be consistent on one way of structuring the project folder, does anyone know what is the best folder structure to make it easy to scale my app without complicating it ? Thanks.
Answered by joulev
i have my preferences, but nothing guarantees my preferences will match with what works best for you. heck, my preferences differ wildly from my own colleague's preferences. so i want to avoid restricting you on any particular style; it's your job to find your own style
View full answer

6 Replies

@Tomistoma I've tried many folder structure ways, but i want to be consistent on one way of structuring the project folder, does anyone know what is the best folder structure to make it easy to scale my app without complicating it ? Thanks.
i answered a similar question a while ago, i'm quoting it verbatim here

you never sent the github link here so i don't know how clean it is, but

you will make a mess. especially beginners, but even people familiar with nextjs will still keep making a mess just because the app is an ever changing entity and you can't predict what it will look like 1 year down the road.

the important thing to remember is that despite that, fixing that mess won't be too difficult. i mean, you just need to move files around, adjust import paths. what else?

just don't be scared from making mistakes; making mistakes and fixing them is also how you gain experience too.

https://nextjs-forum.com/post/1410105467715457176#message-1410143571415142454
@Tomistoma I don't think this answers my question, i know that its okay to make mess, but how to not? I'm just searching and getting opinions from any expert to scale my app safely. Maybe you can just suggest me a way or a principle of organizing so i can follow it, or ref to a blog post maybe that can really help me.
how to not
you make apps, you make mess, you make changes, eventually you gain experience and it will converge to a point that makes you feel comfortable and intuitive. that point differs person-to-person, there is no 'best' way to do it.

i can give you this link https://nextjs.org/docs/app/getting-started/project-structure#organizing-your-project
i have my preferences, but nothing guarantees my preferences will match with what works best for you. heck, my preferences differ wildly from my own colleague's preferences. so i want to avoid restricting you on any particular style; it's your job to find your own style
Answer
you're welcome