I’m fairly new to Next.js and I’m building an application to manage room entries (subscriptions, check-ins, additional purchases, etc.).
I’ve already made some progress, but I’ve reached a point where I feel like I need to rethink the structure of the project. My main question is about how to properly organize the file/folder structure for a project of this size. I’m not sure when it makes sense to create a new file or folder, and when it’s better to keep things together.
The app will be a single-page application with multiple sections that interact with each other, while also having their own internal logic. For example, I have one section for managing product purchases by a client, and another for searching client who buy it. In this case, I’m unsure whether it’s better to split them into separate folders/components, or keep them in a single file. If I split them, I’m not sure how to best share state (e.g. which client I’m working with) between the two.
What are some best practices for structuring a Next.js project like this, especially in terms of file/folder organization and managing shared state across components?
I’m not sure if I explained myself clearly, but I’d be grateful for any kind of advice.