Skip to content

Alexa skill for the Meezan app, written in ES7 and transpiled to ES5 via babel

License

Notifications You must be signed in to change notification settings

tjaffri/alexa-skill-meezan

Repository files navigation

Build Status Coverage Status Dependency Status

A Quran skill for Alexa.

Example phrases

Alexa, ask Meezan how many verses are in Surah Fatiha
Alexa, ask Meezan to recite chapter 1, verse 5 of the Holy Quran
Alexa, ask Meezan how many chapters are in the Quran

See model/UTTERANCES for more example phrases.

Development

Test Automation

Test automation for this skill requires credentials for a test account that the MeezanApi will accept. By default the API is configured to be http://meezanapi.azurewebsites.net but you can change this to a different URI and provide test account credentials that will be accepted at your API.

The following test account credentials are read from environment variables. For convenience you may want to create a file called tools/.env-auth0.sh with the test account credentials so you can set these during development (the CI server sets these values in the build environment to run CI tests successfully)

#!/bin/sh

AUTH0_ACCESS_TOKEN_URI=https://[YOUR NAME SPACE ON AUTH0].auth0.com/oauth/token
AUTH0_CLIENT_ID=[YOUR CLIENT ID]
AUTH0_CLIENT_SECRET=[YOUR CLIENT SECRET]
TEST_ACCOUNT_REFRESH_TOKEN=[REFRESH TOKEN FOR A TEST ACCOUNT]

export AUTH0_ACCESS_TOKEN_URI
export AUTH0_CLIENT_ID
export AUTH0_CLIENT_SECRET
export TEST_ACCOUNT_REFRESH_TOKEN

Once the environment is set up you can run the following command to run the tests locally.

npm test

Note: You may wish to follow the discussion here to configure your auth0 environment.

Building

npm run build

This creates the following build artifacts:

  1. build/release/ contains the transpiled skill files, with all required dependencies, and exposes a single function index.hander.
  2. build/UTTERANCES.txt contains Skill utterances as defined in the model directory (expanded and ready to upload to the Alexa console).

Deploy

This repository is set to deploy automatically to AWS lambda, via Travis CI. Any commits to master will get automatically built, tested and deployed.

However, if you want to deploy manually for any reason, you have two options:

Manual Deployment in the Developer Console

  1. Package up your skill by running:
npm run package
  1. This creates build/package.zip containing the compiled skill, which can be uploaded directly to AWS Lambda. It exposes a single function index.hander. Skill utterances defined in the model directory are expanded and output to build/UTTERANCES.
  2. Manually upload package.zip it to Lambda at: https://console.aws.amazon.com/lambda/home
  3. If you have changed any files in model/** at all, you need to go to https://developer.amazon.com/edw/home.html and update the Interaction model for the Alexa Skill. You can use the expanded utterances in build/UTTERANCES.txt as well as the schema and custom slot data under model/**.

Manual Deployment via Local Deployment Script

If you configure the project with AWS credentials under config/lambda.config.js then you can build, test, package and deploy the project with a single command. You can then configure the deployed skill in the AWS console.

npm run deploy

About

Alexa skill for the Meezan app, written in ES7 and transpiled to ES5 via babel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published