# mild7seven/dompet-pwa--mvp architecture

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

- Interactive diagram: https://gitdiagram.com/mild7seven/dompet-pwa--mvp
- Repository: https://github.com/mild7seven/dompet-pwa--mvp

## Overview

Dompet is a browser-based personal-finance PWA with salary-cycle, take-home-pay, and bank-transfer calculations. The main workflow is user input in the app, calculation by the financial engine, display of results, and persistence of salary calculations in IndexedDB. The app also registers a service worker, which caches the app shell and serves cached responses when available. The source excerpts support these runtime connections; the README is empty, and PRD.md and index.html were not excerpted, so their details are not inferred.

Main entry points: [`js/app.js`](https://github.com/mild7seven/dompet-pwa--mvp/blob/main/js/app.js) (App interactions), [`sw.js`](https://github.com/mild7seven/dompet-pwa--mvp/blob/main/sw.js) (Service worker), [`index.html`](https://github.com/mild7seven/dompet-pwa--mvp/blob/main/index.html) (App shell), [`js/engine.js`](https://github.com/mild7seven/dompet-pwa--mvp/blob/main/js/engine.js) (Pay cycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["User application"]
  node_app["App interactions<br/>[app.js]"]
  node_shell["App shell<br/>[index.html]"]
end

subgraph group_finance["Financial calculations"]
  node_cycle["Pay cycle<br/>[engine.js]"]
  node_payroll["Pay calculation<br/>[engine.js]"]
  node_transfer["Transfer calculation<br/>[engine.js]"]
end

subgraph group_persistence["Local persistence"]
  node_indexeddb[("IndexedDB<br/>[db.js]")]
end

subgraph group_offline["Offline support"]
  node_worker["Service worker<br/>[sw.js]"]
  node_cache[("Asset cache<br/>[sw.js]")]
end

node_user(("User"))

node_user -->|"provides input"| node_app
node_app -->|"gets cycle"| node_cycle
node_app -->|"calculates pay"| node_payroll
node_app -->|"calculates transfer"| node_transfer
node_app -->|"saves calculation"| node_indexeddb
node_app -->|"registers"| node_worker
node_worker -->|"caches assets"| node_cache
node_worker -->|"checks cached response"| node_cache
node_worker -->|"caches app shell"| node_shell

click node_app "https://github.com/mild7seven/dompet-pwa--mvp/blob/main/js/app.js"
click node_shell "https://github.com/mild7seven/dompet-pwa--mvp/blob/main/index.html"
click node_cycle "https://github.com/mild7seven/dompet-pwa--mvp/blob/main/js/engine.js"
click node_payroll "https://github.com/mild7seven/dompet-pwa--mvp/blob/main/js/engine.js"
click node_transfer "https://github.com/mild7seven/dompet-pwa--mvp/blob/main/js/engine.js"
click node_indexeddb "https://github.com/mild7seven/dompet-pwa--mvp/blob/main/js/db.js"
click node_worker "https://github.com/mild7seven/dompet-pwa--mvp/blob/main/sw.js"
click node_cache "https://github.com/mild7seven/dompet-pwa--mvp/blob/main/sw.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,node_shell,node_user toneBlue
class node_cycle,node_payroll,node_transfer toneAmber
class node_indexeddb toneMint
class node_worker,node_cache toneRose
```

## Components

### User application

- [App interactions](https://github.com/mild7seven/dompet-pwa--mvp/blob/main/js/app.js): `js/app.js`
- [App shell](https://github.com/mild7seven/dompet-pwa--mvp/blob/main/index.html): `index.html`

### Financial calculations

- [Pay cycle](https://github.com/mild7seven/dompet-pwa--mvp/blob/main/js/engine.js): `js/engine.js`
- [Pay calculation](https://github.com/mild7seven/dompet-pwa--mvp/blob/main/js/engine.js): `js/engine.js`
- [Transfer calculation](https://github.com/mild7seven/dompet-pwa--mvp/blob/main/js/engine.js): `js/engine.js`

### Local persistence

- [IndexedDB](https://github.com/mild7seven/dompet-pwa--mvp/blob/main/js/db.js): `js/db.js`

### Offline support

- [Service worker](https://github.com/mild7seven/dompet-pwa--mvp/blob/main/sw.js): `sw.js`
- [Asset cache](https://github.com/mild7seven/dompet-pwa--mvp/blob/main/sw.js): `sw.js`

### Other components

- **User**

## Connections

- User → App interactions: provides input (evidence: `js/app.js`)
- App interactions → Pay cycle: gets cycle (evidence: `js/app.js`)
- App interactions → Pay calculation: calculates pay (evidence: `js/app.js`)
- App interactions → Transfer calculation: calculates transfer (evidence: `js/app.js`)
- App interactions → IndexedDB: saves calculation (evidence: `js/app.js`)
- App interactions → Service worker: registers (evidence: `js/app.js`)
- Service worker → Asset cache: caches assets (evidence: `sw.js`)
- Service worker → Asset cache: checks cached response (evidence: `sw.js`)
- Service worker → App shell: caches app shell (evidence: `sw.js`)
