This repository was archived by the owner on Apr 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 109
Application structure
Rand McKinney edited this page Apr 7, 2014
·
8 revisions
A full-stack LoopBack application follows the model-view-controller application pattern.
- Models are LoopBack models, defined in the application's
/modelsdirectory. - Views are defined in the application's
/web/viewsand /html5/views directories. Why are there two views directories? What is the diff? - Controllers are defined in
/html5/controllers.
A full-stack LoopBack application has four sub-directories:
- The
/apidirectory contains code for a "standard LoopBack" app.-
app.api.js- main app file -
configure.js- configuration settings, for example hostname and port, database logins, and so on. package.json
-
- The
/modelsdirectory contains "standard LoopBack" model definitions.-
index.js- Defines each model using the JS files in this directory, for example:exports.Todo = require('./todo'); - One JS file to define each model with
loopback.DataModel.extend(); for exampletodo.js. -
package.json- (Not sure why this is needed here?)
-
- The
/html5directory contains:-
app.html5.js- main file -
configure.js- gulp build file (?) -
package.json- (Not sure why this is needed here?) -
/controllersdirectory-
app.ctrl.js- main application controller - One
.ctrl.jsfile for each model; for example,user.ctrl.js.
-
-
/viewsdirectory - contains.htmlfiles, including one for each model; for example,user.html. -
/builddirectory - output of build process? Is this gulp output? -
/bower_componentsdirectory contains files that Bower uses to manage dependencies for front-end packages.
-
- The
/webdirectory contains: **app.js- defines routes (what else?) **run.js- Used to run the application (?) **/viewsdirectory - contains template files, such as .ejs. **package.json
NOTES: For simplicity, I did not include test directories. These can be described in an addendum.
Why are there three package.json files? Could it be done with one?