In this tutorials, we'll be creating a basic Sift that imports emails from GMail does some simple processing on them and renders to the web interface. It's a pretty artificial example, but it will exercise all the important features of RedSift 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 which 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.
You should now have a folder called "example-sift" with some example code in it.
The top level folders are
sdk_tmp, which is used by the SDK, and
server, which is where your Sift node code will reside. At the top level is also the sift.json file, which holds the main configuration for the Sift and where we'll be doing most of the work initially.
We'll look at the details of the file structure as we go alone.
Next, let's run it.
OS X and Docker
In OS X systems, Docker can’t mount directories outside the /User/<username> 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.