You are previewing Meteor Cookbook.
O'Reilly logo
Meteor Cookbook

Book Description

Over 65 hands-on recipes that cover every aspect of building and deploying elegant, full-stack web applications with Meteor

In Detail

Meteor is an incredibly powerful, impossibly fun platform used to build modern, responsive web and mobile applications

Starting with simple recipes designed for quick reference, and culminating in advanced recipes that walk you through building and deploying a complete application, Meteor Cookbook covers all the major areas of Meteor development, including lesser-known and undocumented features. You will have instant access to step-by-step recipes, accompanied by clear, concise explanations on optimizing your workflow. Whether used as a learning resource or as a quick-reference guide, this book will surely earn a permanent spot on your development work desk!

What You Will Learn

  • Create and deploy user-friendly, touch-enabled web applications

  • Rapidly build robust, responsive user interfaces

  • Integrate any npm/Node package in minutes

  • Leverage isomorphic JavaScript to develop full-stack applications

  • Publish your own reusable custom packages

  • Quickly implement user accounts compatible with Facebook, Google, Twitter, and more

  • Convert external API streams into reactive, self-updating infographics

  • Secure and optimize your Mongo data collections

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. Meteor Cookbook
      1. Table of Contents
      2. Meteor Cookbook
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. Optimizing Your Workflow
        1. Introduction
        2. Installing Meteor
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. Finding documentation for Meteor
          1. How to do it…
          2. How it works…
          3. There's more…
        4. Getting help with questions
          1. How to do it…
          2. How it works…
            1. Stack Overflow
            2. Meteor forums
            3. The #meteor on IRC
          3. There's more…
        5. Setting up your project file structure
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. client/server
            2. main/lib
            3. public/private
            4. both
          4. There's more…
          5. See also
        6. Setting up your development environment
          1. Getting ready

          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        7. Using the web console
          1. Getting ready
            1. Safari
            2. Firefox
            3. Chrome
          2. How to do it…
          3. How it works…
          4. There's more…
        8. Deploying a test app to Meteor
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        9. Deploying to Meteor using a CNAME redirect
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        10. Deploying to a custom hosted environment
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        11. Deploying with Meteor Up (MUP)
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        12. Using CoffeeScript
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        13. Using CSS compilers
          1. Getting ready
          2. How to do it…
            1. Using Stylus
            2. Using Less
            3. Using SCSS / SASS
          3. How it works…
          4. See also
      9. 2. Customizing with Packages
        1. Introduction
        2. Adding Meteor packages
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        3. Removing Meteor packages
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Discovering new packages with Atmosphere
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Creating a multipage application with Iron Router
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. Building a custom package
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        7. Using npm modules
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        8. Publishing custom packages to Atmosphere
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      10. 3. Building Great User Interfaces
        1. Introduction
        2. Inserting templates with Spacebars
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
        3. Inserting raw HTML using triple braces
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Creating dynamic lists
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Building a smooth interface with Bootstrap
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. Creating customized global helpers
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        7. Creating custom components
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        8. Using reactivity with HTML attributes
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        9. Using dynamic templates
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
          5. See also
        10. Animating DOM elements
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
          5. See also
      11. 4. Creating Models
        1. Introduction
        2. Implementing a simple collection
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Using the Session object
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Sorting with MongoDB queries
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Filtering with MongoDB queries
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. Creating upsert MongoDB queries
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        7. Implementing a partial collection
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      12. 5. Implementing DDP
        1. Introduction
        2. Reading the DDP stream
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        3. Using client-only collections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Implementing multiserver DDP
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Integrating DDP with other technologies
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      13. 6. Mastering Reactivity
        1. Introduction
        2. Creating and consuming a reactive value
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        3. Using Ajax query results in ReactiveVar
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Making a custom library reactive
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Updating Blaze templates without Mongo
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        6. Using inline data to modify UI elements reactively
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        7. Integrating a jQuery UI
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
      14. 7. Using Client Methods
        1. Introduction
        2. Creating dynamic graphs with SVG and Ajax
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Using the HTML FileReader to upload images
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Creating a coloring book with the Canvas element
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      15. 8. Integrating Third-party Libraries
        1. Introduction
        2. Using npm packages directly
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Building graphs with D3.js
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Creating cutting-edge UIs with Polymer
          1. Getting ready
            1. Creating your app and folders
            2. Creating your files
            3. Configuring Bower and installing Polymer
            4. Adding helper Meteor packages
            5. Configuring Meteor
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      16. 9. Securing Your Application
        1. Introduction
        2. Basic safety – turning off autopublish
          1. Getting ready
            1. Project setup
            2. Creating a basic template
            3. Adding CSS styling
          2. How to do it...
          3. How it works...
          4. See also
        3. Basic safety – removing insecure
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Securing data transactions with allow and deny
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        5. Hiding data with façades
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Protecting the client with browser-policy
          1. Getting ready
            1. Scaffolding setup
            2. Add CDN-hosted bootstrap
            3. Add inline and eval() scripts
          2. How to do it...
          3. How it works...
          4. See also
      17. 10. Working with Accounts
        1. Introduction
        2. Implementing OAuth accounts packages
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        3. Customizing the accounts login
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        4. Performing two-factor authentication
          1. Getting ready
            1. Creating our baseline application
            2. Signing up for the Twilio SMS service
            3. Creating an SMS service on Twilio
            4. Installing the twilio-node npm package
            5. Creating and testing the sendTwilio() method
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
      18. 11. Leveraging Advanced Features
        1. Introduction
        2. Building custom server methods
          1. Getting ready
            1. Project setup
            2. Creating a simple app
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        3. Creating custom EJSON objects
          1. Getting ready
            1. Declaring the Swatch object
            2. Modifying Swatches.insert()
            3. Changing Swatch colors
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Handling asynchronous events
          1. Getting ready
            1. Creating a baseline Meteor app
            2. Obtaining your Twitter Access Tokens
            3. Initializing twit
            4. Creating the Tweets collection, and building a stream reader
            5. Tracking and testing changes
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Using asynchronous functions
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      19. 12. Creating Useful Projects
        1. Introduction
        2. Creating RESTful web services
          1. Getting ready
            1. Creating the baseline application
            2. Installing and configuring Postman
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
        3. Creating a complete app with Iron Router
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Deploying apps to mobile devices
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Adding social sharing
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      20. Index