Creating a Sift

In this tutorial, we'll be creating a basic Sift that imports emails from Gmail, does some simple processing on them and renders them to the web interface. It's a pretty artificial example, but it will exercise all the important features of Red Sift without having to create a large application.

The SDK comes with a generator script that automatically creates the scaffolding of a simple Sift for you. To create your first Sift, open a terminal and navigate to the location where you want your Sift folder to be created and run:

redsift create example-sift

You'll have several options of what kind of Sift to create. Select minimal-sift.
If you select email-sift, it will create a complete ready to run sift for email, but for tutorial purposes, we're going to construct one from scratch.

You can just hit return to take the default values for the other Sift properties.


File Structure

You should now have a folder called example-sift with some example code in it.

  • sift.json
  • frontend/

    javascript + html files for web user interface code

  • server/

    Sift node code

  • sdk_tmp/

    used by the SDK

We'll look at the details of the file structure as we go along.

Next, let's run it.


OS X and Docker

In OS X systems, Docker can’t mount directories outside the /User/ directory. So it is necessary that the Sift directory is located under your user directory. Otherwise we will be unable to mount it into the Docker container.