Giter VIP home page Giter VIP logo

service-integrations's Introduction

service-integrations

Note: Work in progress

A service for integrating Engage's public API with the Bullhorn API.

Setup

First you need to setup the config files, prepare the db and create the necessary bullhorn subscriptions

Config

Prepare the config file:

cp config.js.example config.js

and edit as needed.

Prepare the integration config file:

cp integration.json.example integration.json

get the API and user credentials from LP.

Run a local dynamo db

Fetch a downloadable version of DynamoDB and follow the instructions as described here.

An alternative way is to use docker:

docker run -p 8055:8000 amazon/dynamodb-local

Note that docker data will be wiped as soon as the container is stopped

Create the necessary tables:

aws --endpoint-url http://localhost:8055 dynamodb create-table \
    --table-name Integrations \
    --attribute-definitions \
        AttributeName=name,AttributeType=S \
    --key-schema \
        AttributeName=name,KeyType=HASH \
    --provisioned-throughput \
        ReadCapacityUnits=10,WriteCapacityUnits=10
aws --endpoint-url http://localhost:8055 dynamodb create-table \
    --table-name EntityUpdates \
    --attribute-definitions \
        AttributeName=entity,AttributeType=S \
        AttributeName=id,AttributeType=N \
    --key-schema \
        AttributeName=entity,KeyType=HASH \
        AttributeName=id,KeyType=RANGE \
    --provisioned-throughput \
        ReadCapacityUnits=10,WriteCapacityUnits=10

Ensure the two tables are there:

aws --endpoint-url http://localhost:8055 dynamodb list-tables

Add an integration config:

aws --endpoint-url http://localhost:8055 dynamodb put-item \
    --table-name Integrations \
    --item file://integration.json

Note: Adding a config with the same name will replace the existing one

Check pending updates in the datastore:

aws --endpoint-url http://localhost:8055 dynamodb scan \
     --table-name EntityUpdates \
     --filter-expression "entity = :entity" \
     --expression-attribute-values '{":entity":{"S":"plac:status:up"}}'

Setup subscriptions

Create the following subscription for modified Placements:

/event/subscription/placementUpdate?type=entity&names=Placement&eventTypes=UPDATED

Create the following subscription for created and modified JobSubmissionss:

/event/subscription/jobSubmissionUpdate?type=entity&names=JobSubmission&eventTypes=UPDATED,INSERTED

Create the following subscription for created Placements:

/event/subscription/placementInsert?type=entity&names=Placement&eventTypes=INSERTED

See http://bullhorn.github.io/rest-api-docs/#put-event-subscription

Running

Make sure bunyan is globally installed to get nice log messages:

npm i -g bunyan

Install nodemon to restart the server when a file is changed:

npm i -g nodemon

Run!

nodemon server.js | bunyan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.