Mastering MeteorJS Application Development
Table of Contents
Mastering MeteorJS Application Development
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Building a MeteorJS Web Application
An overview of MeteorJS
Server
MongoDB
Publish/Subscribe
Communication channel
Client
MiniMongo
Tracker
Blaze
Additional information
Developing a bus reservation application
Accounts
Signup
Signin
Creating a bus service
List and search
Reservation
Summary
2. Developing and Testing an Advanced Application
Scaffolding in MeteorJS
Recreating the travel booking application
The app directory
Client
lib
Private and public packages
Server
Generators for the application
Creating travel
Listing and search
Reservation
Debugging
Meteor shell
Testing MeteorJS application
Velocity
Testing BookMyTravel2
Summary
3. Developing Reusable Packages
Introduction to packages
An installed package
Creating a package
Package.describe
Package.onUse
Package.onTest
The bucket package
Collection
Templates
Using the package
Testing the package
Distributing a package
Summary
4. Integrating Your Favorite Frameworks
The server-side setup ā FoodMenu
Collection
Publish
Access rules
Methods
The client-side setup ā FoodMenu
Client packages
Application styles
The Angular.js application
The header section
The application container section
Angular.js routes
The CreateItem controller
Uploading images
The CollectionFS collection
Access rules
Publish images
The AddItem Angular.js template
Demystifying the logic
Listing food items
Route
Controller
Template
Editing food items
Route
The EditItem controller
Demystifying controller logic
React.js with MeteorJS
ReactFoodMenu
Setup
Server
Client
Client packages
The first React.js component
The header section
The React.js component in Blaze
The container section
The application route
Route ā AddItem
The AddEditItem component
The initial state
Component handlers
React.js markups
The listing section
The listing route
The list component
The edit items route
Edit patch
d3.js with MeteorJS
DataViz
HTML
Server
Client ā d3.js code
Integrating any frontend framework with MeteorJS
Summary
5. Captivating Your Users with Animation
Animation in Blaze templates
Animation using MeteorJS packages with Velocity.js
Animation using Snap.svg
Animation using d3.js
Animation using the Famo.us engine
Summary
6. Reactive Systems and REST-Based Systems
An overview of MeteorJS' reactivity
MeteorJS' reactivity
Tracker
Optimizations in autoruns
REST-based systems
REST with iron-router
API guidelines
REST with restivus
Handling volumes of data
Summary
7. Deploying and Scaling MeteorJS Applications
Understanding MeteorJS application deployment
Build tools for MeteorJS applications
Isobuild
Demeteorizer
Deploying a MeteorJS application
Meteor Up
Meteor deployment manager
Scaling a MeteorJS application
Scaling with Nginx
Scaling with Meteor cluster
Balancers
The multicore support
The SSL support
Mup and Cluster
The oplog tailing setup
Creating a replica set
Accessing the oplog from an application
Third-party MeteorJS hosting solutions
Meteor Galaxy
Modulus.io
Digital Ocean
Database solutions
Summary
8. Mobile Application Development
Getting started
Developing a simple mobile application
The login interface
The profile interface
The contacts interface
The messages interface
Builds and deploying
Hot code push
More about the mobile app development
Accessing plugin methods
Debugging
Debugging Android
Debugging iOS
Testing
Packages
The package development
Summary
9. Best Practices, Patterns, and SEO
Summarizing the concepts
Publishing/subscribing
DDP
MergeBox
MiniMongo
Data retrieval from Mongo
Session
Sticky session
Fibers
Trackers
Blaze
Packages
Build tools
Best practices
Securing database operations
Database indexing
oplog tailing
Error handling
Testing
Managing subscriptions
Publish/subscribe only the necessary data
Application directory structure
Serving static assets
Application namespacing
Transformation classes
Latency compensation
Identifying performance and scalability issues
Application patterns
The package pattern
Problems with the usual way of writing MeteorJS code
What we must know about packages
DigiNotes
MVC
SEO
Spiderable
ES2015 and MeteorJS
Meet the community
Summary
Index
Mastering MeteorJS Application Development
Copyright Ā© 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2015
Production reference: 1181215
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-237-9
www.packtpub.com
Author
Jebin B V
Reviewer
Ethan EscareƱo Rosano
Commissioning Editor
Veena Pagare
Acquisition Editor
Indrajit Das
Content Development Editor
Preeti Singh
Technical Editor
Saurabh Malhotra
Copy Editor
Trishya Hajare
Project Coordinator
Shweta H Birwatkar
Proofreader
Safis Editing
Indexer
Hemangini Bari
Production Coordinator
Shantanu N. Zagade
Cover Work
Shantanu N. Zagade
Jebin B V is fond of JavaScript and anything related to JavaScript excites him. He is a front-end developer who has experience of full-stack development and also with stacks such as LAMP. Right from the beginning of his career, he has worked as a founding engineer for various startups.
Initially, he started his career as a PHP developer where he developed Web applications using PHP and its frameworks such as YII, Zend, Symphony, and WordPress. Later, he saw the growing potential of JavaScript and decided to be a JavaScript developer. He self-taught JavaScript and its concepts, with which he moved to work as a full-time JavaScript developer for a revolutionary big data product called DataRPM. When he was a part of DataRPM, he developed a significant part of the product that helped the product to grow rapidly.
At DataRPM, he nourished himself to be a challengeable JavaScript developer who can build a whole product all alone. In a short period, he learned and mastered JavaScript's quirks and solved many problems to scale the product. With JavaScript, he also learned how to design modules using proper design patterns, structuring the codebase, and maintaining the code discipline.
Along with development, he loves to teach. He always strives to share knowledge. Whenever he finds a solution to a peculiar problem, he calls up the team to let them know how he solved it. Not a single day of his life goes by without reading, and the major part of his reading is about JavaScript and its ecosystem. The routine of his professional life is reading about code, writing code, and teaching to code better.
Carrying all these experiences, he moved to another startup where he built, all alone, the web version of the instant messaging application, Avaamo. The web version was developed and launched in less than three months, which is now consumed by all premium users, and there are also quite a few firms who run their businesses in Avaamo Web.
Other than JavaScript, the only other thing he is very passionate about is bodybuilding. He does weight training and calisthenics on his preferable schedules. He is very concerned about pollution and thus he commutes by bicycle to work every day. He has a very good sense of innovati...