Book Image

Build Applications with Meteor

Book Image

Build Applications with Meteor

Overview of this book

This book starts with the basic installation and overview of the main components in Meteor. You’ll get hands-on multiple versatile applications covering a wide range of topics from adding a front-end views with the hottest rendering technology React to implementing a microservices oriented architecture.All the code is written with ES6/7 which is the latest significantly improved JavaScript language. We’ll also look at real-time data streaming, server to server data exchange, responsive styles on the front-end, full-text search functionality, and integration of many third-party libraries and APIs using npm. By the end of the book, you’ll have the skills to quickly prototype and even launch your next app idea in a matter of days.
Table of Contents (16 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
8
Build a Chatbot with Facebook’s Messenger Platform

Adding router to the application


In our sample data, we have specified two departments: music and books. Currently, our App parent component renders the products and the cart into a single page.

In Single Page Applications (SPA), most of the time we want to give the user the best user experience by separating parts of the app into pages. The advantages of client site routing are that the user can navigate through different URLs without loading and reloading/refreshing the pages. This great user experience comes with a price. One of the challenges for client routing is the amount of code that the application initially needs to load for all pages. This problem can be solved by splitting the code by pages/routes and lazy loading only those parts of the code for the pages that a user visits.

For this example, we'll use the react-router library to manage the client-side routing:

In total, we have six pages:

  • Home: The main page that will contain links (navigation) to the Products and Cart pages.
  • Products...