# vouchedfor/consentbundle architecture

> Architecture diagram of the GitHub repository vouchedfor/consentbundle, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vouchedfor/consentbundle
- Repository: https://github.com/vouchedfor/consentbundle

## Overview

ConsentBundle is a Symfony bundle for recording email consent in AWS DynamoDB. An application configures the table name and encryption password, obtains the consent handler, encrypts an email, then calls the handler to retrieve or update consent choices; updates are persisted to DynamoDB. Internally, the extension processes configuration and loads the bundle’s service definitions. The excerpts show handler reads and writes, but do not expose the service-definition wiring, so that connection is omitted.

Main entry points: [`Services/ConsentHandler.php`](https://github.com/vouchedfor/consentbundle/blob/master/Services/ConsentHandler.php) (Consent handler), [`DependencyInjection/VouchedForConsentExtension.php`](https://github.com/vouchedfor/consentbundle/blob/master/DependencyInjection/VouchedForConsentExtension.php) (Config extension), [`DependencyInjection/Configuration.php`](https://github.com/vouchedfor/consentbundle/blob/master/DependencyInjection/Configuration.php) (Config schema), [`VouchedForConsentBundle.php`](https://github.com/vouchedfor/consentbundle/blob/master/VouchedForConsentBundle.php) (Bundle registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Symfony Integration"]
  node_bundle["Bundle registration"]
  node_schema["Config schema<br/>[Configuration.php]"]
  node_extension["Config extension"]
  node_definitions["Service definitions<br/>[services.yml]"]
end

subgraph group_consent["Consent Handling"]
  node_handler["Consent handler<br/>[ConsentHandler.php]"]
end

subgraph group_storage["Persistence"]
  node_dynamodb[("AWS DynamoDB")]
end

node_application(("Symfony application"))

node_application -->|"registers"| node_bundle
node_application -->|"configures"| node_schema
node_extension -->|"processes"| node_schema
node_extension -->|"loads"| node_definitions
node_application -->|"calls"| node_handler
node_handler -->|"reads"| node_dynamodb
node_handler -->|"writes"| node_dynamodb

click node_bundle "https://github.com/vouchedfor/consentbundle/blob/master/VouchedForConsentBundle.php"
click node_schema "https://github.com/vouchedfor/consentbundle/blob/master/DependencyInjection/Configuration.php"
click node_extension "https://github.com/vouchedfor/consentbundle/blob/master/DependencyInjection/VouchedForConsentExtension.php"
click node_definitions "https://github.com/vouchedfor/consentbundle/blob/master/Resources/config/services.yml"
click node_handler "https://github.com/vouchedfor/consentbundle/blob/master/Services/ConsentHandler.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bundle,node_schema,node_extension,node_definitions toneBlue
class node_handler toneAmber
class node_dynamodb toneMint
class node_application toneIndigo
```

## Components

### Symfony Integration

- [Bundle registration](https://github.com/vouchedfor/consentbundle/blob/master/VouchedForConsentBundle.php): `VouchedForConsentBundle.php`
- [Config schema](https://github.com/vouchedfor/consentbundle/blob/master/DependencyInjection/Configuration.php): `DependencyInjection/Configuration.php`
- [Config extension](https://github.com/vouchedfor/consentbundle/blob/master/DependencyInjection/VouchedForConsentExtension.php): `DependencyInjection/VouchedForConsentExtension.php`
- [Service definitions](https://github.com/vouchedfor/consentbundle/blob/master/Resources/config/services.yml): `Resources/config/services.yml`

### Consent Handling

- [Consent handler](https://github.com/vouchedfor/consentbundle/blob/master/Services/ConsentHandler.php): `Services/ConsentHandler.php`

### Persistence

- **AWS DynamoDB**

### Other components

- **Symfony application**

## Connections

- Symfony application → Bundle registration: registers (evidence: `README.md`)
- Symfony application → Config schema: configures (evidence: `README.md`)
- Config extension → Config schema: processes (evidence: `DependencyInjection/VouchedForConsentExtension.php`)
- Config extension → Service definitions: loads (evidence: `DependencyInjection/VouchedForConsentExtension.php`)
- Symfony application → Consent handler: calls (evidence: `README.md`)
- Consent handler → AWS DynamoDB: reads (evidence: `Services/ConsentHandler.php`)
- Consent handler → AWS DynamoDB: writes (evidence: `Services/ConsentHandler.php`)
