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...