Here is an example of a Node.js application using craft ai realized as a support for the Hackathon e-Résident.
As there are no real-time data available for the purpose of this hachaton, the application deals with simulated time.
- Log in to GitHub and fork the starterkit project,
- Go to the craft ai workbench,
- Sign up (or log in if you already signed up) with your GitHub account,
- Click on the
Add projects...
button and select thehackathon-e-resident-starterkit
, - Clone your GitHub fork of the project on your computer,
- Install Node.js on your computer,
- Install dependencies by running
npm install
in a terminal from the directory where you cloned the project
- From the craft ai workbench, edit the project (
pencil
button) and open thecraft_project.json
file to access your application credentials, - Run the application by running
npm start
in a teminal and fill in the form.
This starter kit contains some example of calls to the Intent API wrapped into craft ai actions. These actions handles the authentication to the API. Feel free to use them as examples to make your own custom actions!
There is a single behavior tree used in this starter kit, and it is quite simple. What it does is:
- retrieving a list of streams associated to a given part,
- logging the data for one of those streams at certain times,
- displaying an alert whenever the value crosses a threshold.
Technical questions can be sent through the chat widget of the craft ai workbench or by email at [email protected].