Blame view
README.md
6.65 KB
31f397879
|
1 |
# The Meteor Chef - Base (@1.0.3.1) |
aa8376fb4
|
2 |
A starting point for Meteor apps. |
8435208bb
|
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
|
4 |
|
7becce2b9
|
5 |
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. |
8651eb8e0
|
6 |
|
aa8376fb4
|
7 |
### Packages Included |
d30971538
|
8 9 10 |
- Accounts (Base) - `meteor add accounts-base` - Accounts (Password) - `meteor add accounts-password` - Audit Argument Checks - `meteor add audit-argument-checks` |
8391001a9
|
11 |
- Bert - `meteor add themeteorchef:bert` |
021324406
|
12 |
- Bootstrap 3 - `meteor add twbs:bootstrap` |
f12d9dc25
|
13 |
- Browser Policy - `meteor add browser-policy` |
d30971538
|
14 |
- Check - `meteor add check` |
07610a42f
|
15 16 |
- Handlebars Server - `meteor add cmather:handlebars-server` - Iron Router - `meteor add iron:router` |
d30971538
|
17 |
- jQuery - `meteor add jquery` |
10b1a6f3d
|
18 |
- jQuery Validation - `meteor add themeteorchef:jquery-validation` |
f12d9dc25
|
19 |
- NPM - `meteor add meteorhacks:npm` |
dfcb49d75
|
20 |
- Sass - `meteor add particle4dev:sass@0.3.0` |
d30971538
|
21 |
- Underscore - `meteor add underscore` |
aa8376fb4
|
22 |
|
f12d9dc25
|
23 |
**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
|
24 25 26 27 28 |
### 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
|
29 |
---/.meteor |
d1f4dbea8
|
30 31 |
---/client ------/controllers |
39a8af161
|
32 |
---------/authenticated |
d36bdd404
|
33 |
------------header.js |
d1f4dbea8
|
34 |
---------/public |
d36bdd404
|
35 |
------------login.js |
d36bdd404
|
36 37 |
------------recover-password.js ------------reset-password.js |
95a4bb32c
|
38 |
------------signup.js |
d1f4dbea8
|
39 |
------/helpers |
d36bdd404
|
40 |
---------helpers-ui.js |
39a8af161
|
41 42 |
------/includes ---------_header.html |
d1f4dbea8
|
43 44 45 |
------/layouts ---------layout-default.html ------/routes |
f12d9dc25
|
46 |
---------hooks.js |
d36bdd404
|
47 |
---------routes-authenticated.js |
95a4bb32c
|
48 |
---------routes-global.js |
d36bdd404
|
49 |
---------routes-public.js |
d1f4dbea8
|
50 |
------/stylesheets |
07610a42f
|
51 52 53 |
---------/sass ------------/globals ---------------_extends.scss |
07610a42f
|
54 |
------------/views |
07610a42f
|
55 56 57 |
---------------/public ------------------_login.scss ---------application.scss |
cabe1c46e
|
58 |
-------/views |
39d39619c
|
59 60 |
---------/authenticated ------------index.html |
cabe1c46e
|
61 |
---------/public |
f12d9dc25
|
62 |
------------loading.html |
cabe1c46e
|
63 |
------------login.html |
07610a42f
|
64 |
------------not-found.html |
cabe1c46e
|
65 66 67 |
------------recover-password.html ------------reset-password.html ------------signup.html |
d1f4dbea8
|
68 |
---/collections |
d36bdd404
|
69 |
------example.js |
f12d9dc25
|
70 |
------users.js |
d1f4dbea8
|
71 |
---/packages |
39d39619c
|
72 |
------ (See List Above) |
d1f4dbea8
|
73 74 75 |
---/public ---/server ------/admin |
f12d9dc25
|
76 77 78 |
---------/startup-functions ------------browser-policies.js ------------test-accounts.js |
d36bdd404
|
79 |
---------startup.js |
07610a42f
|
80 |
|
07610a42f
|
81 |
---------/templates |
d36bdd404
|
82 |
------------reset-password.js |
07610a42f
|
83 |
------/publications |
f12d9dc25
|
84 |
---------example.js |
d1f4dbea8
|
85 |
``` |
d36bdd404
|
86 87 88 89 |
### 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
|
90 |
|
aa8376fb4
|
91 |
### Functionality |
7fa84d8b4
|
92 |
###### Configuration |
c445a14b9
|
93 94 95 96 97 |
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. When starting Meteor, **make sure to use the --settings flag**, passing the location of your settings.json file to Meteor, e.g. `meteor --settings settings.json`. This is required in order for `settings.json` to work properly. 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). |
7fa84d8b4
|
98 |
|
95a4bb32c
|
99 |
###### Bootstrap (@3.2.1) |
f12d9dc25
|
100 |
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
|
101 |
|
95a4bb32c
|
102 |
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
|
103 |
|
39d39619c
|
104 |
###### Basic Routing |
95a4bb32c
|
105 |
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
|
106 107 108 109 |
``` - / (Authenticated) - /login (Public) |
39d39619c
|
110 111 |
- /recover-password (Public) - /reset-password (Public) |
95a4bb32c
|
112 |
- /signup (Public) |
39d39619c
|
113 |
``` |
aa8376fb4
|
114 |
|
95a4bb32c
|
115 |
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
|
116 |
|
f12d9dc25
|
117 |
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
|
118 |
###### Authentication |
95a4bb32c
|
119 |
Base includes a complete authentication pattern complete with: |
39d39619c
|
120 |
|
510619f55
|
121 |
- Login (at /login) |
d36bdd404
|
122 |
- Logout (no path, implemented as a dropdown item/click event in /client/controllers/header.js) |
510619f55
|
123 |
- Password Recovery (at /recover-password and /reset-password) |
95a4bb32c
|
124 |
- Signup (at /signup) |
39d39619c
|
125 |
|
f12d9dc25
|
126 127 |
###### 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`. |
8391001a9
|
128 |
|
10b1a6f3d
|
129 |
###### Validation |
95a4bb32c
|
130 |
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
|
131 |
|
8391001a9
|
132 133 |
###### Alerts Base includes support for fixed bar (top and bottom) and growl-style alerts on the client via [`themeteorchef:bert`](https://atmospherejs.com/themeteorchef/bert). |
39d39619c
|
134 |
###### Automatic Admin User Creation |
d36bdd404
|
135 |
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**. |