Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As in the unofficial meteor faq, I think it pretty much explains how to structure a large app:</p> <blockquote> <h3>Where should I put my files?</h3> <p>The example apps in meteor are very simple, and don’t provide much insight. Here’s my current thinking on the best way to do it: (any suggestions/improvements are very welcome!)</p> <pre><code>lib/ # &lt;- any common code for client/server. lib/environment.js # &lt;- general configuration lib/methods.js # &lt;- Meteor.method definitions lib/external # &lt;- common code from someone else ## Note that js files in lib folders are loaded before other js files. collections/ # &lt;- definitions of collections and methods on them (could be models/) client/lib # &lt;- client specific libraries (also loaded first) client/lib/environment.js # &lt;- configuration of any client side packages client/lib/helpers # &lt;- any helpers (handlebars or otherwise) that are used often in view files client/application.js # &lt;- subscriptions, basic Meteor.startup code. client/index.html # &lt;- toplevel html client/index.js # &lt;- and its JS client/views/&lt;page&gt;.html # &lt;- the templates specific to a single page client/views/&lt;page&gt;.js # &lt;- and the JS to hook it up client/views/&lt;type&gt;/ # &lt;- if you find you have a lot of views of the same object type client/stylesheets/ # &lt;- css / styl / less files server/publications.js # &lt;- Meteor.publish definitions server/lib/environment.js # &lt;- configuration of server side packages public/ # &lt;- static files, such as images, that are served directly. tests/ # &lt;- unit test files (won't be loaded on client or server) </code></pre> <p>For larger applications, discrete functionality can be broken up into sub-directories which are themselves organized using the same pattern. The idea here is that eventually module of functionality could be factored out into a separate smart package, and ideally, shared around.</p> <pre><code>feature-foo/ # &lt;- all functionality related to feature 'foo' feature-foo/lib/ # &lt;- common code feature-foo/models/ # &lt;- model definitions feature-foo/client/ # &lt;- files only sent to the client feature-foo/server/ # &lt;- files only available on the server </code></pre> </blockquote> <p>Find out more: <a href="https://github.com/oortcloud/unofficial-meteor-faq">Unofficial Meteor FAQ</a></p>
    singulars
    1. This table or related slice is empty.
    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. 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