# bezouwenr/podfy-app architecture

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

- Interactive diagram: https://gitdiagram.com/bezouwenr/podfy-app
- Repository: https://github.com/bezouwenr/podfy-app

## Overview

PODFY is a branded proof-of-delivery upload application. An uploader selects one or more files, provides optional contact and location details, and submits them; the frontend localizes and validates input, while the upload Function stores files and sends configured notifications. Separate endpoints serve theme and per-slug feature configuration. Browser-side image and PDF conversion are present as distinct capabilities. The graph reflects documented flows and sampled calls; frontend theme-loading and conversion wiring is not established by the excerpts.

Main entry points: [`public/main.js`](https://github.com/bezouwenr/podfy-app/blob/main/public/main.js) (Uploader controller), [`functions/api/upload.js`](https://github.com/bezouwenr/podfy-app/blob/main/functions/api/upload.js) (Upload handler), [`functions/_mail.js`](https://github.com/bezouwenr/podfy-app/blob/main/functions/_mail.js) (Mail formatter), [`public/compress/compress_file_to_pdf.js`](https://github.com/bezouwenr/podfy-app/blob/main/public/compress/compress_file_to_pdf.js) (File converter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Uploader experience"]
  node_ui["Upload interface<br/>[index.html]"]
  node_controller["Uploader controller<br/>[main.js]"]
  node_translations["Translations<br/>[i18n.json]"]
end

subgraph group_config["Brand configuration"]
  node_theme_data["Static themes<br/>[themes.json]"]
  node_theme_list["Theme catalog API<br/>[index.js]"]
  node_theme_detail["Slug theme API<br/>[&#91;slug&#93;.js]"]
  node_slug_features["Slug feature API<br/>[features.js]"]
end

subgraph group_processing["File processing"]
  node_file_router["File converter"]
  node_image_pdf["Image to PDF<br/>[image_to_a4_pdf.js]"]
  node_pdf_raster["PDF rasterizer<br/>[pdf_to_a4_pdf.js]"]
end

subgraph group_backend["Upload services"]
  node_upload_api["Upload handler<br/>[upload.js]"]
  node_pdf_builder["PDF builder<br/>[pdf.js]"]
  node_mailer["Mail formatter<br/>[_mail.js]"]
end

subgraph group_integrations["External services"]
  node_browser_geo(("Browser location"))
  node_d1[("Cloudflare D1")]
  node_r2[("Cloudflare R2")]
  node_resend(("Resend"))
  node_mailchannels(("MailChannels"))
end

node_uploader(("Uploader"))

node_uploader -->|"uses"| node_ui
node_ui -->|"controls"| node_controller
node_controller -->|"fetches"| node_translations
node_controller -->|"requests location"| node_browser_geo
node_controller -->|"submits files"| node_upload_api
node_theme_list -->|"queries themes"| node_d1
node_theme_detail -->|"queries slug"| node_d1
node_slug_features -->|"queries flags"| node_d1
node_upload_api -->|"reads settings"| node_d1
node_upload_api -->|"stores files"| node_r2
node_upload_api -->|"sends mail"| node_mailer
node_mailer -.->|"tries first"| node_resend
node_mailer -.->|"falls back"| node_mailchannels
node_file_router -->|"converts images"| node_image_pdf
node_file_router -->|"rasterizes PDFs"| node_pdf_raster

click node_ui "https://github.com/bezouwenr/podfy-app/blob/main/public/index.html"
click node_controller "https://github.com/bezouwenr/podfy-app/blob/main/public/main.js"
click node_translations "https://github.com/bezouwenr/podfy-app/blob/main/public/i18n.json"
click node_theme_data "https://github.com/bezouwenr/podfy-app/blob/main/public/themes.json"
click node_theme_list "https://github.com/bezouwenr/podfy-app/blob/main/functions/api/themes/index.js"
click node_theme_detail "https://github.com/bezouwenr/podfy-app/blob/main/functions/api/themes/%5Bslug%5D.js"
click node_slug_features "https://github.com/bezouwenr/podfy-app/blob/main/functions/api/slug/features.js"
click node_upload_api "https://github.com/bezouwenr/podfy-app/blob/main/functions/api/upload.js"
click node_pdf_builder "https://github.com/bezouwenr/podfy-app/blob/main/functions/lib/pdf.js"
click node_mailer "https://github.com/bezouwenr/podfy-app/blob/main/functions/_mail.js"
click node_file_router "https://github.com/bezouwenr/podfy-app/blob/main/public/compress/compress_file_to_pdf.js"
click node_image_pdf "https://github.com/bezouwenr/podfy-app/blob/main/public/compress/image_to_a4_pdf.js"
click node_pdf_raster "https://github.com/bezouwenr/podfy-app/blob/main/public/compress/pdf_to_a4_pdf.js"

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_ui,node_controller,node_translations toneBlue
class node_theme_data,node_theme_list,node_theme_detail,node_slug_features toneAmber
class node_file_router,node_image_pdf,node_pdf_raster toneMint
class node_upload_api,node_pdf_builder,node_mailer toneRose
class node_browser_geo,node_d1,node_r2,node_resend,node_mailchannels,node_uploader toneIndigo
```

## Components

### Uploader experience

- [Upload interface](https://github.com/bezouwenr/podfy-app/blob/main/public/index.html): `public/index.html`
- [Uploader controller](https://github.com/bezouwenr/podfy-app/blob/main/public/main.js): `public/main.js`
- [Translations](https://github.com/bezouwenr/podfy-app/blob/main/public/i18n.json): `public/i18n.json`

### Brand configuration

- [Static themes](https://github.com/bezouwenr/podfy-app/blob/main/public/themes.json): `public/themes.json`
- [Theme catalog API](https://github.com/bezouwenr/podfy-app/blob/main/functions/api/themes/index.js): `functions/api/themes/index.js`
- [Slug theme API](https://github.com/bezouwenr/podfy-app/blob/main/functions/api/themes/%5Bslug%5D.js): `functions/api/themes/[slug].js`
- [Slug feature API](https://github.com/bezouwenr/podfy-app/blob/main/functions/api/slug/features.js): `functions/api/slug/features.js`

### File processing

- [File converter](https://github.com/bezouwenr/podfy-app/blob/main/public/compress/compress_file_to_pdf.js): `public/compress/compress_file_to_pdf.js`
- [Image to PDF](https://github.com/bezouwenr/podfy-app/blob/main/public/compress/image_to_a4_pdf.js): `public/compress/image_to_a4_pdf.js`
- [PDF rasterizer](https://github.com/bezouwenr/podfy-app/blob/main/public/compress/pdf_to_a4_pdf.js): `public/compress/pdf_to_a4_pdf.js`

### Upload services

- [Upload handler](https://github.com/bezouwenr/podfy-app/blob/main/functions/api/upload.js): `functions/api/upload.js`
- [PDF builder](https://github.com/bezouwenr/podfy-app/blob/main/functions/lib/pdf.js): `functions/lib/pdf.js`
- [Mail formatter](https://github.com/bezouwenr/podfy-app/blob/main/functions/_mail.js): `functions/_mail.js`

### External services

- **Browser location**
- **Cloudflare D1**
- **Cloudflare R2**
- **Resend**
- **MailChannels**

### Other components

- **Uploader**

## Connections

- Uploader → Upload interface: uses
- Upload interface → Uploader controller: controls
- Uploader controller → Translations: fetches
- Uploader controller → Browser location: requests location
- Uploader controller → Upload handler: submits files
- Theme catalog API → Cloudflare D1: queries themes
- Slug theme API → Cloudflare D1: queries slug
- Slug feature API → Cloudflare D1: queries flags
- Upload handler → Cloudflare D1: reads settings
- Upload handler → Cloudflare R2: stores files
- Upload handler → Mail formatter: sends mail
- Mail formatter → Resend: tries first
- Mail formatter → MailChannels: falls back
- File converter → Image to PDF: converts images
- File converter → PDF rasterizer: rasterizes PDFs
