# mcgee993/alexa-breaking-bad-quotes architecture

> Architecture diagram of the GitHub repository mcgee993/alexa-breaking-bad-quotes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mcgee993/alexa-breaking-bad-quotes
- Repository: https://github.com/mcgee993/alexa-breaking-bad-quotes

## Overview

##### Main Components

a) User Interface Layer:
- Alexa Device/Interface
- Voice Input/Output

b) Alexa Skill Infrastructure:
- Skill Manifest (skill.json)
- Language Models (models/en-GB.json, models/en-US.json)

c) Lambda Function Layer:
- Main Handler (lambda/custom/index.js)
- Regional Lambda Function (us-east-1 region)

d) External Services:
- Breaking Bad Quotes API

**┌─────────────┐     ┌─────────────┐**
- Alexa      │     │ Language    │
- Device     │     │ Models      │
- ┘     └─────────────┘
- ↓                   ↓
**┌─────────────────────────────────┐**
- Alexa Skill Service      │
- (Intent Recognition/Routing)   │
- ┘
- ↓
**┌─────────────────────────────────┐**
- AWS Lambda Function        │
- (Custom Skill Logic)         │
- ┘
- ↓
**┌─────────────────────────────────┐**
- Breaking Bad Quotes API      │
- (External Service)           │
- ┘

##### Important Elements to Highlight

a) Request Flow:
- Voice input → Alexa NLU → Intent matching
- Lambda function processing
- API call and response handling
- Voice response generation

b) Configuration Components:
- Skill manifest configuration
- Language model definitions
- Lambda function deployment

##### Additional Details

a) Deployment Hooks:
- Pre_deploy_hook.ps1 and post_new_hook.ps1 as part of the deployment process

b) Supported Locales:
- Support for en-US and en-GB

##### Technical Specifications

- Runtime: Node.js (based on package.json)
- Supported Languages: English (US/GB)
- API Dependencies: Breaking Bad Quotes API
- Deployment Region: us-east-1

##### Key Interactions to Emphasize

- User utterance processing
- Intent handling in Lambda
- External API communication
- Response formatting and delivery

Remember to include a brief textual description of the main flows and any important architectural decisions or constraints that might not be immediately obvious from the visual representation.

## Diagram (Mermaid)

```mermaid
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#007bff', 'primaryTextColor': '#fff', 'primaryBorderColor': '#007bff', 'lineColor': '#F8B229', 'secondaryColor': '#006100', 'tertiaryColor': '#fff'}}}%%

flowchart TB
    subgraph User["User Interface Layer"]
        AD[Alexa Device]
        VI[Voice Input]
        VO[Voice Output]
        AD --> VI
        AD --> VO
    end

    subgraph Config["Configuration Layer"]
        SM["Skill Manifest"]:::manifest
        LM["Language Models"]:::models
        DH["Deployment Hooks"]:::hooks
    end

    subgraph ASS["Alexa Skill Service"]
        IR["Intent Recognition"]
        Router["Request Router"]
        IR --> Router
    end

    subgraph Lambda["AWS Lambda Function Layer"]
        MH["Main Handler"]:::lambda
        LD["Lambda Dependencies"]:::deps
        MH --> LD
    end

    subgraph External["External Services"]
        API["Breaking Bad Quotes API"]:::api
    end

    VI --> ASS
    Config --> ASS
    ASS --> Lambda
    Lambda --> API
    API --> Lambda
    Lambda --> VO

    %% Click Events
    click SM "https://github.com/mcgee993/Alexa-Breaking-Bad-Quotes/blob/master/skill.json"
    click LM "https://github.com/mcgee993/Alexa-Breaking-Bad-Quotes/tree/master/models"
    click MH "https://github.com/mcgee993/Alexa-Breaking-Bad-Quotes/blob/master/lambda/custom/index.js"
    click Lambda "https://github.com/mcgee993/Alexa-Breaking-Bad-Quotes/tree/master/lambda/us-east-1_ask-custom-Breaking_Bad_Quotes-default"
    click DH "https://github.com/mcgee993/Alexa-Breaking-Bad-Quotes/tree/master/hooks"
    click LD "https://github.com/mcgee993/Alexa-Breaking-Bad-Quotes/blob/master/lambda/custom/package.json"

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef manifest fill:#e1f5fe,stroke:#0288d1
    classDef models fill:#e8f5e9,stroke:#388e3c
    classDef hooks fill:#fff3e0,stroke:#f57c00
    classDef lambda fill:#fce4ec,stroke:#c2185b
    classDef deps fill:#f3e5f5,stroke:#7b1fa2
    classDef api fill:#e8eaf6,stroke:#3f51b5

    %% Legend
    subgraph Legend
        L1[User Interface]:::default
        L2[Configuration]:::manifest
        L3[Lambda Function]:::lambda
        L4[External Services]:::api
    end
```
