This is a post in a multiple part series on getting started with Meteor JS. If you don’t have Meteor JS installed you will want to start at the first post in the series. Part 2 is where we start building the application.
- Meteor JS (Part 1): What is Meteor JS?
- Meteor JS (Part 2): You installed Meteor JS…. Now what?
- Meteor JS (Part 3): Inserting and Deleting Data
- Meteor JS (Part 3.5): Directory Structure
- Meteor JS (Part 4): Editing & Input Validation
- Meteor JS (Part 5): Styling with Semantic UI
- Meteor JS (Part 6): Authentication & Authorization
- Meteor JS (Part 7): Item Search
This is going to be a short post. That is the reason for calling this part 3.5. I wanted to write a post discussing the directory structure of the price book application.
Old Directory Structure
New Directory Structure
Meteor JS allows for a very flexible project layout.
You can put your files anywhere in the directory tree, but there are a couple of special folders that I would like to call out.
Items that we put in the server directory, or in a sub directory of the server directory, are only available on the server. This code will never be seen by the client. This is a good place to put code that might contain sensitive information like a password or client secret.
Any Other Folder
Contents put in any other folder will be available to the client and the server.
I have linked to the Meteor JS documentation that goes into this subject with a lot more detail.
I have checked in this change to the Github repository. I would recommend cloning the repository but if you would like to make the changes by hand it shouldn’t be too difficult.