Giter Club home page Giter Club logo

meteor-boilerplate's Introduction

meteor-boilerplate

A starting point for MeteorJS applications. Includes iron-router, Bootstrap 3, Font Awesome, LESS and more.

Included Packages

Installation

  1. Clone this repo to <yourapp>

% git clone https://github.com/Differential/meteor-boilerplate.git <yourapp>

  1. Remove .git

% cd <yourapp> && rm -rf .git

  1. Start coding!

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 root. Our structure also keeps view-dependent files together (.html, .less, .js).

.meteor/
client/
  ├── accounts/
  ├── compatibility/
  ├── router/
  └── stylesheets/
    ├── bootstrap/
    ├── bootstrap-ext/
    ├── font-awesome/
    ├── global.less
    ├── mixins.import.less
    └── variables.import.less
  └── views/
    └── dashboard/
      ├── dashboard.html
      ├── dashboard.less
      └── dashboard.js
    └── home/
      ├── home.html
      ├── home.less
      └── home.js
    └── layouts/
      └── mainLayout.html
    ├── footer.html
    ├── header.html
    └── index.html
collections/
  └── items.js
packages/
public/
  ├── fonts/
  └── images/
server/
  ├── views/
  ├── accounts.js
  ├── email.js
  ├── permissions.js
  ├── publications.js
  └── seeds.js

Bootstrap and Less

The majority of Bootstrap can be customized with Less variables. If you look in stylesheets/bootstrap/variables.import.less you will see a slew of configuration variables that can be tweaked to drastically change the look and feel of your site without having to write a single line of CSS.

However we should avoid modifying the core Bootstrap Less files (in case we want to update them later), and should instead override the variables in our own Less files.

For example, to change the color of all primary buttons and links, simply add a @brand-primary variable to stylesheets/variables.import.less:

// variables.import.less
@brand-primary: #DC681D;

If you'd like to override a feature of Bootstrap that can't be modified using variables, simply create a new file in the bootstrap-ext directory named after the corresponding Bootstrap Less file, and make your changes there.

// bootstrap-ext/buttons.import.less
.btn {
  text-transform: uppercase;
}

SEO

Page titles, meta descriptions and Facebook and Twitter meta tags are handled by the manuelschoebel:ms-seo package. Global settings are configured in seo.js, while individual page settings are set at the route or 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.
this.route('post', {
  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()) {
      SEO.set({
        title: this.data().post.title + ' | ' + SEO.settings.title,
        description: this.data().post.description
      });
    }
  }
});

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');
    });

  }

});

meteor-boilerplate's People

Contributors

hellogerard avatar ryw avatar queso avatar cfly15 avatar spencercarli avatar musgravejw avatar bitdeli-chef avatar christianbundy avatar dandv avatar

Watchers

alaafu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.