Code Monkey home page Code Monkey logo

meteor-boilerplate's Introduction

meteor-boilerplate

This boilerplate is here to give you a starting point for your meteor projects, with a console tool to ease up some tasks. Essential atmosphere packages are included to give you features like routing and collection schemas out-of-the-box.

The boilerplate looks like following: boilerplate.meteor.com. Have a look at starthacking for a project created with this boilerplate.

Installing with orion-cli

npm install -g orion-cli

This will install the orion-cli tool, which can be used for scaffolding files with different profiles. You can still clone the repository, which doesn't give you the profile and scaffolding support.

How to use

# Assuming meteor is already installed
orion create appName
cd appName && meteor

Generating files

With orion-cli you can scaffold files based on your configuration that you've got.

orion generate routes

You can create models, views, change profiles and reset the project with the console tool (see below).

Removing default code

There's already a lot of predefined code in this boilerplate, to show you the possible functionality. However, if you want to start off with an empty project use the provided command to get rid off all the code you don't need.

orion reset

Available profiles (coffeescript and es6)

  • default (Plain Vanilla Javascript)
  • coffee (coffeescript, Unfancy JavaScript)
  • es6 (traceur, Traceur is a JavaScript.next-to-JavaScript-of-today compiler)

You can change your profile like that

orion set-profile

There will be a prompt, where you can enter coffee or any other profile that you have specified. Also use the reset command to start off with blank files according to your profile.

Deployments

It is highly recommended to use Meteor Up for easy deployments. Have a look at the repository for more information.

SEO and other concerns

Meteor cannot do SEO

This statement is only partially true, since there is a package called ms-seo, which has a lot of neat little tricks to help web crawlers notice your app the way you want them to. This boilerplate also adds constants under client/lib/constants.js for the app. Change SEO settings inside the routes like that.

Router.route('/about', function () {
  this.render('about');
  // Using the app constants
  SEO.set({ title: 'About -' + Meteor.App.NAME, og: {...} });
});

Adding allow rules for external URLs

The browser-policy adds rules to deny all operations from external URLs. This helps dealing with clickjacking and other XSS methods used to attack the client. To whitelist a url, add following to server/config/security.js

BrowserPolicy.content.allowOriginForAll(YOUR_URL);

Other security enforcing packages like audit-argument-checks and matteodem:easy-security have also been added.

Structure

Packages used

The "insecure" and "autopublish" packages are removed by default (they make your app vulnerable).

Folder structure

client/ 				# Client folder
    compatibility/      # Libraries which create a global variable
    config/             # Configuration files (on the client)
	lib/                # Library files that get executed first
    startup/            # Javascript files on Meteor.startup()
    stylesheets         # LESS files
    modules/            # Meant for components, such as form and more(*)
	views/			    # Contains all views(*)
	    common/         # General purpose html templates
model/  				# Model files, for each Meteor.Collection(*)
private/                # Private files
public/                 # Public files
routes/                 # All routes(*)
server/					# Server folder
    fixtures/           # Meteor.Collection fixtures defined
    lib/                # Server side library folder
    publications/       # Collection publications(*)
    startup/            # On server startup
meteor-boilerplate		# Command line tool

(*) = the command line tool creates files in these folders

Other Awesome Boilerplates

License

This boilerplate has an MIT License, see the LICENSE.txt for more information.

meteor-boilerplate's People

Contributors

besublime avatar dandv avatar dhamaniasad avatar johnbrett avatar matteodem avatar oztk avatar rafaelbeckel avatar smt avatar timstott avatar

Watchers

 avatar  avatar  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.