Hi!
I’m new to Meteor, and I really like it! I’ve followed some tutorials and I’ve learnt a lot. But those tutorials write all the js-code in a single file.
Now I’m trying to build my first app, but I want to have a better file structure and separate the files from each other.
I now have a /client and a /server folder. My question is: Does all the js-files in the /client folder have to include
Yes, client and server directories separates natively what is execute – and visible – on the client and server respectively. Then I have /lib directory, which is normally where I put what you need to be visible on both sides. For all the rest I’m using the following approach:
client/views is where I the templates – .html file – and template managers code –.js file. I usually create a subdirectory for for each template
I put router.js, collections.js, resources.js in the /lib directory
all the images in the /public/imgs dir
publications.js, server methods and fixtures.js in the /server directory
all your static assets that you need to load from the file system on the server into /private