FW App Structure
Whenever you generate a new app with the installer (or clone and copy a particular FW Kit blueprint), there will exist a folder structure similar to this (in your api-dir/apps/app-name/
folder):
api-dir/apps/my-app/
server/
client/
install.php
package.json
gulpfile.js
README.md
- The
server
folder
The server
folder contains all of the code and related files for the back-end (server) side of your FW App. Check out the server docs for more information on the server-side files.
- The
client
folder
The client
folder contains all the files related to the client-side part of your application. See the client docs for more information on the client-side files.
install.php
The install.php
file is used by the FW Installer to accomplish various tasks when your app is being installed to other systems. See the FW Installer docs (WIP link) for more information.
package.json
The package.json
file serves several purposes. Its main purpose is to describe what different dependencies are needed for your build scripts, but there are several other important parts worth mentioning that you can change.
name
: This is the name of your application (capitalized words and everything). If there are spaces in your application's name, replace them with a dash (-).version
: This is the version of your application. While it is not enforced, it is highly recommended to follow semantic versioning when determining the next version of your app.shortcode
: This is a unique shortcode (3-5 characters long) that can be used to identify your app. It's especially helpful if your app's name is particularly long.description
: This is somewhat optional, but is often helpful to put in this section a short description of what your app does.fw
: This is a section of configuration properties for your FW App. There are currently a couple of supported values that go inside this section.logo
: The link to your application's logo (more on that in the client-side documentation). While not required, it is recommended that your application have a logo.developers
: This is intended to be a list of developers that have worked on the application. Must be a JSON array.dependencies
: This is probably one one of the most important sections of yourpackage.json
. It tells the FW App System which apps and which addons your app needs in order to function.apps
: Each app is specified as a key-value pair. The "key" is the dependent app's shortcode, and the value is another JSON object that can specify some additional parameters. For now, just set the value to{}
.addons
: Each addon is also specified as a key-value pair, the "key" being the name of the addon, and the "value" being the version number to install. See the docs section on addons for more information.
gulpfile.js
The gulpfile is used for various build scripts. See the section for more information.
README.md
The README file can be used to put more information in about your application, e.g. contributing info, who wrote it, copyright/licensing information, etc. A default one is generated as part of the blueprint, but feel free to add/remove from it.
There are several other smaller files that exist in the directory, and while they shouldn't be removed, they aren't as important and thus can be ignored for the purposes of this documentation.