meteor-boilerplate
A starting point for MeteorJS applications. Includes iron-router, Bootstrap 3, Font Awesome, LESS and more.
Included Packages
- Collections:
- Router:
- Seed Data
- Sass
- Misc:
File Structure
We have a common file structure we use across all of our Meteor apps. Client-only files are stored in the client
directory, server-only files are stored in the server
directory, and shared files are stored in the both
directory. The private
and public
directories are for either private or public assets.
SEO
Page titles, meta descriptions and Facebook and Twitter meta tags are handled by the yasinuslu:blaze-meta package. Global settings are configured in both/router/meta.js
, while individual page settings are set at the controller level.
- Note: the
spiderable
package will need to be installed and configured on your server in order for bots to read your meta tags.
PostsShowController = AppController.extend({
path: '/posts/:_id',
waitOn: function() {
return this.subscribe('post', params._id);
},
data: function() {
return {
post: Post.find({_id: params._id})
};
},
onAfterAction: function() {
if(this.ready()) {
Meta.setTitle(this.data().post.title);
}
}
});
Favicons and Touch Icons
Upload your image to http://realfavicongenerator.net/ and place the resulting images in public/images/favicons
Seed Data
You can use the dburles:factory and anti:fake packages to generate fake collection data for testing your UI. See server/seeds.js
for an example:
Meteor.startup(function() {
Factory.define('item', Items, {
name: function() { return Fake.sentence(); },
rating: function() { return _.random(1, 5); }
});
if (Items.find({}).count() === 0) {
_(10).times(function(n) {
Factory.create('item');
});
}
});