# threinecke/dutch_vocabulary architecture

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

- Interactive diagram: https://gitdiagram.com/threinecke/dutch_vocabulary
- Repository: https://github.com/threinecke/dutch_vocabulary

## Overview

##### Main Components Identification
- CloudWatch Events (Trigger)
- Lambda Function (Core Logic)
- DynamoDB (Storage)
- Amazon SES (Email Service)
- OpenAI's ChatGPT API (External Service)
- Systems Manager Parameter Store (Configuration, implied by ssm.tf)

##### Component Relationships and Data Flow

The sequence should be clear:

##### Additional Details

- Configuration details from SSM Parameter Store
- IAM roles and permissions
- CloudWatch trigger schedule
- Data structure in DynamoDB

##### Technical Specifications

- Python 3.8 runtime for Lambda
- Terraform as IaC tool
- Key configuration parameters

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Trigger
        CW[CloudWatch Events]:::aws
    end

    subgraph "Compute & Security"
        Lambda[Lambda Function]:::aws
        IAM[IAM Roles]:::aws
        SSM[Parameter Store]:::aws
    end

    subgraph Storage
        DDB[DynamoDB]:::aws
    end

    subgraph "External Services"
        GPT[ChatGPT API]:::external
        SES[Amazon SES]:::aws
    end

    subgraph "End User"
        User[Email Recipient]:::user
    end

    %% Connections
    CW -->|"Daily 7:00 AM"| Lambda
    Lambda <-->|"Read/Write Words"| DDB
    Lambda -->|"Request New Words"| GPT
    Lambda -->|"Send Email"| SES
    SSM -->|"Config Parameters"| Lambda
    IAM -->|"Permissions"| Lambda
    SES -->|"Deliver Email"| User

    %% Click Events
    click CW "https://github.com/ThReinecke/dutch_vocabulary/blob/main/cloudwatch.tf"
    click Lambda "https://github.com/ThReinecke/dutch_vocabulary/blob/main/lambda_function.py"
    click DDB "https://github.com/ThReinecke/dutch_vocabulary/blob/main/dynamodb.tf"
    click SSM "https://github.com/ThReinecke/dutch_vocabulary/blob/main/ssm.tf"
    click IAM "https://github.com/ThReinecke/dutch_vocabulary/blob/main/iam.tf"

    %% Styles
    classDef aws fill:#FF9900,stroke:#232F3E,color:#232F3E
    classDef external fill:#1a73e8,stroke:#0d47a1,color:white
    classDef user fill:#4CAF50,stroke:#1B5E20,color:white

    %% Legend
    subgraph Legend
        L1[AWS Service]:::aws
        L2[External Service]:::external
        L3[End User]:::user
    end
```
