{"id":12246,"date":"2025-10-31T15:40:43","date_gmt":"2025-10-31T06:40:43","guid":{"rendered":"https:\/\/sreake.com\/?p=12246"},"modified":"2026-02-10T16:15:09","modified_gmt":"2026-02-10T07:15:09","slug":"directory-structure-good-practice-2","status":"publish","type":"post","link":"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/","title":{"rendered":"Best Practices for Structuring your Projects"},"content":{"rendered":"\n<p><em>This blog post is a translation of&nbsp;<a href=\"https:\/\/sreake.com\/blog\/directory-structure-good-practice\/\">a Japanese article<\/a>&nbsp;posted on April 14th, 2025.<\/em><\/p>\n\n\n\n<p>Hi! This is Nakahara from the Sreake team.<\/p>\n\n\n\n<p>As projects grow larger, it becomes difficult to maintain them, which in turn impacts development speed. I believe this largely has to do with <strong>a poorly designed directory structure.<\/strong><\/p>\n\n\n\n<p>Today, I would like to share my thoughts on a directory structure designed to make project maintainance simpler and improve developer productivity.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_75 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Some_Background\" >Some Background<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#What_were_going_to_cover\" >What we\u2019re going to cover<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#The_Five_Principles\" >The Five Principles<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Separation_of_Concerns\" >Separation of Concerns<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Bad_Example\" >Bad Example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Good_Example\" >Good Example<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Scalability\" >Scalability<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Bad_Example-2\" >Bad Example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Good_Example-2\" >Good Example<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Intuitiveness\" >Intuitiveness<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Bad_Example-3\" >Bad Example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Good_Example-3\" >Good Example<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Reusability\" >Reusability<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Bad_Example-4\" >Bad Example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Good_Example-4\" >Good Example<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Ease_of_Change\" >Ease of Change<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Bad_Example-5\" >Bad Example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Good_Example-5\" >Good Example<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/sreake.com\/en\/blog\/directory-structure-good-practice-2\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Some_Background\"><\/span>Some Background<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In application development, directory structure has a significant impact on the <strong>maintainability, readability, and development efficiency<\/strong> of projects.<\/p>\n\n\n\n<p>Without an appropriate directory structure, the following problems often occur:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Responsibilities become unclear and code dependencies become complex<\/strong><\/li><li><strong>New team members struggle to understand the project, extending onboarding time<\/strong><\/li><li><strong>Project management breaks down as the project grows<\/strong><\/li><li><strong>Changing code has an oversized impact on unrelated functionality, increasing the cost of introducting new features and fixing bugs<\/strong><\/li><\/ul>\n\n\n\n<p>Especially for long-term projects and team-based development, designing an appropriate directory structure is key to success.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_were_going_to_cover\"><\/span>What we\u2019re going to cover<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This article explains <strong>five fundamental principles<\/strong> to consider when designing a directory structure.<\/p>\n\n\n\n<p>By understanding and applying these principles, you&#8217;ll be able to:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Unify development practices across your whole team<\/strong><\/li><li><strong>Write better, more readable code, allowing new members to onboard smoothly<\/strong><\/li><li><strong>Iterate on and expand your project requirements naturally<\/strong><\/li><li><strong>Minimize impact on unrelated functionality when developing new features<\/strong><\/li><\/ul>\n\n\n\n<p>By focusing on these <strong>five fundamental principles<\/strong> that we&#8217;ll introduce, you can improve your directory structure.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Five_Principles\"><\/span>The Five Principles<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are the <strong>five principles<\/strong> you should be aware of when designing a directory structure:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th><strong>Principle<\/strong><\/th><th><strong>Overview<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Separation of Concerns<\/strong><\/td><td>Organize folders and files by role to clarify responsibilities<\/td><\/tr><tr><td><strong>Scalability<\/strong><\/td><td>Allow the structure to expand naturally as the project grows<\/td><\/tr><tr><td><strong>Intuitiveness<\/strong><\/td><td>Strive for intuitive directory design that new members can understand immediately<\/td><\/tr><tr><td><strong>Reusability<\/strong><\/td><td>Properly separate common logic for efficient reuse<\/td><\/tr><tr><td><strong>Ease of Change<\/strong><\/td><td>Make it easy to add new features while minimizing impact scope<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Separation_of_Concerns\"><\/span>Separation of Concerns<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>When considering directory structure, it&#8217;s important that <strong>each folder and file has a clear role with properly separated responsibilities<\/strong>.<\/p>\n\n\n\n<p>\u274c <strong>When responsibilities are ambiguous:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A single file fills multiple roles, making changes difficult<\/li><li>The impact of changes becomes hard to predict, leading to bugs<\/li><li>It becomes difficult to know where specific code is located<\/li><\/ul>\n\n\n\n<p>\u2705 <strong>When responsibilities are separated:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>One file fills a single, specific role, making changes easy<\/li><li>The scope of changes is limited, improving maintainability<\/li><li>Module design becomes more reusable<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Bad_Example\"><\/span>Bad Example<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Multiple responsibilities mixed in a single file:<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>src\/\n\u251c\u2500\u2500 app.ts             \/\/ Cramming all the logic here\n\u251c\u2500\u2500 user.ts            \/\/ Mixing UI, API, and business logic<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>UI, API, and business logic are in one place, making maintenance difficult<\/li><li>Roles are unclear, making it hard for others to understand<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Good_Example\"><\/span>Good Example<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Organized by role:<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>src\/\n\u251c\u2500\u2500 controllers\/       \/\/ Handles user operations\n\u2502   \u2514\u2500\u2500 userController.ts\n\u251c\u2500\u2500 services\/          \/\/ Business logic\n\u2502   \u2514\u2500\u2500 userService.ts\n\u251c\u2500\u2500 models\/            \/\/ Data structure and DB access\n\u2502   \u2514\u2500\u2500 userModel.ts<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Each layer has a clear responsibility and is designed for a single purpose<\/li><li>The impact scope of changes is limited<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Scalability\"><\/span>Scalability<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Directory structures should be designed with consideration for <strong>how they can flexibly adapt to project growth<\/strong>.<\/p>\n\n\n\n<p>Even if a simple structure works initially, it can break down as features are added, teams expand, and operational periods lengthen.<\/p>\n\n\n\n<p>\u274c <strong>Low-scalability structures<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Existing structures must be forcibly modified with each new feature addition<\/li><li>Files with the same responsibilities are scattered across multiple locations, obscuring the overall picture<\/li><li>The impact scope of structural changes is large, increasing maintenance costs<\/li><\/ul>\n\n\n\n<p>\u2705 <strong>Scalable structures<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Structures that make it easy to add or extend features<\/li><li>Directory structures with consistency that naturally accommodate new elements<\/li><li>Structures that maintain visibility even as teams and features increase<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Bad_Example-2\"><\/span>Bad Example<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Flat structure that doesn&#8217;t anticipate growth<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>src\/\n\u251c\u2500\u2500 user.ts\n\u251c\u2500\u2500 product.ts\n\u251c\u2500\u2500 cart.ts<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>All processes grow independently at the file level<\/li><li>Becomes chaotic with each new feature addition<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Good_Example-2\"><\/span>Good Example<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Layer structure that remains organized for future growth<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>src\/\n\u251c\u2500\u2500 controllers\/\n\u2502   \u251c\u2500\u2500 userController.ts\n\u2502   \u251c\u2500\u2500 productController.ts\n\u251c\u2500\u2500 services\/\n\u2502   \u251c\u2500\u2500 userService.ts\n\u2502   \u251c\u2500\u2500 productService.ts\n\u251c\u2500\u2500 models\/\n\u2502   \u251c\u2500\u2500 userModel.ts\n\u2502   \u251c\u2500\u2500 productModel.ts<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Can naturally expand with the same structure as features increase<\/li><li>A scalable form that can be introduced from the initial stages<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Intuitiveness\"><\/span>Intuitiveness<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Having a <strong>directory structure that anyone can easily understand<\/strong> is crucial for team development.<\/p>\n\n\n\n<p>\u274c <strong>Low readability, non-intuitive structures<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Directory names are ambiguous, making it hard to imagine their contents (e.g., <code>common<\/code>, <code>data<\/code>, <code>temp<\/code>, etc.)<\/li><li>Files with the same responsibilities are scattered across multiple locations<\/li><li>New members easily get lost trying to find &#8220;where things are&#8221;<\/li><\/ul>\n\n\n\n<p>\u2705 <strong>High readability and intuitive structures<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Directory and file naming is clear, with roles apparent at a glance<\/li><li>Folder structure is organized by function and responsibility, making it hard to get lost even for newcomers<\/li><li><strong>Smooth onboarding is possible<\/strong> because all developers can easily understand the structure<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Bad_Example-3\"><\/span>Bad Example<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Ambiguous naming and unclear structure<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>src\/\n\u251c\u2500\u2500 stuff\/\n\u251c\u2500\u2500 temp\/\n\u251c\u2500\u2500 misc.ts<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Roles cannot be imagined from names at all<\/li><li>Difficult to know where things are, extending onboarding time<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Good_Example-3\"><\/span>Good Example<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Names and structure anyone can understand<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>src\/\n\u251c\u2500\u2500 controllers\/\n\u251c\u2500\u2500 services\/\n\u251c\u2500\u2500 models\/\n\u251c\u2500\u2500 utils\/<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>The purpose of folders is conveyed by naming alone<\/li><li>Easy to find needed code without getting lost<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Reusability\"><\/span>Reusability<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A structure that <strong>appropriately extracts and enables reuse of common processes<\/strong> contributes to both development speed and quality.<\/p>\n\n\n\n<p>\u274c <strong>Low reusability structures<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The same code is written repeatedly for each feature<\/li><li>Common processes are embedded in specific features, making them difficult to use elsewhere<\/li><li>Logic duplication creates opportunities for modification errors and bugs<\/li><\/ul>\n\n\n\n<p>\u2705 <strong>High reusability structures<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Clearly separated reusable areas like <code>utils\/<\/code>, <code>hooks\/<\/code>, <code>components\/<\/code>, <code>shared\/<\/code>, etc.<\/li><li>Modularized common logic that can be easily called from other features<\/li><li>Maintenance is easier because the <strong>DRY (Don&#8217;t Repeat Yourself) principle<\/strong> is thoroughly implemented<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Bad_Example-4\"><\/span>Bad Example<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Logic duplicated in multiple places<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>\/\/ userController.ts\nfunction formatDate(d: Date) { ... }\n\n\/\/ orderController.ts\nfunction formatDate(d: Date) { ... } \/\/ Same function reimplemented<\/code><\/pre>\n\n\n\n<p>Common logic is scattered, requiring updates in all locations when modified<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Good_Example-4\"><\/span>Good Example<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Common logic gathered in utils for reuse<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>src\/\n\u251c\u2500\u2500 utils\/\n\u2502   \u2514\u2500\u2500 format.ts\n\u251c\u2500\u2500 controllers\/\n\u2502   \u2514\u2500\u2500 userController.ts    \/\/ Uses utils\/format<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Same function can be defined and managed in one place<\/li><li>High reusability, less likely to breed bugs<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Ease_of_Change\"><\/span>Ease of Change<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A structure that <strong>allows smooth addition of new features and modification of existing ones<\/strong> is essential for highly maintainable projects.<\/p>\n\n\n\n<p>\u274c <strong>Hard-to-change structures<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A single change affects multiple locations<\/li><li>Feature responsibilities are mixed, making it difficult to determine what to modify<\/li><li>Hard to test and identify impact scope<\/li><\/ul>\n\n\n\n<p>\u2705 <strong>Easy-to-change structures<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Features are loosely coupled with localized impact scope<\/li><li>Easy to test and modify at the module level<\/li><li><strong>Flexibly adaptable to future feature additions and specification changes<\/strong><\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Bad_Example-5\"><\/span>Bad Example<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Everything is tightly coupled, with small changes having widespread impact<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>\/\/ app.ts\nhandleUserLogin()\nfetchUserData()\nrenderUserInfo()\n\/\/ Everything is unified and difficult to change<\/code><\/pre>\n\n\n\n<p>Functions are too interdependent, with one change affecting others<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Good_Example-5\"><\/span>Good Example<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Concerns are separated, allowing localized changes<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>src\/\n\u251c\u2500\u2500 controllers\/\n\u2502   \u2514\u2500\u2500 userController.ts     \/\/ Handles user input\n\u251c\u2500\u2500 services\/\n\u2502   \u2514\u2500\u2500 userService.ts        \/\/ Logic changes are isolated here\n\u251c\u2500\u2500 models\/\n\u2502   \u2514\u2500\u2500 userModel.ts          \/\/ Data structure modifications are also limited<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Modifications remain localized with minimal impact on other files<\/li><li>Easier to test and refactor with confidence<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>An application&#8217;s directory structure is not just a place to put files.<\/p>\n\n\n\n<p>It&#8217;s <strong>part of a design that directly affects the entire team&#8217;s development efficiency, and the project\u2019s maintainability and scalability<\/strong>.<\/p>\n\n\n\n<p>The <strong>five fundamental principles<\/strong> introduced in this article are <strong>universal concepts<\/strong> that can be applied to any technology stack.<\/p>\n\n\n\n<div class=\"wp-block-group has-gray-200-background-color has-background is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<p>\ud83d\udca1 <strong>You don&#8217;t need to aim for a perfect structure from the beginning.<\/strong><\/p>\n\n\n\n<p>What&#8217;s important is continuously reviewing the structure as the team grows and the project changes.<\/p>\n<\/div>\n\n\n\n<p>When thinking about directory structure, aim for <strong>design with intention<\/strong>.<\/p>\n\n\n\n<p>This ultimately <strong>leads to balancing both development speed and quality.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello from the Sreake team! Learn five principles for scalable directory structure, and how to apply them in your project.<\/p>\n","protected":false},"author":45,"featured_media":12255,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_locale":"en_US","_original_post":"https:\/\/sreake.com\/?p=10831","footnotes":""},"categories":[17],"tags":[23],"class_list":["post-12246","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-enginner-blog","en-US"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/posts\/12246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/comments?post=12246"}],"version-history":[{"count":1,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/posts\/12246\/revisions"}],"predecessor-version":[{"id":13500,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/posts\/12246\/revisions\/13500"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/media\/12255"}],"wp:attachment":[{"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/media?parent=12246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/categories?post=12246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/tags?post=12246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}