# ovotech/comms-aws architecture

> Architecture diagram of the GitHub repository ovotech/comms-aws, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ovotech/comms-aws
- Repository: https://github.com/ovotech/comms-aws

## Overview

##### Main Components

a) Core Components:
- Auth Module (AWS Signing)
- Common Module (Shared Utilities)
- S3 Module (S3 Client Implementation)

b) External Dependencies/Integration Points:
- AWS Services (S3)
- fs2 (Functional Streams)
- Effect System (likely Cats Effect based on the functional nature)

**Top Level (Client Applications)**

- ▼
**Module Layer**
**┌──────────────────────────────────────┐**
- ┌─────────┐    ┌────────┐    ┌────┐ │
- Auth   │    │ Common │    │ S3 │ │
- ┘    └────────┘    └────┘ │
- ┘

- ▼               ▼          ▼
**Infrastructure Layer**
**┌──────────────────────────────────────┐**
- AWS Service Integration        │
- ┘

##### Component Details

Auth Module:
- AwsSigner component
- SignV4 authentication flow
- To other modules that require signing

Common Module:
- Shared components:
- CredentialsProvider
- HTTP Codecs
- Model definitions
- Custom Headers

S3 Module:
- S3 client implementation
- URI parsing utilities
- Connection to Auth module for request signing

##### Implementation Details to Highlight

- How the AwsSigner integrates with different AWS services
- Relationship between Common module utilities and other modules
- Demonstrate how the S3 client uses the auth module for request signing

##### Future Extensibility

A separate section showing:
- Planned extraction of DynamoDB client (dynosaur)
- Potential future AWS service integrations
- Integration points for future modules

Remember to:
- Version/status indicators for experimental components

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client["Client Applications"]
        App[Client Code]
    end

    subgraph Modules["Module Layer"]
        subgraph Auth["Auth Module"]
            AwsSigner["AwsSigner"]
            SignV4["SignV4 Authentication"]
            TestSuite["AWS SignV4 Test Suite"]
        end

        subgraph Common["Common Module"]
            Credentials["CredentialsProvider"]
            HttpCodecs["HTTP Codecs"]
            Headers["Headers"]
            Models["Model Definitions"]
            MediaTypes["Media Types"]
        end

        subgraph S3["S3 Module"]
            S3Client["S3 Client"]
            UriParser["URI Parser"]
            UriDomain["URI Domain"]
            S3Headers["S3 Headers"]
            S3Models["S3 Models"]
            S3Tests["Integration Tests"]
        end
    end

    subgraph Infrastructure["Infrastructure Layer"]
        AWS["AWS Services"]
        FS2["fs2 Streams"]
        CatsEffect["Cats Effect"]
    end

    %% Relationships
    App --> Auth
    App --> S3
    Auth --> Common
    S3 --> Auth
    S3 --> Common
    Auth --> AWS
    S3 --> AWS
    S3 --> FS2
    S3 --> CatsEffect

    %% Component Relationships
    AwsSigner --> SignV4
    S3Client --> UriParser
    UriParser --> UriDomain
    S3Client --> S3Headers
    S3Client --> S3Models

    %% Click Events
    click AwsSigner "https://github.com/ovotech/comms-aws/blob/master/modules/auth/src/main/scala/auth/AwsSigner.scala"
    click TestSuite "https://github.com/ovotech/comms-aws/tree/master/modules/auth/src/test/resources/aws-signv4-test-suite/"
    click Credentials "https://github.com/ovotech/comms-aws/blob/master/modules/common/src/main/scala/common/CredentialsProvider.scala"
    click HttpCodecs "https://github.com/ovotech/comms-aws/blob/master/modules/common/src/main/scala/common/HttpCodecs.scala"
    click Headers "https://github.com/ovotech/comms-aws/blob/master/modules/common/src/main/scala/common/headers.scala"
    click Models "https://github.com/ovotech/comms-aws/blob/master/modules/common/src/main/scala/common/model.scala"
    click MediaTypes "https://github.com/ovotech/comms-aws/blob/master/modules/common/src/main/scala/common/mediaTypes.scala"
    click S3Client "https://github.com/ovotech/comms-aws/blob/master/modules/s3/src/main/scala/s3/S3.scala"
    click UriParser "https://github.com/ovotech/comms-aws/blob/master/modules/s3/src/main/scala/s3/utils/S3UriParser.scala"
    click UriDomain "https://github.com/ovotech/comms-aws/blob/master/modules/s3/src/main/scala/s3/utils/S3UriDomain.scala"
    click S3Headers "https://github.com/ovotech/comms-aws/blob/master/modules/s3/src/main/scala/s3/headers.scala"
    click S3Models "https://github.com/ovotech/comms-aws/blob/master/modules/s3/src/main/scala/s3/model.scala"
    click S3Tests "https://github.com/ovotech/comms-aws/blob/master/modules/s3/src/it/scala/s3/S3Spec.scala"

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
    classDef module fill:#e1f5fe,stroke:#01579b,stroke-width:2px
    classDef infrastructure fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
    classDef client fill:#fff3e0,stroke:#ef6c00,stroke-width:2px
    classDef component fill:#f3e5f5,stroke:#4a148c,stroke-width:1px

    class Auth,Common,S3 module
    class AWS,FS2,CatsEffect infrastructure
    class Client client
    class AwsSigner,SignV4,TestSuite,Credentials,HttpCodecs,Headers,Models,MediaTypes,S3Client,UriParser,UriDomain,S3Headers,S3Models,S3Tests component
```
