Blame view

README.md 6.05 KB
822b3f913   Ryan Glover   Update README to ...
1
  # The Meteor Chef - Base (@1.0.2.1)
aa8376fb4   Ryan Glover   Add basic README ...
2
  A starting point for Meteor apps.
8435208bb   Ryan Glover   Add nod to recipe...
3
  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.
aa8376fb4   Ryan Glover   Add basic README ...
4

8651eb8e0   Ryan Glover   Add link to Chang...
5
  For more detail on updates, [read the Changelog](https://github.com/themeteorchef/base/wiki/Changelog).
aa8376fb4   Ryan Glover   Add basic README ...
6
  ### Packages Included
d30971538   Ryan Glover   Update formatting...
7
8
9
  - Accounts (Base) - `meteor add accounts-base`
  - Accounts (Password) - `meteor add accounts-password`
  - Audit Argument Checks - `meteor add audit-argument-checks`
021324406   Ryan Glover   Remove pinglamb:b...
10
  - Bootstrap 3 - `meteor add twbs:bootstrap`
f12d9dc25   Ryan Glover   Update README to ...
11
  - Browser Policy - `meteor add browser-policy`
d30971538   Ryan Glover   Update formatting...
12
  - Check - `meteor add check`
07610a42f   Ryan Glover   Update README to ...
13
14
  - Handlebars Server - `meteor add cmather:handlebars-server`
  - Iron Router - `meteor add iron:router`
d30971538   Ryan Glover   Update formatting...
15
  - jQuery - `meteor add jquery`
10b1a6f3d   Ryan Glover   Update documentat...
16
  - jQuery Validation - `meteor add themeteorchef:jquery-validation`
f12d9dc25   Ryan Glover   Update README to ...
17
  - NPM - `meteor add meteorhacks:npm`
dfcb49d75   Ryan Glover   Additional edits ...
18
  - Sass - `meteor add particle4dev:sass@0.3.0`
d30971538   Ryan Glover   Update formatting...
19
  - Underscore - `meteor add underscore`
aa8376fb4   Ryan Glover   Add basic README ...
20

f12d9dc25   Ryan Glover   Update README to ...
21
  **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/).
d1f4dbea8   Ryan Glover   Additional README...
22
23
24
25
26
  ### File Structure
  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:
  
  ```
  /root
07610a42f   Ryan Glover   Update README to ...
27
  ---/.meteor
d1f4dbea8   Ryan Glover   Additional README...
28
29
  ---/client
  ------/controllers
39a8af161   Ryan Glover   Add bootstrap hea...
30
  ---------/authenticated
d36bdd404   Ryan Glover   Update README.md ...
31
  ------------header.js
d1f4dbea8   Ryan Glover   Additional README...
32
  ---------/public
d36bdd404   Ryan Glover   Update README.md ...
33
  ------------login.js
d36bdd404   Ryan Glover   Update README.md ...
34
35
  ------------recover-password.js
  ------------reset-password.js
95a4bb32c   Ryan Glover   Stylistic improve...
36
  ------------signup.js
d1f4dbea8   Ryan Glover   Additional README...
37
  ------/helpers
d36bdd404   Ryan Glover   Update README.md ...
38
  ---------helpers-ui.js
39a8af161   Ryan Glover   Add bootstrap hea...
39
40
  ------/includes
  ---------_header.html
d1f4dbea8   Ryan Glover   Additional README...
41
42
43
  ------/layouts
  ---------layout-default.html
  ------/routes
f12d9dc25   Ryan Glover   Update README to ...
44
  ---------hooks.js
d36bdd404   Ryan Glover   Update README.md ...
45
  ---------routes-authenticated.js
95a4bb32c   Ryan Glover   Stylistic improve...
46
  ---------routes-global.js
d36bdd404   Ryan Glover   Update README.md ...
47
  ---------routes-public.js
d1f4dbea8   Ryan Glover   Additional README...
48
  ------/stylesheets
07610a42f   Ryan Glover   Update README to ...
49
50
51
  ---------/sass
  ------------/globals
  ---------------_extends.scss
07610a42f   Ryan Glover   Update README to ...
52
  ------------/views
07610a42f   Ryan Glover   Update README to ...
53
54
55
  ---------------/public
  ------------------_login.scss
  ---------application.scss
cabe1c46e   Ryan Glover   Add a simple sign...
56
  -------/views
39d39619c   Ryan Glover   Add automatic acc...
57
58
  ---------/authenticated
  ------------index.html
cabe1c46e   Ryan Glover   Add a simple sign...
59
  ---------/public
f12d9dc25   Ryan Glover   Update README to ...
60
  ------------loading.html
cabe1c46e   Ryan Glover   Add a simple sign...
61
  ------------login.html
07610a42f   Ryan Glover   Update README to ...
62
  ------------not-found.html
cabe1c46e   Ryan Glover   Add a simple sign...
63
64
65
  ------------recover-password.html
  ------------reset-password.html
  ------------signup.html
d1f4dbea8   Ryan Glover   Additional README...
66
  ---/collections
d36bdd404   Ryan Glover   Update README.md ...
67
  ------example.js
f12d9dc25   Ryan Glover   Update README to ...
68
  ------users.js
d1f4dbea8   Ryan Glover   Additional README...
69
  ---/packages
39d39619c   Ryan Glover   Add automatic acc...
70
  ------ (See List Above)
d1f4dbea8   Ryan Glover   Additional README...
71
72
73
  ---/public
  ---/server
  ------/admin
f12d9dc25   Ryan Glover   Update README to ...
74
75
76
  ---------/startup-functions
  ------------browser-policies.js
  ------------test-accounts.js
d36bdd404   Ryan Glover   Update README.md ...
77
  ---------startup.js
07610a42f   Ryan Glover   Update README to ...
78
  ------/email
07610a42f   Ryan Glover   Update README to ...
79
  ---------/templates
d36bdd404   Ryan Glover   Update README.md ...
80
  ------------reset-password.js
07610a42f   Ryan Glover   Update README to ...
81
  ------/publications
f12d9dc25   Ryan Glover   Update README to ...
82
  ---------example.js
d1f4dbea8   Ryan Glover   Additional README...
83
  ```
d36bdd404   Ryan Glover   Update README.md ...
84
85
86
87
  ### JavaScript & CSS
  Prior to v2.0.0, Base was written in CoffeeScript. At the request of the community, Base was ported _back_ to native JavaScript.
  
  CSS in Base is written using [Sass](http://sass-lang.com).
d1f4dbea8   Ryan Glover   Additional README...
88

aa8376fb4   Ryan Glover   Add basic README ...
89
  ### Functionality
7fa84d8b4   Ryan Glover   Add settings.json...
90
91
  ###### Configuration
  For things like API keys and connection strings, Base supports loading a `settings.json` file (located at `/settings.json`) on startup. By default, `settings.json` includes a `public` and `private` object where you can store client only and server only values respectively. To learn more about making use of `settings.json`, check out [our example in the Meteor Patterns wiki](https://github.com/themeteorchef/base/wiki/Meteor-Patterns#9-configuration).
95a4bb32c   Ryan Glover   Stylistic improve...
92
  ###### Bootstrap (@3.2.1)
f12d9dc25   Ryan Glover   Update README to ...
93
  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.
3f0a97317   Ryan Glover   Update README wit...
94

95a4bb32c   Ryan Glover   Stylistic improve...
95
  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.
c7fad243d   Ryan Glover   Add note in READM...
96

39d39619c   Ryan Glover   Add automatic acc...
97
  ###### Basic Routing
95a4bb32c   Ryan Glover   Stylistic improve...
98
  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:
39d39619c   Ryan Glover   Add automatic acc...
99
100
101
102
  
  ```
  - / (Authenticated)
  - /login (Public)
39d39619c   Ryan Glover   Add automatic acc...
103
104
  - /recover-password (Public)
  - /reset-password (Public)
95a4bb32c   Ryan Glover   Stylistic improve...
105
  - /signup (Public)
39d39619c   Ryan Glover   Add automatic acc...
106
  ```
aa8376fb4   Ryan Glover   Add basic README ...
107

95a4bb32c   Ryan Glover   Stylistic improve...
108
  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.
45fadbd0b   Ryan Glover   Add UI helper to ...
109

f12d9dc25   Ryan Glover   Update README to ...
110
  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).
033f96299   Ryan Glover   Update README wit...
111
  ###### Authentication
95a4bb32c   Ryan Glover   Stylistic improve...
112
  Base includes a complete authentication pattern complete with:
39d39619c   Ryan Glover   Add automatic acc...
113

510619f55   Ryan Glover   Clean up document...
114
  - Login (at /login)
d36bdd404   Ryan Glover   Update README.md ...
115
  - Logout (no path, implemented as a dropdown item/click event in /client/controllers/header.js)
510619f55   Ryan Glover   Clean up document...
116
  - Password Recovery (at /recover-password and /reset-password)
95a4bb32c   Ryan Glover   Stylistic improve...
117
  - Signup (at /signup)
39d39619c   Ryan Glover   Add automatic acc...
118

f12d9dc25   Ryan Glover   Update README to ...
119
120
  ###### Example Collection/Publication/Subscription
  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`.
10b1a6f3d   Ryan Glover   Update documentat...
121
  ###### Validation
95a4bb32c   Ryan Glover   Stylistic improve...
122
  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.
033f96299   Ryan Glover   Update README wit...
123

39d39619c   Ryan Glover   Add automatic acc...
124
  ###### Automatic Admin User Creation
d36bdd404   Ryan Glover   Update README.md ...
125
  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**.