speech-service

2.0.0 • Public • Published
Master Develop Code Climate Test Coverage
Build Status Build Status Maintainability Test Coverage

Speech Service

Alexa and Google Assistant speech processing service.

Setup

This project depends on node 8.12.0

  1. Create a .npmrc file and add your secret NPM registry key as so: //registry.npmjs.org/:_authToken=<your-token-here>
  2. Run npm i
  3. Add a .env file to the root of your directory. You will need:
    DIALOGFLOW_KEY=""
    

Project Structure

We use a MVVM architecture, however instead of ViewModels, we use SpeechModels. Be sure to package your classes by Domain -- see the /domain folder for examples. All classes belong in the /model folder, and all services belong in the /services folder.

The /test folder contains unit tests and mock data used for testing.

Environments

We host 2 skills based on environment: WW (PROD | Master) & WW Alpha (QAT2 | Develop).

Alexa

Quick start guide for Alexa: https://developer.amazon.com/docs/devconsole/about-the-developer-console.html

See Alexa SDK documentation for node.js: https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs

WW (PROD):
https://developer.amazon.com/alexa/console/ask/build/amzn1.ask.skill.759c1075-911b-41c1-a160-2116d3737e64/development/en_US

WW Alpha (QAT2):
https://developer.amazon.com/alexa/console/ask/build/custom/amzn1.ask.skill.16a8e5ef-78fb-4f90-b62c-860b53468f8b/development/en_US/dashboard

Google Assistant

Quick start guide for DialogFlow: https://dialogflow.com/docs/getting-started

See Google's DialogFlow SDK for node JS: https://github.com/dialogflow/dialogflow-nodejs-client-v2

WW (PROD):
https://console.dialogflow.com/api-client/#/agent/a8d809bb-7bf7-4b17-b480-78cdf7d0781a/intents

WW Alpha (QAT2):
https://console.dialogflow.com/api-client/#/agent/35e11392-4702-4af5-85a4-a9ea4260c3d0/intents

Deployments

Deployments are managed via WW's trigger system using docker containers.

Process

Travis CI will test and build all commits into Develop and Master. Develop branches are designated to be deployed into QAT2, while Master are designated for PROD. At the end of every sprint, Develop is cut into Master. Upon sign off, Trigger is used to deploy PROD.

Both QAT2 and PROD environments use API url routing via Ingress. Upon every release, we alternate deployments to either v1 or v2. Each version points to a different docker container.

Alexa & Assistant Consoles

Both Alexa & Google Actions need to be submitted for approval in order to release new intents. Upon submission, the fulfillment endpoint is locked in place, which is why we must support multiple docker versions at the same time.

Trigger

Once your docker container has been pushed:

  1. Deploy your keys (config.env.json) to IDB trigger-oidc-curl -s -XPOST -d@config.qat2.json https://idb.wwiops.io/v1/configs
  2. Deploy trigger script: trigger-oidc-curl -k -XPOST -d”@trigger.qat2.json" https://trigger.wwiops.io/betav1/speechnonprod/speech-service/qat2/us-east-1.aws
  3. To check the status of a deployment: triggerctl status —product speech-service --environment qat2 --group speechnonprod

Running locally, Tests & Lint

Docker

Running locally:

  1. Start your server by npm start
Tests

To run all tests: npm test

To run coverage (istanbul/nyc) test with report (results will be in coverage/nyc folder): npm run coverage

To generate test results report with mochawesome (results will be in coverage/mochawesome folder): npm run report

To run lint checks: npm run lint

Readme

Keywords

none

Package Sidebar

Install

npm i speech-service

Weekly Downloads

1

Version

2.0.0

License

none

Unpacked Size

1.34 MB

Total Files

173

Last publish

Collaborators

  • pcdroidski