From 7ab4c651f0a5fdd443142a9303607bb7edabfe6e Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Fri, 7 Nov 2025 10:28:17 -0700 Subject: [PATCH] Expand directory structure and naming philosophy Added general philosophy for directory structure and file naming conventions. --- contributingGuides/philosophies/DIRECTORIES.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/contributingGuides/philosophies/DIRECTORIES.md b/contributingGuides/philosophies/DIRECTORIES.md index b15870e18a64..49e3bf681321 100644 --- a/contributingGuides/philosophies/DIRECTORIES.md +++ b/contributingGuides/philosophies/DIRECTORIES.md @@ -1,6 +1,18 @@ # Directory Structure and File Naming Philosophy Learn how files are organized in the project. +## General Philosophy +This is how things should be organized from a conceptual level: + +- Start by page (`src/page/whatever`) which correlates to a good name indicating what the page is (eg: `report`, `account`, `workspace`,) ideally and if the route is not a short form one (eg: `/r/`, `/a/`), it should also match the route + - Pieces of the page should be put into sub-folders of the page + - Anything that is built ONLY for this page should go in the page directory (hooks and components included) + - Any component that is general enough to be reused elsewhere should go in `src/components` + - If multiple files are needed for a component, put them in their own folder (eg. `src/components/button`) + - Any hook that is general enough to be reused elsewhere should go in `src/hooks` +- All non-UI files should go in `src/libs` + - All action files should go in `src/libs/actions` + ### RULES #### - Directory names MUST be camel-case #### - Directory names SHOULD be plural