lexstream

module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2022 License: Apache-2.0

README

lexstream

Alexa Music skill for streaming your own music.

Go Report Card

Various documentation links that have been useful when building out this project

Prerequisites
Initialize Go Modules
  • Use go mod tidy in the root of this repository to initialize dependencies
Run preflight check
  • go run cmd/preflight.go will:
    • Check that the minimum version of node is installed.
    • Configure and test ask-cli in the .ask directory.
      • This will prompt to run ask configure if no credentials are found
    • Check that AWS credentials and configuration files are set up correctly.
      • This performs read only api calls for S3, IAM, DynamoDB, and Lambda
    • Check that the aws cli command is installed

Warning commands after this point start modifying things, so read warnings closely

Generate Login with Amazon Keys
  • Create a new security profile for your Amazon Developer account by following the instructions provided here
  • This will generate Client ID and Client Secret keys.
  • Save these keys in the file secret.json in this format
    {
      "client_id": "amzn1.application-oa2-client.xxxxx",
      "client_secret": "xxxxxx"
    }
    
  • Run go run smapi/lwa.go - this automates a call to ask util generate-lwa-tokens
    • This must be run on a computer with a browser to handle the LWA oauth flow
  • The resulting token will be saved to token.json and updated by the token source using the LWA credentials when it expires every hour.
Deploy Skill

TODO - smapi api client has been generated, automation work needed

Deploy Lambda
  • Copy settings.json.example to settings.json and update with the appropriate content

WARNING if the provided bucket already exists the permissions will be re-set to no public access

  • Run the following command to create the required Bucket, IAM Role, and Lambda
    $ go run infra/sync.go
    
Update Endpoint and Re-Validate

TODO: this should be able to be automated

  • Back in the Alexa skills console, update the skill endpoint with the output of the previous command
Design Notes
  • Use MusicBrainz_API for identifiers wherever possible.
    • Completed
    • Artist,Album, and Track are all directly supported and would be unique
    • Prefix each since the MB Api uses GUIDs that are opaque
TODOs and other ramblings

Initial readme created by tigwen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL