Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Concerning the folders you mentioned:</p> <ul> <li><strong><code>/libs</code></strong> is usually used for custom <code>classes/functions/modules</code></li> <li><strong><code>/vendor</code></strong> or <strong><code>/support</code></strong> contains 3rd party libraries (added as git sub-module when using git as source control)</li> <li><strong><code>/spec</code></strong> contains specifications for BDD tests.</li> <li><strong><code>/tests</code></strong> contains the unit-tests for an application (using a testing framework, see <a href="https://github.com/joyent/node/wiki/modules#wiki-testing" rel="noreferrer">here</a>)</li> </ul> <p><em>NOTE: both <code>/vendor</code> and <code>/support</code> are deprecated since NPM introduced a clean package management. It's recommended to handle all 3rd-party dependencies using NPM and a package.json file</em></p> <p>When building a rather large application, I recommend the following additional folders (especially if you are using some kind of MVC- / ORM-Framework like <a href="https://github.com/visionmedia/express/tree/master" rel="noreferrer">express</a> or <a href="http://mongoosejs.com/" rel="noreferrer">mongoose</a>):</p> <ul> <li><strong><code>/models</code></strong> contains all your ORM models (called <code>Schemas</code> in mongoose)</li> <li><strong><code>/views</code></strong> contains your view-templates (using any templating language supported in express)</li> <li><strong><code>/public</code></strong> contains all static content (images, style-sheets, client-side JavaScript) <ul> <li><strong><code>/assets/images</code></strong> contains image files</li> <li><strong><code>/assets/pdf</code></strong> contains static pdf files</li> <li><strong><code>/css</code></strong> contains style sheets (or compiled output by a css engine)</li> <li><strong><code>/js</code></strong> contains client side JavaScript</li> </ul></li> <li><strong><code>/controllers</code></strong> contain all your express routes, separated by module/area of your application (note: when using the bootstrapping functionality of express, this folder is called <strong><code>/routes</code></strong>)</li> </ul> <p>I got used to organize my projects this way and i think it works out pretty well.</p> <p><strong>Update for CoffeeScript-based Express applications (using <a href="https://github.com/adunkman/connect-assets" rel="noreferrer">connect-assets</a>):</strong></p> <ul> <li><strong><code>/app</code></strong> contains your compiled JavaScript</li> <li><strong><code>/assets/</code></strong> contains all client-side assets that require compilation <ul> <li><strong><code>/assets/js</code></strong> contains your client-side CoffeeScript files</li> <li><strong><code>/assets/css</code></strong> contains all your LESS/Stylus style-sheets</li> </ul></li> <li><strong><code>/public/(js|css|img)</code></strong> contains your static files that are not handled by any compilers</li> <li><strong><code>/src</code></strong> contains all your server-side specific CoffeeScript files</li> <li><strong><code>/test</code></strong> contains all unit testing scripts (implemented using a testing-framework of your choice)</li> <li><strong><code>/views</code></strong> contains all your express views (be it jade, ejs or any other templating engine)</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload