Meteor structure

Coming from structured framework like Rails and Symphony, Meteor does not enforce a fixed structure, if fact you can write your files anywhere, still there are conventions like the following one:

Files in this folder are only served to the client. This is a good place to keep your HTML, CSS, and UI-related JavaScript code.

Files in this directory are only used by the server, they are never  sent to the client. Use /server to store source files with sensitive logic or data that should not be visible to the client.

Files in /public are served to the client on an as-is basis. Use this directory  to store assets such as images. For example, if you have an image located at /public/ background.png, you can include it in your HTML with img src='/background.png'/ or in your CSS with background-image:
url(/background.png). Note that /public is not part of the image URL.

These files can only be accessed by server code through Assets API and are not accessible to the client.

"Meteor official documentation"

An alternative is to rely on something like Iron Generator. This CLI (npm package) creates your desired application structures (i.e. folders and files), by providing at the same time proper generators to create scaffolds for your models, controllers and views.

Here there is an example of usage of the above mentioned Iron Generator.

Leave a Reply

Please Login to comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.