# drama-king/deni architecture

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

- Interactive diagram: https://gitdiagram.com/drama-king/deni
- Repository: https://github.com/drama-king/deni

## Overview

Deni is an offline-capable credit ledger for small shops. The main workflow is to add a customer, record credit or repayments, then review balances or send a reminder. The README also documents customer search and sorting, sharing a debtor list, language and currency settings, and local-only data. The app implementation is represented by index.html, but its source was not provided, so those capabilities and links are based on README statements rather than inspected code. The service worker’s caching behavior is directly visible in sw.js.

Main entry points: [`index.html`](https://github.com/drama-king/deni/blob/main/index.html) (Deni app), [`sw.js`](https://github.com/drama-king/deni/blob/main/sw.js) (Service worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ledger["Customer ledger"]
  node_app["Deni app<br/>[index.html]"]
  node_customers["Customer records<br/>[index.html]"]
  node_transactions["Credit and payments<br/>[index.html]"]
  node_phone_data[("On-device records<br/>[index.html]")]
end

subgraph group_insights["Balances and sharing"]
  node_balances["Balances and totals<br/>[index.html]"]
  node_customer_list["Sorted customer list<br/>[index.html]"]
  node_search["Customer search<br/>[index.html]"]
  node_debt_list["Debtor list copy<br/>[index.html]"]
  node_reminders["Payment reminders<br/>[index.html]"]
end

subgraph group_preferences["Settings and language"]
  node_preferences_ui["App settings<br/>[index.html]"]
  node_language["English and Kiswahili<br/>[index.html]"]
  node_currency["Currency and dial code<br/>[index.html]"]
end

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

node_shopkeeper(("Shopkeeper"))
node_whatsapp["WhatsApp"]

node_shopkeeper -->|"uses"| node_app
node_app -->|"manages"| node_customers
node_app -->|"records"| node_transactions
node_customers -->|"saves locally"| node_phone_data
node_transactions -->|"saves locally"| node_phone_data
node_app -->|"shows"| node_balances
node_app -->|"sorts by balance"| node_customer_list
node_app -->|"searches names"| node_search
node_app -->|"copies list"| node_debt_list
node_app -->|"prepares reminder"| node_reminders
node_reminders -->|"sends reminder"| node_whatsapp
node_app -->|"offers settings"| node_preferences_ui
node_preferences_ui -->|"switches language"| node_language
node_preferences_ui -->|"sets formats"| node_currency
node_service_worker -->|"caches assets"| node_cache
node_service_worker -->|"serves offline"| node_app

click node_app "https://github.com/drama-king/deni/blob/main/index.html"
click node_customers "https://github.com/drama-king/deni/blob/main/index.html"
click node_transactions "https://github.com/drama-king/deni/blob/main/index.html"
click node_phone_data "https://github.com/drama-king/deni/blob/main/index.html"
click node_balances "https://github.com/drama-king/deni/blob/main/index.html"
click node_customer_list "https://github.com/drama-king/deni/blob/main/index.html"
click node_search "https://github.com/drama-king/deni/blob/main/index.html"
click node_debt_list "https://github.com/drama-king/deni/blob/main/index.html"
click node_reminders "https://github.com/drama-king/deni/blob/main/index.html"
click node_preferences_ui "https://github.com/drama-king/deni/blob/main/index.html"
click node_language "https://github.com/drama-king/deni/blob/main/index.html"
click node_currency "https://github.com/drama-king/deni/blob/main/index.html"
click node_service_worker "https://github.com/drama-king/deni/blob/main/sw.js"
click node_cache "https://github.com/drama-king/deni/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_customers,node_transactions,node_phone_data toneBlue
class node_balances,node_customer_list,node_search,node_debt_list,node_reminders toneAmber
class node_preferences_ui,node_language,node_currency toneMint
class node_service_worker,node_cache toneRose
class node_shopkeeper,node_whatsapp toneIndigo
```

## Components

### Customer ledger

- [Deni app](https://github.com/drama-king/deni/blob/main/index.html): `index.html`
- [Customer records](https://github.com/drama-king/deni/blob/main/index.html): `index.html`
- [Credit and payments](https://github.com/drama-king/deni/blob/main/index.html): `index.html`
- [On-device records](https://github.com/drama-king/deni/blob/main/index.html): `index.html`

### Balances and sharing

- [Balances and totals](https://github.com/drama-king/deni/blob/main/index.html): `index.html`
- [Sorted customer list](https://github.com/drama-king/deni/blob/main/index.html): `index.html`
- [Customer search](https://github.com/drama-king/deni/blob/main/index.html): `index.html`
- [Debtor list copy](https://github.com/drama-king/deni/blob/main/index.html): `index.html`
- [Payment reminders](https://github.com/drama-king/deni/blob/main/index.html): `index.html`

### Settings and language

- [App settings](https://github.com/drama-king/deni/blob/main/index.html): `index.html`
- [English and Kiswahili](https://github.com/drama-king/deni/blob/main/index.html): `index.html`
- [Currency and dial code](https://github.com/drama-king/deni/blob/main/index.html): `index.html`

### Offline support

- [Service worker](https://github.com/drama-king/deni/blob/main/sw.js): `sw.js`
- [Offline asset cache](https://github.com/drama-king/deni/blob/main/sw.js): `sw.js`

### Other components

- **Shopkeeper**
- **WhatsApp**

## Connections

- Shopkeeper → Deni app: uses (evidence: `README.txt`)
- Deni app → Customer records: manages (evidence: `README.txt`)
- Deni app → Credit and payments: records (evidence: `README.txt`)
- Customer records → On-device records: saves locally (evidence: `README.txt`)
- Credit and payments → On-device records: saves locally (evidence: `README.txt`)
- Deni app → Balances and totals: shows (evidence: `README.txt`)
- Deni app → Sorted customer list: sorts by balance (evidence: `README.txt`)
- Deni app → Customer search: searches names (evidence: `README.txt`)
- Deni app → Debtor list copy: copies list (evidence: `README.txt`)
- Deni app → Payment reminders: prepares reminder (evidence: `README.txt`)
- Payment reminders → WhatsApp: sends reminder (evidence: `README.txt`)
- Deni app → App settings: offers settings (evidence: `README.txt`)
- App settings → English and Kiswahili: switches language (evidence: `README.txt`)
- App settings → Currency and dial code: sets formats (evidence: `README.txt`)
- Service worker → Offline asset cache: caches assets (evidence: `sw.js`)
- Service worker → Deni app: serves offline (evidence: `sw.js`)
