|
| 1 | +# meteor-boilerplate |
| 2 | + |
| 3 | +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. |
| 4 | + |
| 5 | +<!-- toc --> |
| 6 | + |
| 7 | +* [Installing with orion-cli](#installing-with-orion-cli) |
| 8 | +* [How to use](#how-to-use) |
| 9 | + * [Generating files](#generating-files) |
| 10 | + * [Removing default code](#removing-default-code) |
| 11 | + * [Available profiles (cofeescript and es6)](#available-profiles-cofeescript-and-es6) |
| 12 | + * [Deployments](#deployments) |
| 13 | + * [SEO and other concerns](#seo-and-other-concerns) |
| 14 | + * [Adding allow rules for external URLs](#adding-allow-rules-for-external-urls) |
| 15 | +* [Structure](#structure) |
| 16 | + * [Packages used](#packages-used) |
| 17 | + * [Folder structure](#folder-structure) |
| 18 | +* [Other Awesome Boilerplates](#other-awesome-boilerplates) |
| 19 | +* [License](#license) |
| 20 | + |
| 21 | +<!-- toc stop --> |
| 22 | + |
| 23 | +The boilerplate looks like following: [boilerplate.meteor.com](http://boilerplate.meteor.com). Have a look at [starthacking](http://starthacking.meteor.com/) for a project created with this boilerplate. |
| 24 | + |
| 25 | +## Installing with orion-cli |
| 26 | + |
| 27 | +```bash |
| 28 | +npm install -g orion-cli |
| 29 | +``` |
| 30 | + |
| 31 | +This will install the [orion-cli](https://github.com/matteodem/orion-cli) tool, which can be used for scaffolding files with different profiles. |
| 32 | +You can still clone the repository, which doesn't give you the profile and scaffolding support. |
| 33 | + |
| 34 | +## How to use |
| 35 | + |
| 36 | +```sh |
| 37 | +# Assuming meteor is already installed |
| 38 | +orion create appName |
| 39 | +cd appName && meteor |
| 40 | +``` |
| 41 | + |
| 42 | +### Generating files |
| 43 | + |
| 44 | +With orion-cli you can scaffold files based on your configuration that you've got. |
| 45 | + |
| 46 | +```sh |
| 47 | +orion generate routes |
| 48 | +``` |
| 49 | + |
| 50 | +You can create models, views, change profiles and reset the project with the console tool (see below). |
| 51 | + |
| 52 | + |
| 53 | +### Removing default code |
| 54 | + |
| 55 | +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 |
| 56 | +empty project use the provided command to get rid off all the code you don't need. |
| 57 | + |
| 58 | +```sh |
| 59 | +orion reset |
| 60 | +``` |
| 61 | + |
| 62 | +### Available profiles (coffeescript and es6) |
| 63 | + |
| 64 | +* default (Plain Vanilla Javascript) |
| 65 | +* coffee (coffeescript, Unfancy JavaScript) |
| 66 | +* es6 (traceur, Traceur is a JavaScript.next-to-JavaScript-of-today compiler) |
| 67 | + |
| 68 | +You can change your profile like that |
| 69 | +```sh |
| 70 | +orion set-profile |
| 71 | +``` |
| 72 | + |
| 73 | +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. |
| 74 | + |
| 75 | +### Deployments |
| 76 | + |
| 77 | +It is highly recommended to use [Meteor Up](https://github.com/arunoda/meteor-up) for easy deployments. |
| 78 | +Have a look at the repository for more information. |
| 79 | + |
| 80 | +### SEO and other concerns |
| 81 | + |
| 82 | +> Meteor cannot do SEO |
| 83 | +
|
| 84 | +This statement is only partially true, since there is a package called [ms-seo](https://github.com/DerMambo/ms-seo), which |
| 85 | +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 |
| 86 | +__client/lib/constants.js__ for the app. Change SEO settings inside the routes like that. |
| 87 | + |
| 88 | +```javascript |
| 89 | +Router.route('/about', function () { |
| 90 | + this.render('about'); |
| 91 | + // Using the app constants |
| 92 | + SEO.set({ title: 'About -' + Meteor.App.NAME, og: {...} }); |
| 93 | +}); |
| 94 | +``` |
| 95 | + |
| 96 | +### Adding allow rules for external URLs |
| 97 | + |
| 98 | +The [browser-policy](https://atmospherejs.com/meteor/browser-policy) adds rules to deny all operations from external URLs. |
| 99 | +This helps dealing with clickjacking and other XSS methods used to attack the client. To whitelist a url, add following to |
| 100 | +__server/config/security.js__ |
| 101 | + |
| 102 | +```javascript |
| 103 | +BrowserPolicy.content.allowOriginForAll(YOUR_URL); |
| 104 | +``` |
| 105 | + |
| 106 | +Other security enforcing packages like [audit-argument-checks](https://docs.meteor.com/#/full/auditargumentchecks) and |
| 107 | +[matteodem:easy-security](https://github.com/matteodem/meteor-easy-security) have also been added. |
| 108 | + |
| 109 | +## Structure |
| 110 | + |
| 111 | +### Packages used |
| 112 | + |
| 113 | +* Meteor Core |
| 114 | + * meteor-platform |
| 115 | +* Routing |
| 116 | + * [iron:router](https://github.com/EventedMind/iron-router) |
| 117 | + * [zimme:iron-router-active](https://github.com/zimme/meteor-iron-router-active) |
| 118 | +* Collections |
| 119 | + * [aldeed:collection2](https://github.com/aldeed/meteor-collection2) |
| 120 | + * [dburles:collection-helpers](https://github.com/dburles/meteor-collection-helpers) |
| 121 | +* Accounts |
| 122 | + * [accounts-password](https://github.com/meteor/meteor/tree/devel/packages/accounts-password) |
| 123 | + * [useraccounts:semantic-ui](https://github.com/meteor-useraccounts/semantic-ui) |
| 124 | +* UI and UX |
| 125 | + * [fastclick](https://github.com/meteor/meteor/tree/devel/packages/fastclick) |
| 126 | + * [meteorhacks:fast-render](https://github.com/meteorhacks/fast-render) |
| 127 | + * [natestrauser:animate-css](https://github.com/nate-strauser/meteor-animate-css/) |
| 128 | + * [semantic:ui](https://github.com/Semantic-Org/Semantic-UI-Meteor/) |
| 129 | +* Security |
| 130 | + * [browser-policy](https://github.com/meteor/meteor/tree/devel/packages/browser-policy) |
| 131 | + * [audit-argument-checks](https://github.com/meteor/meteor/tree/devel/packages/audit-argument-checks) |
| 132 | + * [matteodem:easy-security](https://github.com/matteodem/meteor-easy-security) |
| 133 | +* SEO |
| 134 | + * [manuelschoebel:ms-seo](https://github.com/DerMambo/ms-seo) |
| 135 | +* Development |
| 136 | + * [less](https://github.com/meteor/meteor/tree/devel/packages/less) |
| 137 | + * [jquery](https://github.com/meteor/meteor/tree/devel/packages/jquery) |
| 138 | + * [underscore](https://github.com/meteor/meteor/tree/devel/packages/underscore) |
| 139 | + * [raix:handlebar-helpers](https://github.com/raix/Meteor-handlebar-helpers) |
| 140 | + |
| 141 | +The "insecure" and "autopublish" packages are removed by default (they make your app vulnerable). |
| 142 | + |
| 143 | +### Folder structure |
| 144 | + |
| 145 | +``` |
| 146 | +client/ # Client folder |
| 147 | + compatibility/ # Libraries which create a global variable |
| 148 | + config/ # Configuration files (on the client) |
| 149 | + lib/ # Library files that get executed first |
| 150 | + startup/ # Javascript files on Meteor.startup() |
| 151 | + stylesheets # LESS files |
| 152 | + modules/ # Meant for components, such as form and more(*) |
| 153 | + views/ # Contains all views(*) |
| 154 | + common/ # General purpose html templates |
| 155 | +model/ # Model files, for each Meteor.Collection(*) |
| 156 | +private/ # Private files |
| 157 | +public/ # Public files |
| 158 | +routes/ # All routes(*) |
| 159 | +server/ # Server folder |
| 160 | + fixtures/ # Meteor.Collection fixtures defined |
| 161 | + lib/ # Server side library folder |
| 162 | + publications/ # Collection publications(*) |
| 163 | + startup/ # On server startup |
| 164 | +meteor-boilerplate # Command line tool |
| 165 | +``` |
| 166 | + |
| 167 | +(*) = the command line tool creates files in these folders |
| 168 | + |
| 169 | +## Other Awesome Boilerplates |
| 170 | + |
| 171 | +- [Void](https://github.com/SachaG/Void) by Sacha Greif |
| 172 | +- [meteor-jw-opinionated-skeleton](https://github.com/jamesdwilson/meteor-jw-opinionated-skeleton) by jamesdwilson (CoffeeScript) |
| 173 | +- [meteor-boilerplate](https://github.com/BeDifferential/meteor-boilerplate) by BeDifferential (CoffeeScript) |
| 174 | +- [em](https://github.com/EventedMind/em) by EventedMind (Boilerplate & Scaffolding) |
| 175 | + |
| 176 | +## License |
| 177 | +This boilerplate has an MIT License, see the LICENSE.txt for more information. |
0 commit comments