# bargovph/e-newsletter architecture

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

- Interactive diagram: https://gitdiagram.com/bargovph/e-newsletter
- Repository: https://github.com/bargovph/e-newsletter

## Overview

This is a PHP e-newsletter reader. Readers browse published articles, optionally filter by issue, open a full letter, and can browse related articles; the listing also presents an issue carousel. The main runtime is split between page-level PHP rendering and shared PDO query helpers backed by MySQL. `index_1.php` is an alternate listing implementation. The excerpts do not establish a subscription-processing workflow, and the BAK directory appears to be a backup rather than an active subsystem.

Main entry points: [`index.php`](https://github.com/bargovph/e-newsletter/blob/main/index.php) (Newsletter listing), [`view_letter.php`](https://github.com/bargovph/e-newsletter/blob/main/view_letter.php) (Letter detail), [`functions/function.php`](https://github.com/bargovph/e-newsletter/blob/main/functions/function.php) (Article and issue queries), [`index_1.php`](https://github.com/bargovph/e-newsletter/blob/main/index_1.php) (Alternate listing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reader["Reader pages"]
  node_listing["Newsletter listing<br/>[index.php]"]
  node_alternate["Alternate listing<br/>[index_1.php]"]
  node_letter["Letter detail<br/>[view_letter.php]"]
end

subgraph group_queries["Newsletter queries"]
  node_query_helpers["Article and issue queries<br/>[function.php]"]
end

subgraph group_storage["Data store"]
  node_mysql[("MySQL database")]
end

node_reader(("Reader"))

node_reader -->|"opens"| node_listing
node_reader -.->|"opens"| node_alternate
node_reader -->|"requests"| node_letter
node_listing -->|"loads articles"| node_query_helpers
node_listing -->|"loads issues"| node_query_helpers
node_listing -->|"links to"| node_letter
node_alternate -.->|"loads articles"| node_query_helpers
node_alternate -->|"links to"| node_letter
node_letter -->|"loads letter and related articles"| node_query_helpers
node_query_helpers -->|"queries"| node_mysql
node_listing -->|"reads attachments"| node_mysql
node_letter -->|"reads authors"| node_mysql

click node_listing "https://github.com/bargovph/e-newsletter/blob/main/index.php"
click node_alternate "https://github.com/bargovph/e-newsletter/blob/main/index_1.php"
click node_letter "https://github.com/bargovph/e-newsletter/blob/main/view_letter.php"
click node_query_helpers "https://github.com/bargovph/e-newsletter/blob/main/functions/function.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_listing,node_alternate,node_letter toneBlue
class node_query_helpers toneAmber
class node_mysql toneMint
class node_reader toneIndigo
```

## Components

### Reader pages

- [Newsletter listing](https://github.com/bargovph/e-newsletter/blob/main/index.php): `index.php`
- [Alternate listing](https://github.com/bargovph/e-newsletter/blob/main/index_1.php): `index_1.php`
- [Letter detail](https://github.com/bargovph/e-newsletter/blob/main/view_letter.php): `view_letter.php`

### Newsletter queries

- [Article and issue queries](https://github.com/bargovph/e-newsletter/blob/main/functions/function.php): `functions/function.php`

### Data store

- **MySQL database**

### Other components

- **Reader**

## Connections

- Reader → Newsletter listing: opens (evidence: `index.php`)
- Reader → Alternate listing: opens
- Reader → Letter detail: requests (evidence: `view_letter.php`)
- Newsletter listing → Article and issue queries: loads articles (evidence: `index.php`)
- Newsletter listing → Article and issue queries: loads issues (evidence: `index.php`)
- Newsletter listing → Letter detail: links to (evidence: `index.php`)
- Alternate listing → Article and issue queries: loads articles (evidence: `index_1.php`)
- Alternate listing → Letter detail: links to (evidence: `index_1.php`)
- Letter detail → Article and issue queries: loads letter and related articles (evidence: `view_letter.php`)
- Article and issue queries → MySQL database: queries (evidence: `functions/function.php`)
- Newsletter listing → MySQL database: reads attachments (evidence: `index.php`)
- Letter detail → MySQL database: reads authors (evidence: `view_letter.php`)
