Commit a3a1cb9c4b887c11b1f72b21a6505dbad5dd02df

Authored by Ryan Glover
1 parent 6dd0ad2bb9
Exists in master

update README.md

Showing 1 changed file with 15 additions and 168 deletions   Show diff stats
1   -# The Meteor Chef - Base (@1.1.0.3)
  1 +# The Meteor Chef - Base
2 2 A starting point for Meteor apps.
3 3  
4   -Base is the lazy person's starter kit for Meteor. It includes some commonly used packages (biased to The Meteor Chef) and code for common functionality. This is the starter kit for all Meteor Chef recipes.
5   -
6   -For more detail on updates, [read the Changelog](https://github.com/themeteorchef/base/wiki/Changelog). If you're interested in contributing to Base, checkout the [Contribution wiki](https://github.com/themeteorchef/base/wiki/Contributing-to-Base) to get started.
7   -
8   -### Packages Included
9   -- Accounts (Base) - `meteor add accounts-base`
10   -- Accounts (Password) - `meteor add accounts-password`
11   -- Audit Argument Checks - `meteor add audit-argument-checks`
12   -- Bert - `meteor add themeteorchef:bert`
13   -- Bootstrap 3 - `meteor add twbs:bootstrap`
14   -- Browser Policy - `meteor add browser-policy`
15   -- Check - `meteor add check`
16   -- Iron Router - `meteor add iron:router`
17   -- jQuery - `meteor add jquery`
18   -- jQuery Validation - `meteor add themeteorchef:jquery-validation`
19   -- NPM - `meteor add meteorhacks:npm`
20   -- Sass - `meteor add fourseven:scss`
21   -- SSR - `meteor add meteorhacks:ssr`
22   -- Underscore - `meteor add underscore`
23   -
24   -**Note:** Base also supports loading NPM packages using the `meteorhacks:npm` package. To load NPM packages, add name and version information to `/packages.json` and inside of your file (server only), load the package with `var package = Meteor.npmRequire('package-name');`. For more information, see the [meteorhacks:npm documentation](https://github.com/meteorhacks/npm/).
25   -
26   -### File Structure
27   -Base comes with a pre-defined file structure common to all projects along with some skeleton files for getting started quickly. Here's what it looks like:
28   -
29   -```
30   -/root
31   ----/.meteor
32   ----/client
33   -------/controllers
34   ----------/authenticated
35   -------------header.js
36   ----------/public
37   -------------login.js
38   -------------recover-password.js
39   -------------reset-password.js
40   -------------signup.js
41   -------/helpers
42   ----------helpers-ui.js
43   -------/includes
44   ----------_header.html
45   -------/layouts
46   ----------layout-default.html
47   -------/routes
48   ----------hooks.js
49   ----------routes-authenticated.js
50   ----------routes-global.js
51   ----------routes-public.js
52   -------/stylesheets
53   ----------/sass
54   -------------/globals
55   ----------------_extends.scss
56   -------------/views
57   ----------------/public
58   -------------------_login.scss
59   ----------application.scss
60   -------/views
61   ----------/authenticated
62   -------------index.html
63   ----------/public
64   -------------loading.html
65   -------------login.html
66   -------------not-found.html
67   -------------recover-password.html
68   -------------reset-password.html
69   -------------signup.html
70   ----/collections
71   -------example.js
72   -------users.js
73   ----/packages
74   ------- (See List Above)
75   ----/public
76   -------/images
77   ----/server
78   -------/admin
79   ----------/startup-functions
80   -------------browser-policies.js
81   -------------test-accounts.js
82   ----------startup.js
83   -------/email
84   ----------/templates
85   -------------reset-password.js
86   -------/methods
87   ----------/insert
88   -------------example.js
89   ----------/read
90   -------------example.js
91   ----------/remove
92   -------------example.js
93   ----------/update
94   -------------example.js
95   ----------/utility
96   -------------example.js
97   -------/publications
98   ----------example.js
99   ----.editorconfig
100   ----.gitignore
101   ----application.html
102   ----package.json
103   ----packages.json
104   ----README.MD (this file)
105   ----settings-development.json
106   ----settings-production.json
107   ----smart.json (added by Meteor)
108   ----smart.lock (added by Meteor)
109   -```
110   -
111   -### JavaScript & CSS
112   -Prior to v2.0.0, Base was written in CoffeeScript. At the request of the community, Base was ported _back_ to native JavaScript.
113   -
114   -CSS in Base is written using [Sass](http://sass-lang.com).
115   -
116   -### Functionality
117   -
118   -###### Configuration
119   -Base includes a pattern for managing your API keys, connection strings, and other configuration information using two files: `settings-development.json` and `settings-production.json`. This pattern separates your development and production configuration into two separate files for the sake of security.
120   -
121   -Per [Josh Owens' article](http://joshowens.me/environment-settings-and-security-with-meteor-js/), it's considered "bad practice" to check your production keys into your repo (private or otherwise). Base accounts for this by giving you two separate files, but also specifies that your `settings-production.json` file should be ignored by git in `.gitignore`.
122   -
123   -This means that keys that are only used for testing or development purposes can be placed in `settings-development.json`, while keys used in your production application should be placed in `settings-production.json`. Sharing and management of `settings-production.json` should be done on a person-to-person basis and _not_ made globally accessible.
124   -
125   -###### Startup & Deployment
126   -A tip picked up from [Gerard Sychay at Differential](http://blog.differential.com/use-package-json-in-your-meteor-app-for-fun-profit/), Base makes use of the NPM `package.json` convention to make startup and deployment super easy. Within `package.json`, three scripts have been defined for you:
127   -
128   -1. `npm start` - Starts your Meteor server locally with `settings-development.json` in tow. Equivalent to typing out `meteor --settings settings-development.json`.
129   -2. `npm staging` - Deploys your Meteor app to a [Modulus](http://modulus.io) server defined as your "Staging" environment. This requires you to have a Modulus account set up and a server titled "Staging" set up. You can customize this to match your own naming conventions. This also automatically sets your `METEOR_SETTINGS` environment variable on Modulus equal to the contents of your `settings-development.json` file so you don't have to do it by hand.
130   -3. `npm production` - Deploys your Meteor app to a [Modulus](http://modulus.io) server defined as your "Production" environment. This requires you to have a Modulus account set up and a server titled "Production" set up. You can customize this to match your own naming conventions. This also automatically sets your `METEOR_SETTINGS` environment variable on Modulus equal to the contents of your `settings-production.json` file so you don't have to do it by hand.
131   -
132   -###### Bootstrap (@3.2.1)
133   -Base makes use of the [Bootstrap](http://getbootstrap.com) front-end Framework. It may not be your bag of chips and is *definitely not required*. If you want to swap it out, you'll need to unhook the markup in each of the included template files in `/client/views` and uninstall the `twbs:bootstrap` package by running `meteor remove twbs:bootstrap` in your terminal.
134   -
135   -In respect to UI, Base uses Bootstrap's `.navbar` element, as well as its `.container` and a few `.row`/`.col-<size>-<columns>` wrappers. You'll also find the `.btn` class and its modifiers (`.success, .warning, etc.`) in use throughout the app. All of these implementations are merely presentational and can be changed (or removed) as you see fit.
136   -
137   -###### Basic Routing
138   -Base comes with a collection of pre-defined routes and templates for common functionality. Base also includes a set of common route filters for managing user access. Routes bundled include:
139   -
140   -```
141   -- / (Authenticated)
142   -- /login (Public)
143   -- /recover-password (Public)
144   -- /reset-password (Public)
145   -- /signup (Public)
146   -```
147   -
148   -A UI helper called `currentRoute` has been added to Base which allows you to add an `active` class to menu items in your navigation to reflect the user's current location.
149   -
150   -A collection of hooks has also been added to Base to control route access based on different conditions (e.g. whether a user is logged in or not).
151   -
152   -###### Authentication
153   -Base includes a complete authentication pattern complete with:
154   -
155   -- Login (at /login)
156   -- Logout (no path, implemented as a dropdown item/click event in /client/controllers/header.js)
157   -- Password Recovery (at /recover-password and /reset-password)
158   -- Signup (at /signup)
159   -
160   -###### Example Collection/Publication/Subscription
161   -Base includes a collection called `Example`, along with a publication and subscription pattern to show moving data from the server to the client. Publications are defined in `/server/publications/example.js` and a subscription is demonstrated on the `index` route in `/client/routes/routes-authenticated.js`.
162   -
163   -###### Validation
164   -Base includes support for client-side validation via [jQuery Validation](http://jqueryvalidation.org). Validation is provided for all public templates: login, signup, recover password, and reset password.
165   -
166   -###### Alerts
167   -Base includes support for fixed bar (top and bottom) and growl-style alerts on the client via [`themeteorchef:bert`](https://atmospherejs.com/themeteorchef/bert).
168   -
169   -###### Automatic Admin User Creation
170   -When developing, having a handful of user accounts to test your application with can come in handy. Base comes with an automated account generation script located in `server/admin/startup.js` that creates accounts based on an array of specified users. **Note: by default this creates one Admin user on server startup, so make sure to customize or remove this user so the public can't access your app**.
  4 +<table>
  5 + <tbody>
  6 + <tr>
  7 + <th>Base Version</th>
  8 + <td>v3.0.0</td>
  9 + </tr>
  10 + <tr>
  11 + <th>Meteor Version</th>
  12 + <td>v1.2.0.1</td>
  13 + </tr>
  14 + </tbody>
  15 +</table>
  16 +
  17 +[Read the Documentation](http://themeteorchef.com/base)
... ...