# aaqibrahman/text-narrator-project architecture

> Architecture diagram of the GitHub repository aaqibrahman/text-narrator-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aaqibrahman/text-narrator-project
- Repository: https://github.com/aaqibrahman/text-narrator-project

## Overview

##### Project type and purpose
- This is a small serverless, cloud-based text-to-speech “tool” (open-source tutorial) that uses AWS services to convert uploaded text into audio via Amazon Polly.
- The README outlines a hands-on walkthrough: create IAM role, S3 bucket, Lambda function, invoke Polly, inspect output.

##### File structure
- Top level only contains documentation and sample output (no application code files shown).
- “Text narrator using Amazon Polly.pdf” likely contains the Lambda code or detailed steps.
- “test-audio.mp3” is the generated output.
- No traditional “src” or “lib” folders—this is purely infrastructure-as-code / serverless components managed via the AWS console or scripts embedded in the PDF.

##### README for additional insights
- Core AWS services used: Amazon Polly, S3, Lambda, IAM (and optionally CloudWatch for logs).
- No mention of a custom frontend—upload likely happens via console or SDK.
- Parameters (voice, pitch, speed) are passed to Polly from Lambda.

##### Details
- IAM role’s permission scope (e.g., S3:GetObject, Polly:SynthesizeSpeech, S3:PutObject).
- Event triggers and parameter handoff points (voice/pitch/speed passed via Lambda environment variables or payload).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User
    User["User / Client"]:::user

    %% AWS Services Group
    subgraph "AWS Services"
        direction TB
        S3Text["Amazon S3 (Text Bucket)"]:::aws
        Lambda["AWS Lambda Function"]:::aws
        Polly["Amazon Polly"]:::aws
        S3Audio["Amazon S3 (Audio Bucket)"]:::aws
    end

    %% IAM Role
    IAMRole["IAM Role & Policies"]:::security

    %% Flows
    User -->|"Upload text file (PutObject)"| S3Text
    S3Text -->|"S3 Event Trigger"| Lambda
    Lambda -->|"SynthesizeSpeech API Call"| Polly
    Polly -->|"Returns audio stream"| Lambda
    Lambda -->|"Store MP3 (PutObject)"| S3Audio
    User -->|"Retrieve audio (GetObject)"| S3Audio

    %% Permissions
    IAMRole -->|"Allows S3:GetObject & S3:PutObject"| S3Text
    IAMRole -->|"Allows Lambda execution"| Lambda
    IAMRole -->|"Allows Polly:SynthesizeSpeech"| Polly
    IAMRole -->|"Allows S3:PutObject"| S3Audio

    %% Click Events
    click IAMRole "https://github.com/aaqibrahman/text-narrator-project/blob/main/README.md"
    click Lambda "https://github.com/aaqibrahman/text-narrator-project/blob/main/Text narrator using Amazon Polly.pdf"
    click S3Audio "https://github.com/aaqibrahman/text-narrator-project/blob/main/test-audio.mp3"

    %% Styles
    classDef aws fill:#FF9900,stroke:#333,stroke-width:1px
    classDef user fill:#9FE2BF,stroke:#333,stroke-width:1px
    classDef security fill:#FF6F61,stroke:#333,stroke-width:1px
```
