Getting Started with Meteor.js JavaScript Framework

Getting Started with Meteor.js JavaScript Framework
eBook: $14.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $44.98    Print cover: $29.99
save 33%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Create dynamic, multi-user web applications completely in JavaScript
  • Use best practice design patterns including MVC, templates, and data synchronization
  • Create simple, effective user authentication including Facebook and Twitter integration
  • Learn the time-saving techniques of Meteor to code powerful, lightning-fast web apps in minutes

Book Details

Language : English
Paperback : 130 pages [ 235mm x 191mm ]
Release Date : December 2012
ISBN : 1782160825
ISBN 13 : 9781782160823
Author(s) : Isaac Strack
Topics and Technologies : All Books, Web Development, Open Source, Web Development

Table of Contents

Chapter 1: Setup and Installation
Chapter 2: Reactive Programming… It's Alive!
Chapter 3: Why Meteor Rocks!
Chapter 4: Templates
Chapter 5: Data, Meteor Style!
Chapter 6: Application and Folder Structure
Chapter 7: Packaging and Deploying
  • Chapter 1: Setup and Installation
    • Installing with curl
    • Loading an example application
      • Selecting your file location
      • Loading the example application
      • Starting the example application
      • Previewing the application
      • Help! I made too many changes!
    • Making code changes
      • Changing from todos to items
    • Summary
    • Chapter 2: Reactive Programming… It's Alive!
      • Creating the Lending Library
        • Creating the base application
        • Creating a collection
        • Fun with the browser console
        • Adding some data
        • Displaying collections in HTML
        • Cleaning up
      • Creating a reaction
      • Multiple clients
      • Summary
      • Chapter 3: Why Meteor Rocks!
        • Modern web applications
          • The origin of the web app (client/server)
          • The rise of the machines (MVC)
          • The browser grows up (MVVM)
        • A giant Meteor appears!
          • Cached and synchronized data (the model)
          • Templated HTML (the view)
          • Meteor's client code (the View-Model)
        • Let's create some templates
        • Summary
        • Chapter 4: Templates
          • A new HTML template
          • Gluing it all together
            • Our items View-Model
            • Additional view states
            • Adding events
            • Model updates
            • Style updates
          • Summary
          • Chapter 5: Data, Meteor Style!
            • Document-oriented storage
              • But why not use a relational database
              • MongoDB
              • Using direct commands
            • Broadcasting changes
              • Published events
            • Configuring publishers
              • Turning off autopublish
              • Listing categories
              • Listing items
              • Checking your streamlined data
            • Summary
            • Chapter 6: Application and Folder Structure
              • Client and server folders
                • Public folder
              • Security and accounts
                • Removing insecure
                • Adding an admin account
                • Granting admin permissions
              • Customizing results
                • Modifying Meteor.publish()
                • Adding owner privileges
                • Enabling multiple users
              • Summary
              • Chapter 7: Packaging and Deploying
                • Third-party packages
                  • Listing available packages
                • Bundling your application
                • Deploying to Meteor's servers
                  • Updating Meteor's servers
                  • Using your own hostname
                • Deploying to a custom server
                  • Server setup
                  • Deploying your bundle
                    • Optional – different platform
                  • Running your application
                • Summary

                Isaac Strack

                Isaac Strack, as a Design Technologist for Adobe Systems, actively researches, develops, and contributes to emerging device and Internet technologies, incorporating these new technologies into the Adobe Digital Media and Digital Marketing product lines. He is on the board of directors for the Wasatch Institute of Technology, a computer science high school located in Utah that is changing the face of education through an Agile-based teaching methodology, which emphasizes real-life technology skills and STEM education. Isaac worked for the Service Technologies group at eBay for over 11 years, where he was on the forefront of AJAX, .NET, and web-related technologies. While at eBay, he earned a web technology patent, and is one of the original developers of the Listing Violation Inspection System (LVIS), used to monitor and regulate auctions and member-to-member transactions. Isaac has a passion for technology and design, and conveys that passion through his contributions online and in his local community. Despite his experiences to the contrary, he's still naive enough to believe what Steve Jobs said, "If you have a good idea and a little moxie, you can change the world."
                Sorry, we don't have any reviews for this title yet.

                Code Downloads

                Download the code and support files for this book.

                Submit Errata

                Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                - 9 submitted: last submission 30 Jun 2014

                Errata type: Code | Page number: 20

                Under the heading "Adding some data", the console commands read:

                > lists.insert({Category:"DVDs", items: {Name:"Mission Impossible" ,Owner:"me",LentTo:"Alice"}});

                > lists.insert({Category:"Tools", items: {Name:"Linear Compression Wrench",Owner:"me",LentTo: "STEVE"}});

                They need to read:

                > lists.insert({Category:"DVDs", items: [{Name:"Mission Impossible" ,Owner:"me",LentTo:"Alice"}]});

                > lists.insert({Category:"Tools", items: [{Name:"Linear Compression Wrench",Owner:"me",LentTo: "STEVE"}]});

                (Added square brackets)


                Errata type: Others | Chapter number: 4 | Errata date: 18 Dec 08


                The code doesn't work on Mozilla Firefox 18.0.1 on Linux Mint Nadia 64 bit.
                It's ok on Chrome - same O.S.



                Errata type: Others | Chapter 5 - commands 4 & 5 | Errata date: 4-2-2013


                In Chapter 5 "Using Direct Commands", the following commands need to be  
                myLists = db.getCollection('lists')
                - CHANGE TO -
                myLists = db.getCollection('Lists')
                When the Collection was created in Chapter 2 - "Creating a collection", we  
                called the collection 'Lists':
                var lists = new Meteor.Collection("Lists");



                Errata type: Others | Page number: Kindle: 1693 of 2131 | Bug in the Chapter 6 source | Errata date: 12-2-2013


                You need to use Meteor.userId() instead of this.userId inside your template  
                event handler:
                if (catVal) {
                  /* lists.insert({Category:catVal,owner:this.userId});   BUG */
                  lists.insert({Category:catVal,owner:Meteor.userId()});  /* correct */
                  Session.set('adding_category', false);
                "this" is not defined in, so you are reading the  
                global "window.userId".  Somewhat by accident, this ends up partially working  
                if you just refresh the page.  The reason is because even though  
                window.userId does not exist on first page load, if you click "Refresh", the  
                Meteor code that tries to login using a login token stored in localStorage  
                (localstorage_token.js) makes a temporary global "var userId" that is set to  
                the most recent login userId.  So then your code is reading a valid and  
                current userId.
                The bug is most noticeable if you logout and login as someone else without  
                hitting Refresh.  In this case, the insert will be denied because the  
                "window.userId" is set to the previously logged in user, and not the  
                currently logged in Meteor.userId()



                Errata type: Others | Page number: 45 | Errata date: 14-2-2013


                The whole paragraph which begins with: One more thing to add..
                and the following code could be removed:
                    'focusout #add-category': function(e, t) {
                      Session.set('adding_category', false);



                Errata type: code | Page number: Chapter 2. Reactive Programming… It's Alive!, Creating a reaction | Errata date: 18 Dec 08


                lists.remove({Category:"Fraggles"}) does not work
                Error: Not permitted. Untrusted code may only remove documents by ID. [403]
                details: undefined
                error: 403
                errorType: "Meteor.Error"
                get stack: function () { [native code] }
                message: "Not permitted. Untrusted code may only remove documents by ID.  
                reason: "Not permitted. Untrusted code may only remove documents by ID."
                set stack: function () { [native code] }
                It works with the following command:
                The IDs at creation time are as follows:



                Errata type: Code| Page number: Chapter 2. Reactive Programming… It's Alive!, | Errata date: 18-4-2013


                In the example:
                var lists = new Meteor.Collection("Lists");
                should read instead
                lists = new Meteor.Collection("Lists");
                The reason is that "...Meteor 0.6 has added file-level JavaScript variable  
                scoping. Variables declared with var at the outermost level of a JavaScript  
                source file are now private to that file. Remove the var to share a value  
                between files."



                Errata type: Code| Page number: 100 | Errata date: 30-5-2013


                Section: Enabling multiple users
                The update and delete functions in lists.allow should be as follows:

                update: function(userId, doc, fields, modifier) {
                return (adminUser(userId) || (userId && doc.owner === userId));
                remove: function(userId, doc) {
                return (adminUser(userId) || (userId && doc.owner === userId));

                 The update and delete function receive a single document, not an array of documents.



                Errata type: Code| Page number: 61, 62, and 73

                The code line:
                if (!item_name && !list_id)
                should be:
                if (!item_name || !list_id)

                Sorry, there are currently no downloads available for this title.

                Frequently bought together

                Getting Started with Meteor.js JavaScript Framework +    Mastering Web Application Development with AngularJS =
                50% Off
                the second eBook
                Price for both: €24.85

                Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                What you will learn from this book

                • Leverage reactive programming and live HTML in modern web applications
                • Design and implement MongoDB/NoSQL databases
                • Develop fast, simple web interfaces with HTML templates (Handlebars)
                • Use design patterns effectively, including MVC/MVVM and Publisher-Subscriber
                • Use local and server synchronization to make apps more user-friendly
                • Structure an application for performance and security
                • Leverage and integrate user authentication systems (Facebook and Twitter)
                • Implement third-party packages and add-ons such as Bootstrap and jQuery
                • Deploy and administer Meteor applications

                In Detail

                Meteor is a brand new platform built entirely in JavaScript that allows you to build modern, dynamic web applications in the blink of an eye. With support for nearly every popular JavaScript framework (and more being added every day), Meteor provides you with the ability to quickly and easily develop sophisticated and stylish web applications.

                "Getting Started with Meteor" is an easy to follow, step-by-step approach to learning how to build modern web applications with Meteor. Through the development of a complete and ready-to-use application, you will experience exactly how easy and fast it can be to develop robust, flexible web applications, so you can build your own “killer” app in no time.

                "Getting Started with Meteor" will walk you step-by-step through all the major advantages that Meteor has to offer. You’ll be up and running in less than two minutes, and will develop an actual application you can use. As you move quickly through the exercises, you’ll be able to experience first-hand how easy it is to develop in Meteor, and will gain invaluable best practices you can apply immediately to your coding projects.

                You will learn about reactive programming and how Meteor takes advantage of the latest web technologies. You will gain a solid understanding of what  the best design patterns are for developing web apps, and when to use them. You will learn how Meteor uses HTML templates and NoSQL (document-based) databases together to make coding applications simple and fun. Finally, you’ll gain best practices for security and performance, making your web applications fast, secure, and easy to use. If you want to build a web application but hate how difficult it seems to be, this book will show you the easy way to build and deploy modern web apps.

                This book will teach you everything you need to know to get up and running with Meteor, and start you on your way to becoming an expert web applications developer.


                Written in an engaging, easy-to-follow style, "Getting Started with Meteor" is a practical guide for developing modern web applications with Meteor.

                Who this book is for

                This book is for developers or students who have a working knowledge of JavaScript and HTML, and want to learn how to quickly develop web applications using pure JavaScript. A basic understanding of traditional web server development and database methodologies will be helpful, but not necessary. Readers are expected to know how to program basic HTML pages and JavaScript functions, and be familiar with Terminal (basic Shell) commands.

                Code Download and Errata
                Packt Anytime, Anywhere
                Register Books
                Print Upgrades
                eBook Downloads
                Video Support
                Contact Us
                Awards Voting Nominations Previous Winners
                Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software