Building the IFTTT rules engine

Now that we are sending the required data to the API engine, we will be doing two things:

  1. Showing data that we got from the smart wearable on the web, desktop, and mobile apps
  2. Executing rules on top of the data

We will get started with the second objective first. We will be building a rules engine to execute rules based on the data we have received.

Let's get started by creating a folder named ifttt at the root of the api-engine/server folder. Inside the ifttt folder, create a file named rules.json. Update api-engine/server/ifttt/rules.json, as follows:

[{ "device": "b8:27:eb:39:92:0d", "rules": [ { "if": { "prop": "fall", "cond": "eq", "valu": 1 }, "then": { "action": "EMAIL", "to": "arvind.ravulavaru@gmail.com" ...

Get Practical Internet of Things with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.