A Quran skill for Alexa.
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.
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.
npm run build
This creates the following build artifacts:
build/release/
contains the transpiled skill files, with all required dependencies, and exposes a single functionindex.hander
.build/UTTERANCES.txt
contains Skill utterances as defined in themodel
directory (expanded and ready to upload to the Alexa console).
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:
- Package up your skill by running:
npm run package
- This creates
build/package.zip
containing the compiled skill, which can be uploaded directly to AWS Lambda. It exposes a single functionindex.hander
. Skill utterances defined in themodel
directory are expanded and output tobuild/UTTERANCES
. - Manually upload
package.zip
it to Lambda at: https://console.aws.amazon.com/lambda/home - 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 inbuild/UTTERANCES.txt
as well as the schema and custom slot data undermodel/**
.
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