DEV Community

Discussion on: How I structure my mid-size NextJS projects

 
hisuwh profile image
Henry Ing-Simmons

Yh this is it exaxtly. I haven't done a lot of next.js so I'm not sure how this works with pages, but essentially you have a folder for a feature, say like "user" then within that you can have your UserProfile component, your EditProfile component and whatever else all conveniently co-located. I also a proponent of having your tests next to their subject files so they're easy to update.

If these folders grow too large you can break them down into sub features.