The application is used to bind devices to users in Amazon Cognito User Pools. It is built by AWS Amplify. The following is the architect:
The process involves two steps. The first step is the binding between the device and the user, and the second step is for Device Cloud to sends users’ device information back to Alexa when it receives ‘Alexa.Discovery’ command. Let’s understand the steps one by one.
When bind a device to a user, it will invoke the API and create an record in DynamoDB.
For a physical device, a serial number is usually being used as an uniquely identify a device. In this proposal, the serial number has been encoded into a QR code together with a link to a web page. Customers simply need to scan the QR code to bind the devices. In real word, the QR Code could be packed inside the device.
The following flow chart describes a proposed design of how to bind physical device to users.
The Alexa does not have any requirement for creating the relationship between devices and users. You can always design your own work flow.
Once the Alexa backend server receives the Alexa.Discovery, the server can retrieve device information from the database and return to Alexa.
You could choose either to Deploy this to Amplify console or to develop locally. This is a modern web application, thus the easiest way for deployment is AWS Amplify Console.
The code for this application is located here. Amplify Console supports GitHub, BitBucket, GitLab or CodeCommit as code source. The easiest way to get started is to fork the repo.
Open Amplify Console in AWS Console, click Get started in Deploy session
Choose the Git repo provider and select Continue
Github will automatically ask for the authorization, after that, Choose the repo and branch, select Next
Input App name
Create a new environment, input the environment name of leave it as default
Select or create a new service role, and click Next
Click Save and deploy
Wait for the deployment to be finished. You will be see the URL for the web application.
You will ONLY need to run this if you would like to develop locally. Skip this part if you have already finished Deployment to Amplify Console.
In this application, Yarn and node.js are used to build the application.
amplify init
, enter dev for environment nameamplify push
and type Yes when asked to confirmyarn install
to install dependenciesyarn start
to start the web application