Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions contributingGuides/philosophies/DIRECTORIES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down