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

On the server


On the server-side, we have two files: index.js and insertData.js. There is also a private folder where we can define sample data that we can work with. Meteor will treat the private folder as an assets folder and will not bundle it with the rest of the execution code, which makes it a perfect place to have the test data.

In the private folder in file, products.json will have the following fields:

private/products.json

The fields of the Products collection are as follows:

id: This is the product ID.

title: This refers to a product title.

price: This is the price per unit.

inventory: This is the currently available product inventory in the store.

department: This refers to the department ID the product belongs to.

In the root of the application tree, we also have a shared folder where we can have modules used by both the client and the server.

In there, we define the two Collections that we will be using: Products and Cart:

export const ProductsCollection = new Mongo.Collection('products...