Book Image

Meteor Design Patterns

By : Marcelo Reyna
Book Image

Meteor Design Patterns

By: Marcelo Reyna

Overview of this book

Table of Contents (13 chapters)


Simplicity is the shortest path to a solution. Meteor is a web development framework that simplifies programming and once it is mastered, gives the developer the power to prototype applications in just a few days and build a production app in just a few weeks. The simplicity of the framework makes maintenance a breeze as well; reorganizing and renaming files will not break your code, code is easy to keep in modules, and virtual environments are a thing of the past. The Meteor Development Group has established the shortest path for web development by producing a feature-rich framework that takes all the experience learned from other frameworks and packs it into Meteor.

While Meteor is simple because of the technical features it comes packed with, it is clear that the framework will become the status quo because of how the team behind it works. Meteor is built by a team that has been actively funded since the beginning of the project, unlike many open source frameworks such as Ruby on Rails, Laravel, CakePHP, and others. This means that the people working towards building the framework actually care about it. Yet, Meteor is an open source project with an active community that has been improving the project constantly through packages or by patching the core code.

What this book covers

Chapter 1, Getting Started with Meteor, covers the basics of Meteor web development. It will cover programming in the same languages (CoffeeScript, Stylus, and Jade), teach us about templates, helpers, and events, and show how to structure web applications.

Chapter 2, Publish and Subscribe Patterns, covers the most important part of Meteor web development—publishers and subscribers. With this chapter, you will understand how to better organize your data to publish only the information that the client requires.

Chapter 3, Front-end Patterns, covers a handful of patterns to improve your frontend code. You will learn how to keep code from repeating and keep it modular, use different kinds of variables, create custom input elements, animations, and more.

Chapter 4, Application Patterns, covers more complex patterns that help to control how data flows into the client, how to keep this data secure, and how to connect with external APIs.

Chapter 5, Testing Patterns, covers how to maintain your code. You will learn how to test all the features of the application and how to only test functions. This will ensure that your code does not break when you start moving things around in the future.

Chapter 6, Deployment, covers how to bring your application to a production environment that will work the way it is meant to work. You will learn how to activate the oplog, how to track errors, and how to set up an SSL certificate.

What you need for this book

  • Meteor version or above

  • A Unix system such as a Mac or Linux computer

Who this book is for

This book is for developers who have already had an introductory course with Meteor. A basic knowledge of web development is recommended.


In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We are using font awesome to create some icons for our #features section as well."

A block of code is set as follows:

@import "_globals/bootstrap/custom.bootstrap.import.styl"

    background: $brand-primary
    height: 80%
@import "_globals/bootstrap/custom.bootstrap.import.styl"

    background: $brand-primary
    height: 80%

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

// /_globals/client/main.styl

html, body, #__flow-root, #__flow-root > .template

Any command-line input or output is written as follows:

meteor reset

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Paste the information to the Private Key textarea."


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to and enter the name of the book in the search field. The required information will appear under the Errata section.


Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.


If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.