-
Notifications
You must be signed in to change notification settings - Fork 7
Folder Structure
Everett Griffiths edited this page May 21, 2014
·
2 revisions
One of Repoman's primary goals was a simplified folder structure to save time during development. Below is an outline of the recommended folder structure that should suit most projects.
-
.gitignore: if you are versioning your work with Git, be sure to ignorevendor/! -
assets/: stores any web-accessible assets such as CSS, Javascript, and images. Configurable via the "assets_path" in composer.json -
composer.json: this is your primary configuration file. Every Repoman project will need this. -
composer.lock: this file works in tandem with composer.json. -
controllers/: this directory is used by custom MODx manager controllers, which are used by custom manager pages (CMPs) and custom resource classes (CRCs). -
docs/: here's where you should put yourchangelog.txt,license.txt, and areadme.txt. Unlike thereadme.mdfile used by Github (see below), this file is plain text and it is displayed to a user prior to installing your package. Other than that, it can contain mostly the same stuff. -
elements/: this directory contains sub-folders for yourchunks/,plugins/,snippets/,templates/, andtvs/. This is where static elements will be saved during development. -
index.class.php: This kicks off requests to a CMP and funnels manager requests to theconnectors/directory (only use this if your package supports a CMP). -
lexicon/: Contains translation strings. MODx does not allow configuration here: the name and location are fixed. -
model/: this directory is the de-facto MODX standard for class files describing your data model and it is used as a base for the "schema:write" and "schema:parse" functions. You can customize this using the "orm_path" setting. -
readme.md: this file is used by Github et al to describe your package. Do not neglect this important piece of documentation! -
tests/: this directory contains unit tests, e.g. used by phpunit. This folder is not included in packaging. You can set an array of directories or files to omit from packaging using the "omit" setting. -
vendor/: this directory is where Composer installs package dependencies. You should reference this folder in your.gitignore.
You don't need to memorize the above to use it: just start your projects using Repoman's create function. Use this command to jump-start your project.
© 2014 and beyond by Craftsman Coding