This chapter took us through the process of creating a full-stack application using MeteorJS. We learned about some of the following topics in this chapter.

Collection schema

In this chapter, we learned that a schema is used to enforce data uniformity in the collection. MongoDB, which is the default database used by Meteor, doesn’t enforce data uniformity. To ensure that data inside our collections conforms to a certain type, we install the SimpleSchema package into our project.

The package is installed by typing the following in the terminal:

meteor npm install simpl-schema
meteor add aldeed:collection

Normalization and denormalization of data

We learned about the normalization and denormalization of data in a database and how data should be saved in a manner that makes retrieval easy. Normalization is usually favored by SQL databases in which data is split and put into different tables to prevent the duplication of data. Denormalization puts all the entities that describe a model inside of a collection. Denormalization leads to the duplication of data, but it’s a paradigm favored by NoSQL databases like MongoDB.

Meteor authentication

Meteor comes out of the box with an authentication system. This authentication system isn’t installed by default. We need to explicitly install it to be able to use it in our project.

We learned that, to make use of Meteor accounts package, we need to install it by typing the following in the terminal:

meteor add accounts-password

We also learned that Meteor creates a collection called users that manages authenticated user data.

Review on calling third-party API

In this chapter, we also learned how to call a third-party API. We learned that we gain the ability to perform API calls using the fetch package that’s installed through the terminal by typing this:

  meteor add fetch

The fetch package can be called both on the server and the client. Its usage is similar to the browser’s Fetch API.

Stripe integration

We learned how to integrate Stripe into a Meteor application. We learned how Stripe’s client secret is generated when a user wants to make a payment on our application. We learned how to use the Stripe SDK and library, which are provided to simplify the task of integrating our application with Stripe.

Data aggregation

We learned that we’ll need to install a package to be able to use the aggregation framework available in MongoDB. This package is installed through the terminal by typing the following:

meteor add sakulstra: aggregate

The aggregation framework performs data aggregation such as grouping, filtration, data summation, and so forth. The data is passed through a pipeline and, at each stage in the pipeline, an operation is performed on the data.

Get hands-on with 1400+ tech skills courses.