lexstream

command module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: Apache-2.0 Imports: 2 Imported by: 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/main.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 when it expires.
Create settings.json
  • Copy settings.json.example to settings.json and update with the appropriate content
{
  "bucket": "<unique bucket name>",
  "lambda_name": "lexstream_lambda",
  "skill_name": "<skill name>"
}
Deploy Skill
  • Run go run infra/skill/create.go to create the skill.
  • TODO: instructions for creating catalog, uploading, and associating with skill
Create S3 bucket and Deploy Lambda

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
    # requires golang mage to be installed
    $ mage -v
    
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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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