# mplungjan/dealbreaker architecture

> Architecture diagram of the GitHub repository mplungjan/dealbreaker, 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/mplungjan/dealbreaker
- Repository: https://github.com/mplungjan/dealbreaker

## Overview

Dealbreaker is a deal-comparison app: users enter two offers, then see normalized unit prices and which deal is better. The web client builds and submits comparison data to the PHP processor; the separate app client performs comparison in-browser. Settings support currency, units, theme, and first-run preferences, while the web landing page provides demo/privacy modals and iframe sizing. Source excerpts show the web request path and settings behavior; app-side calculation details and several page capabilities are only partly sampled, so their internal connections are not expanded.

Main entry points: [`src/web/process.php`](https://github.com/mplungjan/dealbreaker/blob/main/src/web/process.php) (Deal processor), [`src/web/js/webapp.js`](https://github.com/mplungjan/dealbreaker/blob/main/src/web/js/webapp.js) (Web comparison UI), [`src/web/js/aux.js`](https://github.com/mplungjan/dealbreaker/blob/main/src/web/js/aux.js) (Site interactions), [`src/app/js/app.js`](https://github.com/mplungjan/dealbreaker/blob/main/src/app/js/app.js) (App comparison UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_comparison["Deal comparison"]
  node_app_ui["App comparison UI<br/>[app.js]"]
  node_web_ui["Web comparison UI<br/>[webapp.js]"]
  node_processor["Deal processor<br/>[process.php]"]
  node_rates[("Exchange rates<br/>[process.php]")]
end

subgraph group_preferences["Settings"]
  node_app_settings["App settings<br/>[settings.js]"]
  node_web_settings["Web settings<br/>[settings.js]"]
  node_browser_storage[("Browser preferences")]
end

subgraph group_website["Website experience"]
  node_web_home["Web landing pages<br/>[index.html]"]
  node_site_interactions["Site interactions<br/>[aux.js]"]
  node_privacy_content["Privacy content<br/>[dealbreak.html]"]
  node_demo_frame["Embedded demo<br/>[aux.js]"]
end

node_shopper(("Shopper"))
node_exchange_service["Exchange-rate API"]

node_shopper -->|"enters offers"| node_app_ui
node_app_ui -->|"shows comparison"| node_shopper
node_shopper -->|"enters offers"| node_web_ui
node_web_ui -->|"posts deals"| node_processor
node_processor -->|"returns result"| node_web_ui
node_web_ui -->|"shows comparison"| node_shopper
node_processor -->|"reads cache"| node_rates
node_processor -.->|"fetches rates"| node_exchange_service
node_shopper -->|"changes preferences"| node_app_settings
node_shopper -->|"changes preferences"| node_web_settings
node_app_settings -->|"loads and saves"| node_browser_storage
node_web_settings -->|"loads and saves"| node_browser_storage
node_web_home -.->|"loads script"| node_site_interactions
node_site_interactions -->|"fetches content"| node_privacy_content
node_site_interactions -->|"sizes iframe"| node_demo_frame

click node_app_ui "https://github.com/mplungjan/dealbreaker/blob/main/src/app/js/app.js"
click node_web_ui "https://github.com/mplungjan/dealbreaker/blob/main/src/web/js/webapp.js"
click node_processor "https://github.com/mplungjan/dealbreaker/blob/main/src/web/process.php"
click node_rates "https://github.com/mplungjan/dealbreaker/blob/main/src/web/process.php"
click node_app_settings "https://github.com/mplungjan/dealbreaker/blob/main/src/app/js/settings.js"
click node_web_settings "https://github.com/mplungjan/dealbreaker/blob/main/src/web/js/settings.js"
click node_web_home "https://github.com/mplungjan/dealbreaker/blob/main/src/web/index.html"
click node_site_interactions "https://github.com/mplungjan/dealbreaker/blob/main/src/web/js/aux.js"
click node_privacy_content "https://github.com/mplungjan/dealbreaker/blob/main/src/web/nl/dealbreak.html"
click node_demo_frame "https://github.com/mplungjan/dealbreaker/blob/main/src/web/js/aux.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_app_ui,node_web_ui,node_processor,node_rates toneBlue
class node_app_settings,node_web_settings,node_browser_storage toneAmber
class node_web_home,node_site_interactions,node_privacy_content,node_demo_frame,node_exchange_service toneMint
class node_shopper toneIndigo
```

## Components

### Deal comparison

- [App comparison UI](https://github.com/mplungjan/dealbreaker/blob/main/src/app/js/app.js): `src/app/js/app.js`
- [Web comparison UI](https://github.com/mplungjan/dealbreaker/blob/main/src/web/js/webapp.js): `src/web/js/webapp.js`
- [Deal processor](https://github.com/mplungjan/dealbreaker/blob/main/src/web/process.php): `src/web/process.php`
- [Exchange rates](https://github.com/mplungjan/dealbreaker/blob/main/src/web/process.php): `src/web/process.php`

### Settings

- [App settings](https://github.com/mplungjan/dealbreaker/blob/main/src/app/js/settings.js): `src/app/js/settings.js`
- [Web settings](https://github.com/mplungjan/dealbreaker/blob/main/src/web/js/settings.js): `src/web/js/settings.js`
- **Browser preferences**

### Website experience

- [Web landing pages](https://github.com/mplungjan/dealbreaker/blob/main/src/web/index.html): `src/web/index.html`
- [Site interactions](https://github.com/mplungjan/dealbreaker/blob/main/src/web/js/aux.js): `src/web/js/aux.js`
- [Privacy content](https://github.com/mplungjan/dealbreaker/blob/main/src/web/nl/dealbreak.html): `src/web/nl/dealbreak.html`
- [Embedded demo](https://github.com/mplungjan/dealbreaker/blob/main/src/web/js/aux.js): `src/web/js/aux.js`

### Other components

- **Shopper**
- **Exchange-rate API**

## Connections

- Shopper → App comparison UI: enters offers (evidence: `src/app/js/app.js`)
- App comparison UI → Shopper: shows comparison (evidence: `src/app/js/app.js`)
- Shopper → Web comparison UI: enters offers (evidence: `src/web/js/webapp.js`)
- Web comparison UI → Deal processor: posts deals (evidence: `src/web/js/webapp.js`)
- Deal processor → Web comparison UI: returns result (evidence: `src/web/js/webapp.js`)
- Web comparison UI → Shopper: shows comparison (evidence: `src/web/js/webapp.js`)
- Deal processor → Exchange rates: reads cache (evidence: `src/web/process.php`)
- Deal processor → Exchange-rate API: fetches rates (evidence: `src/web/process.php`)
- Shopper → App settings: changes preferences (evidence: `src/app/js/settings.js`)
- Shopper → Web settings: changes preferences (evidence: `src/web/js/settings.js`)
- App settings → Browser preferences: loads and saves (evidence: `src/app/js/settings.js`)
- Web settings → Browser preferences: loads and saves (evidence: `src/web/js/settings.js`)
- Web landing pages → Site interactions: loads script
- Site interactions → Privacy content: fetches content (evidence: `src/web/js/aux.js`)
- Site interactions → Embedded demo: sizes iframe (evidence: `src/web/js/aux.js`)
