Sample App

Please contact NuraLogix to get access to the WMS sample application which demonstrates the call-in / callback functionality of Web Measurement Service (WMS)

The sample app consists of a backend component that obtains an authorization token and a refresh token from DeepAffex API and a frontend component which uses a simple UI to collect user information, calls in to WMS and displays the returned results using a simple UI.

Build and testing the sample app

Running for Testing & Development

Note: Please use yarn to install dependencies as npm causes some dependency issues.

Please edit the .env file to reflect the correct configuration values before running the sample app.

PropertyDescription
PUBLIC_URLPopulate only if the app will be run from a sub-path, example: /subpath otherwise leave blank
LICENSE_KEYDeepAffex API license (obtain from https://dashboard.deepaffex.ai/)
API_URLURL of the DeepAffex API (usually https://api.deepaffex.ai/)
APP_NAMEApplication name used for reporting purposes only (e.g., if more than one app will be calling Web Measurement Service)
APP_IDENTIFIERApplication ID used for reporting purposes only (e.g., if more than one app will be calling Web Measurement Service)
CONFIG_IDAs discussed above, an identifier for the your specific app configuration

Steps

# install dependencies
yarn

# build the client
yarn build:client

# build the server
yarn build:server

# run the app
yarn serve:dev

Sample app details

The sample app consists of a server component and a client component. The server component acts as a back-end for providing REST endpoints for saving the config ID and for generating DeepAffex tokens. It is also responsible for serving pre-built static assets. The client component acts as a front end for hosting the user profile form, making REST API calls to the back-end component and for hosting the results page.

Endpoints used by the client component to communicate with the server component in the sample app

/health

Used to check the health of the backend, required for deployment checks

/api/configId

Returns the application specific configuration ID, this is a fixed value provided by Nuralogix.

/api/token

Returns a DeepAffex authorization token and a refresh token, those tokens are then passed to WMS for DeepAffex licensing.

/api/status

Can be used in the deployment to check if the application is up and running.

Endpoints used by the server component in the sample app to communicate with the DeepAffex API

/organizations/licenses

Used to get a device token and a refresh token from the DeepAffex API. Those tokens are then passed to the front-end which passes it to WMS for DeepAffex licensing.

/organizations 

Retrieves information related to the current organization.