# bobs24/report-livingword architecture

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

- Interactive diagram: https://gitdiagram.com/bobs24/report-livingword
- Repository: https://github.com/bobs24/report-livingword

## Overview

This is a browser-based sales and stock control application. Users authenticate, prepare and submit sales orders, and manage stock by location and SKU; they can also transfer stock, revoke sales, review movement history, and produce reports and XLSX exports. The README identifies `assets/app.js` and `index.html` as the frontend runtime and documents Supabase Auth and RPC use. Source excerpts were not available, so links are limited to relationships explicitly described in the README; SQL files are shown without inferred connections.

Main entry points: [`assets/app.js`](https://github.com/bobs24/report-livingword/blob/main/assets/app.js) (Frontend runtime), [`index.html`](https://github.com/bobs24/report-livingword/blob/main/index.html) (Application page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_page["Application page<br/>[index.html]"]
  node_app["Frontend runtime<br/>[app.js]"]
  node_auth["Google login<br/>[app.js]"]
  node_responsive_ui["Responsive controls<br/>[app.js]"]
end

subgraph group_sales["Sales"]
  node_draft["Order draft<br/>[app.js]"]
  node_order_rules["Order requirements<br/>[app.js]"]
  node_submit["Order submission<br/>[app.js]"]
  node_revoke["Sales revoke<br/>[app.js]"]
end

subgraph group_inventory["Inventory"]
  node_stock["Stock management<br/>[app.js]"]
  node_transfer["Stock transfer<br/>[app.js]"]
  node_history["Movement history<br/>[app.js]"]
  node_schema[("Database schema<br/>[schema.sql]")]
  node_audit_patch[("Transfer audit patch")]
end

subgraph group_analytics["Analytics"]
  node_reports["Period reports<br/>[app.js]"]
  node_chart["Combo chart<br/>[app.js]"]
  node_export["XLSX export<br/>[app.js]"]
end

node_user(("User"))
node_supabase_auth["Supabase Auth"]
node_rpc["Supabase RPC"]

node_user -->|"uses"| node_page
node_page -->|"runs"| node_app
node_app -->|"authenticates via"| node_supabase_auth
node_app -->|"submits via"| node_rpc

click node_page "https://github.com/bobs24/report-livingword/blob/main/index.html"
click node_app "https://github.com/bobs24/report-livingword/blob/main/assets/app.js"
click node_auth "https://github.com/bobs24/report-livingword/blob/main/assets/app.js"
click node_draft "https://github.com/bobs24/report-livingword/blob/main/assets/app.js"
click node_order_rules "https://github.com/bobs24/report-livingword/blob/main/assets/app.js"
click node_submit "https://github.com/bobs24/report-livingword/blob/main/assets/app.js"
click node_stock "https://github.com/bobs24/report-livingword/blob/main/assets/app.js"
click node_transfer "https://github.com/bobs24/report-livingword/blob/main/assets/app.js"
click node_revoke "https://github.com/bobs24/report-livingword/blob/main/assets/app.js"
click node_history "https://github.com/bobs24/report-livingword/blob/main/assets/app.js"
click node_schema "https://github.com/bobs24/report-livingword/blob/main/database/schema.sql"
click node_audit_patch "https://github.com/bobs24/report-livingword/blob/main/database/database_stock_transfer_audit_patch.sql"
click node_reports "https://github.com/bobs24/report-livingword/blob/main/assets/app.js"
click node_chart "https://github.com/bobs24/report-livingword/blob/main/assets/app.js"
click node_export "https://github.com/bobs24/report-livingword/blob/main/assets/app.js"
click node_responsive_ui "https://github.com/bobs24/report-livingword/blob/main/assets/app.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_page,node_app,node_auth,node_responsive_ui,node_user toneBlue
class node_draft,node_order_rules,node_submit,node_revoke toneAmber
class node_stock,node_transfer,node_history,node_schema,node_audit_patch toneMint
class node_reports,node_chart,node_export toneRose
class node_supabase_auth,node_rpc toneIndigo
```

## Components

### Frontend

- [Application page](https://github.com/bobs24/report-livingword/blob/main/index.html): `index.html`
- [Frontend runtime](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`
- [Google login](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`
- [Responsive controls](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`

### Sales

- [Order draft](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`
- [Order requirements](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`
- [Order submission](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`
- [Sales revoke](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`

### Inventory

- [Stock management](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`
- [Stock transfer](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`
- [Movement history](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`
- [Database schema](https://github.com/bobs24/report-livingword/blob/main/database/schema.sql): `database/schema.sql`
- [Transfer audit patch](https://github.com/bobs24/report-livingword/blob/main/database/database_stock_transfer_audit_patch.sql): `database/database_stock_transfer_audit_patch.sql`

### Analytics

- [Period reports](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`
- [Combo chart](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`
- [XLSX export](https://github.com/bobs24/report-livingword/blob/main/assets/app.js): `assets/app.js`

### Other components

- **User**
- **Supabase Auth**
- **Supabase RPC**

## Connections

- User → Application page: uses (evidence: `README.md`)
- Application page → Frontend runtime: runs (evidence: `README.md`)
- Frontend runtime → Supabase Auth: authenticates via (evidence: `README.md`)
- Frontend runtime → Supabase RPC: submits via (evidence: `README.md`)
