Book Image

Mastering MeteorJS Application Development

By : Arturas Lebedevas, Jebin BV
Book Image

Mastering MeteorJS Application Development

By: Arturas Lebedevas, Jebin BV

Overview of this book

The web is dead – applications now rule our online experiences. But how are you going to build them? Well, if you’ve been paying attention, you might already have tried your hand with MeteorJS, the JavaScript framework that helps you build complete full-stack web applications that are responsive and fast with ease. Mastering MeteorJS Application Development shows you how to do even more with MeteorJS – if you’re ready to try a comprehensive course through one of the most exciting frameworks in web development today, this is the book you need. Designed to take you through the entire process of building an advanced multipage application with Meteor, you’ll be able to bring your web development ideas with surprising ease. You’ll not only learn how Meteor makes web development easier, but also how you can make using Meteor easier, by automating and simplifying tasks so you can be confident you have full control of everything in your workflow – especially everything that could go wrong. From automated testing to integrating other useful frameworks such as Angular and D3, each chapter covers a crucial element in the Meteor development process. Discover how to integrate animations using Meteor’s Blaze, to give your UI designs the edge, and explore reactive programming to effectively harness RESTful systems in your projects. You will also learn how to deploy and scale your application, two crucial aspects of modern development and vital in a changing digital environment with users expecting a product and experience that delivers. With further insights on developing for mobile – and how Meteor can help you tackle the challenges of the trend – and details on incorporating SEO strategies into your application, this book isn’t just a code tutorial – it’s about creating a product that users love.
Table of Contents (16 chapters)
Mastering MeteorJS Application Development
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Preface

Web is inevitably one of the core reasons for the advancements that we experience today almost everywhere. Though the development of Web and its content has been happening for quite a long period of time, the current decade is very significant, especially for JavaScript. When people started writing JavaScript in servers, the language became truly universal. Apart from Web, JavaScript has found its way into IoT devices too, which is considered to be the most opportune.

The potential and traction of JavaScript has brought countless developers into developing JavaScript-based applications, frameworks, and utilities. Even after evolving so much, JavaScript application development is deficient in certain areas. Developers are spending time on doing repetitive tasks, such as data fetching, wiring them to views, posting data back to servers to persist, and so on. Moreover, it is required to speed up the data transfer that is slow in the case of HTTP and HTTPS. Keeping all these traditional problems in mind, a bunch of developers developed a solution called MeteorJS.

MeteorJS provides most of the things that a developer would have to do repetitively, out of the box. The developers need to concentrate mostly on business logic rather than spending time on the basic data fetch and transfers, optimizations for network latency, syncing of data across devices, and reactivity.

There are already plenty of developers and organizations using MeteorJS in production. Many are experimenting with MeteorJS to make it the de facto framework for their future work. This book is written with the intention to guide those who are experimenting with MeteorJS to develop their future applications.

The best part of the book is that it doesn't just cover Web application development. It helps to write maintainable MeteorJS applications and deploy them to production. In short, the book aims at guiding the developers to develop production-ready, mobile-compatible, and horizontally scalable MeteorJS applications.

What this book covers

Chapter 1, Building a MeteorJS Web Application, provides an introduction to developing a Web application using MeteorJS. Readers will develop a multipage, multilayout application in this chapter, which gives enough insight about MeteorJS components and routes.

Chapter 2, Developing and Testing an Advanced Application, helps you rebuild the same application as in the previous chapter, but using a generator and other advanced packages to ensure the app is of good quality. Every possible way of debugging the entire application and testing the code is discussed in this chapter.

Chapter 3, Developing Reusable Packages, shows that packages are very important blocks for any MeteorJS app. This chapter shows the reader, with a typical example, how to develop and test custom packages and also provides the steps to distribute them for community use.

Chapter 4, Integrating Your Favorite Frameworks, guides the readers to use Angular.js and React.js with MeteorJS. MeteorJS has its own view layer managed by Blaze. However, many developers want to use their favorite frontend framework instead of Blaze. How powerfully d3.js can be used with MeteorJS is demonstrated with examples in this chapter.

Chapter 5, Captivating Your Users with Animation, shows how animations improve the user experience to a great extent. With all the in-built reactivity of MeteorJS views, many developers struggle to find ways to incorporate animations. This chapter walks you through creating soothing animations with a lot of examples.

Chapter 6, Reactive Systems and REST-Based Systems, helps us understand the reactivity of MeteorJS to its depths and the precautions needed to handle reactivity. Also, this chapter discusses how to use MeteorJS as a REST-based system for consuming API.

Chapter 7, Deploying and Scaling MeteorJS Applications, teaches you to deploy, monitor, and scale MeteorJS applications, as MeteorJS is not so familiar in terms of deployment.

Chapter 8, Mobile Application Development, helps you understand that one of the most important features of MeteorJS is to write once and build for multiple platforms. Developers can write code that can be ported as a mobile application in MeteorJS. This chapter will guide you to develop an app for a mobile using MeteorJS.

Chapter 9, Best Practices, Patterns, and SEO, discusses various best practices to design, develop, and maintain MeteorJS applications, and also the best patterns to follow in order to organize the code and structure modules. This chapter also guides you to make the application search engine friendly to improve the sites ranking. With this chapter, readers will get to know where to find anything related to MeteorJS.

What you need for this book

You will need the following things to understand the content of this book:

  • Node.js

  • NPM

  • MeteorJS

  • iron-cli

  • MeteorJS hosting platform

  • Cordova, iOS, and Android devices

Who this book is for

This book is for developers who want to develop MeteorJS applications in a mature and maintainable way. The readers are expected to know the basics of MeteorJS such as the core principles, templates, server and client code positioning, and basic directory structuring. A little knowledge about querying MongoDB will help very much to understand data fetching from MongoDB. It is assumed that the reader has developed small example applications with MeteorJS.

Conventions

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: "Create the bookTravel directory in the client and add bookTravel.html."

A block of code is set as follows:

  data: function() {
    templateData = {
      _id: this.params._id,
      bus: BusServices.findOne({_id: this.params._id}),
      reservations: Reservations.find({bus: this.params._id}).fetch(),
      blockedSeats: BlockedSeats.find({bus: this.params._id}).fetch()
    };
    return templateData;
  }

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

Router.route("/book/:_id", {
  name: "book",
  layoutTemplate: "createTravelLayout",
  template: "bookTravel",
  waitOn: function () {
    Meteor.subscribe("BlockedSeats", this.params._id);
    Meteor.subscribe("Reservations", this.params._id);
  },

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

iron add velocity:html-reporter

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: "Click on the Cart division in the top-right."

Note

Warnings or important notes appear in a box like this.

Tip

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 www.packtpub.com/authors.

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 http://www.packtpub.com for all the Packt Publishing books you have purchased. 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.

Errata

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 http://www.packtpub.com/submit-errata, 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 https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

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.

Questions

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.