{"id":638,"date":"2020-01-08T12:28:46","date_gmt":"2020-01-08T12:28:46","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/project-hygiene\/items-in-a-module-should-be-organized-in-a-good-folder-structure\/"},"modified":"2022-06-15T06:52:34","modified_gmt":"2022-06-15T06:52:34","slug":"folderstructure","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/project-hygiene\/folderstructure","title":{"rendered":"Documents in a module should be organized in a good folder structure"},"content":{"rendered":"\n<p>Items in a module should be organized in a good folder structure<\/p>\n\n\n\n<p>Every item e.g. microflow, page, etc has its proper place in a good folder structure. A good folder structure is key to having a maintainable application. When everything can be found in the same way you will have faster development and maintenance.<\/p>\n\n\n\n<p>Customize the folder structure so that it suits your needs.<\/p>\n\n\n\n<p>The default folder structure mandates that items should be organized into folders based on the entity they operate on. For example, if the module has entities \u201cproject\u201d and \u201cdepartment\u201d then the folder structure should be as follows:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"174\" height=\"194\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-1.png\" alt=\"\" class=\"wp-image-580\"\/><\/figure><\/div>\n\n\n\n<p>This default structure is defined by the pattern:&nbsp;<code>\/{entity}<strong>\/<\/strong>Pages|Events|Resources<strong>\/<\/strong>+<\/code><br>which only allows folder with matching entities, with subfolders one of&nbsp;<code>Pages<\/code>,&nbsp;<code>Events&nbsp;<\/code>or&nbsp;<code>Resources&nbsp;<\/code>and then any items inside that folder.<\/p>\n\n\n\n<p>More formally the pattern defines each level of the folder structure:<\/p>\n\n\n\n<p><code>\/&lt;level1&gt;\/&lt;level2&gt;\/&lt;level3&gt;<\/code><\/p>\n\n\n\n<p>Where each level can be:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>a hardcoded value e.g.&nbsp;<code>Pages<\/code><\/li><li>a list of values separated by&nbsp;<code>|<\/code>&nbsp;e.g.&nbsp;<code>Pages|Events<\/code><\/li><li>an entity name&nbsp;<code>{entity}<\/code><\/li><li>a value that&nbsp;<code>contains<\/code>,&nbsp;<code>startsWith&nbsp;<\/code>or&nbsp;<code>endsWith<\/code>&nbsp;any of the above<\/li><li>any name&nbsp;<code>*<\/code><\/li><li>any name and any nested levels allowed after that&nbsp;<code>+<\/code><\/li><\/ul>\n\n\n\n<p>Examples:<\/p>\n\n\n\n<p><code>\/API\/Calls|Mappings\/*<br>\/Functions\/+<br>\/UI\/+<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"199\" height=\"162\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2019\/12\/image-2.png\" alt=\"\" class=\"wp-image-581\"\/><\/figure>\n","protected":false},"featured_media":0,"parent":100,"menu_order":8,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-638","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/638"}],"collection":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=638"}],"version-history":[{"count":2,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/638\/revisions"}],"predecessor-version":[{"id":900,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/638\/revisions\/900"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/100"}],"next":[{"title":"Entity names should be unique across the project","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/project-hygiene\/duplicateentityname","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/285"}],"prev":[{"title":"Complex microflows should have documentation","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/project-hygiene\/microflowdocumentation","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/624"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=638"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}