This is a starting point for Meteor-based applications. It includes some useful packages, organization techniques to ensure that your codebase is stays mantainable and easy to understand. It also contains a gulp-based coding standards sniffer to ensure code quality.
A very simple example of a meteor app built from this boilerplate is OnTask.
Here's a list of packages installed by default.
A router that works on the server and the browser.
Extends Mongo.Collection to provide support for specifying a schema and then validating against that schema when inserting and updating.
Sets up a transformation on your collections allowing for simple models, with an interface similar to template helpers.
Adds UI components and helpers to easily create basic forms with automatic insert and update events, and automatic reactive validation.
Roles-based authorization package for Meteor - compatible with built-in accounts package.
Brings sass to your meteor application using node-sass.
meteor-boilerplate adds these meteor core packages by default:
Deployment with Docker
This package includes a basic dockerfile for deploying built versions of your application. More instructions and development on this feature to come.
This project contains multiple tools for enforcing coding standards and checking for errors within the codebase. The standards are defined in the
.jshintrc files in the project root.
- Change directory to the root directory of the boilerplate (Not Meteor's root), like:
npm installto retrieve dependencies.
To check your local codebase, run
gulp cs from a console in the project root. An error report, if any, will be generated in the console.
/lib folders provide some basic app structure that I've found to be useful:
/docs - Contains all documentation for your application /src
/styles - Contains all of your stylesheets.
- app.scss - Empty sass file that should hold your application's styles.
/modules - Holds a folder for each application module. Each module folder should contain routes, event handles, UI components, and subscriptions.
- example.js - Example view file that defines a default route.
- example.html - Example default template that the sample.js route yields.
/templates - Contains all of your less stylesheets.
- app.html - Basic app html file with a default layout defined.
- layoutMain.html - Default layout template.
- header.html - Header template.
- routes.js - Iron Router configuration file.
- /styles - Contains all of your stylesheets.
/collections - Folder that contains collection definitions.
- example.js - Defines an example collection, with a schema and a helper.
- /collections - Folder that contains collection definitions.
/public - Contains all files served by applications.
- /images - Contains all images served by applications.
/server/ - Server specific files.
/modules/ - Contains a directory for each module. Each module directory will have publication functions, allow/deny functions, and Meteor methods.
- example.js - Sample publication, allow/deny, and method functions.
- /startup/ - Files containing scripts that should run on startup. For instance, a user.js file that creates a default admin user for your app if one doesn't already exist.
- example.js - Sample startup function.
- /modules/ - Contains a directory for each module. Each module directory will have publication functions, allow/deny functions, and Meteor methods.