How to Set Up a New Project

Before You Start

Before you start, make sure you've done the following:

  • Installed the latest version of Doohickey CLI
  • Installed Open Integration Hub (OIH)
  • Gathered the OIH service URLs for the following:
    • Audit Log
    • Component Repository
    • Flow Repository
    • IAM Service
    • Secret Service
    • Webhook Service

Step-by-Step Guide

Step 1: Create project directory

To begin your new integration project, create a new directory that will house all of your Doohickey files. In your terminal, run the following commands:

mkdir my-integration-project
cd my-integration-project

Step 2: Run Doohickey Init Command

After you have created and entered into your new project directory, run the following command, replacing OIH_ALIAS with the alias you will use for this OIH environment, ex. "dev", "stage", etc.

doohickey init OIH_ALIAS

Step 3: Respond to Command Prompts

The doohickey init command will prompt you for the service URLs you gathered previously.

The first log you should see from doohickey init is this:

 ›   Warning: No .doohickey.json located in current working directory. Ensure you are located in the correct project directory.
 ›   /Users/testuser/my-integration-project
Missing .doohickey.json has been created.

Since we have not run a doohickey command in this folder previously, the CLI warns us that it didn't locate a .doohickey.json file and created one. It is possible to mistakenly run doohickey in an incorrect folder location, so if this warning comes up unexpectedly, double check the directory that is returned.

Following that log, the CLI will prompt you for the service URLs you gathered previously. Instead of passing them in manually, you do have the option of providing them via flags in your initial doohickey init command. To review the flags, see the Doohickey Init documentation.

? What is the base URL for the myexample Open Integration Hub audit log service?
? What is the base URL for the myexample Open Integration Hub component repository?
? What is the base URL for the myexample Open Integration Hub flow repository?
? What is the base URL for the myexample Open Integration Hub IAM service?
? What is the base URL for the myexample Open Integration Hub secret service?
? What is the base URL for the myexample Open Integration Hub webhook service?

Step 4: Review Created Files

Once you have provided doohickey init with the necessary service URLs, it will save them for future use. Doohickey will then also generate a boilerplate integration project with some recommended files.

✔ Checking for existing package.json...
✔ package.json written successfully
✔ Checking for existing transformation.yaml
✔ transformation.yaml written successfully
✔ Checking for existing .gitignore...
✔ .gitignore written successfully
✔ Checking for existing README.md
✔ README.md written successfully
✔ JavaScript folder and file successfully created
✔ JSON folder and file successfully created
✔ JSONata folder and file successfully created
✔ Sample template successfully created
✔ Dependencies installed
Your integration project has been initialized. Please see the generated README file for helpful tips.

Package.json

A package.json file is generated, containing the Doohickey Types NPM package. This package is useful when creating your templates.

If your directory already contains a package.json, Doohickey will add the doohickey-types package to your devDependencies.

Transformation.yaml

A transformation.yaml file is generated which contains a sample transformation that can be used to experiment with the Doohickey VSCode Extension.

If your directory already contains a transformation.yaml, Doohickey will skip this step.

Git Ignore

A .gitignore file is generated containing the files and folders we recommend to exclude from your source control.

If your directory already contains a .gitignore, Doohickey will append these files and folders to the existing file.

README

A README.md is generated containing helpful tips for the integration project that was generated.

If your directory already contains a README.md, Doohickey will skip this step.

Templates

A templates folder is created to house all of your future integration templates.

Within the templates folder, a subfolder sample is created. The sample directory contains the following files and folders.

sample.js

The sample.js file is an example template that can be deployed to both Doohickey Cloud as a new template version and to OIH as a flow instance. This template utilizes the doohickey-types NPM package and provides examples on how to use it.

This sample template also utilizes the built in Node.js require() function to include external JavaScript, JSONata, JSON or Graphql files. In order to be included properly the names of the included files must end in one of the following:

  • .raw.js
  • .raw.jsonata
  • .raw.json
  • .raw.gql
js/

The js folder contains a sample JavaScript file, js/sample.raw.js, that can be used with OIH.

JSON and JSONata

The JSON and JSONata folders contain a sample JSON and JSONata file that can be used with the Doohickey VSCode Extension. The transformation.yaml that was automatically generated is connected to reference these two files and is ready to be previewed.

What Next?

Now that you've created your integration project, you are ready to start connecting to your OIH environment. Once you are connected, you are able to manage tenants, components, flows, secrets, and more.

See Also