Our application is in Node, Express, React, & Next. We are using a "subject folder" pattern. Each folder represents a major capability of the docs.github.com. To learn more about each subject, check the README.md file in the folder.
We used to organize our code more by role. Client, stylesheets, server middleware, shared files, tests, and so on. As the site grew, we had difficulty finding all the pieces that made a single feature work across the code base. Instead, we're moving to organize by subject. Subjects are easier to find all the related code for a single capability in one place.
Subjects do not need every element below. Not every element needs to be a folder. A subject folder looks like:
src/
xsubject/
README.md
docs/
lib/
middleware/
pages/
components/
stylesheets/
scripts/
tests/
If subject depends on another subject, please make this explicit in the README.
Choose the most specific subject folder available when organizing code.