How We Organize Files: A DevTree Overview
A short map of the file-organization series covering DevTree layout, production vs. non-production code, repository structure, and #region usage.
File organization is one of those topics that seems too obvious to need writing down — until you land in a repository that follows no discernible convention, and every basic navigation question turns into an investigation. A consistent structure isn’t glamorous, but it’s one of the cheapest investments a project can make in its own long-term readability.
This is a short map of the ground worth covering, and where to find the detail on each piece:
- The DevTree layout — the directory structure or organization of code and resources within a development environment, and what a well-organized repository actually looks like at the top level.
- The solution tree — see the same DevTree post’s section on
src, the developer’s main working area, and the two common ways to slice it: component-focused or DDD-aligned. - Production vs. non-production code — the distinction between code that’s actively used in a live environment and code used for testing, development, or experimentation, and why it’s worth being deliberate about where each lives.
- Repositories — guidance on how to split code across different Git repositories in the first place.
- Usage of
#region— a breakdown of the pros and cons of using#regionto organize code within a file.
None of these pieces are complicated on their own. Where they add up to something worthwhile is in being applied consistently across a codebase — so that the next person to open a repository already knows roughly where to look.