# mr-pairot/e_jvbp_doc_demo architecture

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

- Interactive diagram: https://gitdiagram.com/mr-pairot/e_jvbp_doc_demo
- Repository: https://github.com/mr-pairot/e_jvbp_doc_demo

## Overview

This is a Thai electronic document-management dashboard. Users authenticate or enter guest mode, load document records, then search and filter RFA, RFI, and incoming letters with tables and charts. The source excerpts show the authentication and data-loading responsibilities, local IndexedDB caching, UI rendering, notification behavior, and splash animation. Google Sheets and LINE are documented or referenced as integrations; unsampled connections are omitted rather than inferred.

Main entry points: [`js/data-service.js`](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/data-service.js) (Bootstrap & loading), [`js/ui-render.js`](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/ui-render.js) (Search, filters & charts), [`js/auth.js`](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/auth.js) (Authentication), [`js/config.js`](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/config.js) (Document records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access &amp; Identity"]
  node_auth["Authentication<br/>[auth.js]"]
end

subgraph group_records["Document Data"]
  node_loader["Bootstrap &amp; loading<br/>[data-service.js]"]
  node_cache[("IndexedDB cache<br/>[data-service.js]")]
  node_documents["Document records<br/>[config.js]"]
end

subgraph group_dashboard["Dashboard"]
  node_config["App state &amp; config<br/>[config.js]"]
  node_dashboard["Search, filters &amp; charts<br/>[ui-render.js]"]
  node_sessions["Session management UI<br/>[ui-render.js]"]
end

subgraph group_experience["User Experience"]
  node_notify["User notifications<br/>[user-notify.js]"]
  node_notifydata["Notification settings<br/>[notify.json]"]
  node_rings["Splash animation<br/>[magic-rings-bg.js]"]
  node_about["About popup<br/>[about-popup.js]"]
end

node_visitor(("Visitor"))
node_line["LINE LIFF"]
node_sheets[("Google Sheets")]

node_visitor -->|"signs in"| node_auth
node_auth -.->|"checks identity"| node_line
node_auth -->|"loads app"| node_loader
node_loader -->|"reads and writes"| node_cache
node_loader -->|"fetches sheets"| node_sheets
node_loader -->|"parses records"| node_documents
node_config -->|"defines records"| node_documents
node_dashboard -->|"uses state"| node_config
node_dashboard -->|"filters and displays"| node_documents
node_dashboard -->|"loads sessions"| node_loader
node_notify -->|"fetches settings"| node_notifydata
node_visitor -.->|"interacts"| node_notify
node_visitor -->|"opens popup"| node_about
node_loader -->|"starts and stops"| node_rings

click node_auth "https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/auth.js"
click node_config "https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/config.js"
click node_loader "https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/data-service.js"
click node_cache "https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/data-service.js"
click node_documents "https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/config.js"
click node_dashboard "https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/ui-render.js"
click node_sessions "https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/ui-render.js"
click node_notify "https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/user-notify.js"
click node_notifydata "https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/data/notify.json"
click node_rings "https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/magic-rings-bg.js"
click node_about "https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/about-popup.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_auth toneBlue
class node_loader,node_cache,node_documents,node_sheets toneAmber
class node_config,node_dashboard,node_sessions toneMint
class node_notify,node_notifydata,node_rings,node_about toneRose
class node_visitor,node_line toneIndigo
```

## Components

### Access & Identity

- [Authentication](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/auth.js): `js/auth.js`

### Document Data

- [Bootstrap & loading](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/data-service.js): `js/data-service.js`
- [IndexedDB cache](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/data-service.js): `js/data-service.js`
- [Document records](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/config.js): `js/config.js`

### Dashboard

- [App state & config](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/config.js): `js/config.js`
- [Search, filters & charts](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/ui-render.js): `js/ui-render.js`
- [Session management UI](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/ui-render.js): `js/ui-render.js`

### User Experience

- [User notifications](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/user-notify.js): `js/user-notify.js`
- [Notification settings](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/data/notify.json): `data/notify.json`
- [Splash animation](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/magic-rings-bg.js): `js/magic-rings-bg.js`
- [About popup](https://github.com/mr-pairot/e_jvbp_doc_demo/blob/main/js/about-popup.js): `js/about-popup.js`

### Other components

- **Visitor**
- **LINE LIFF**
- **Google Sheets**

## Connections

- Visitor → Authentication: signs in (evidence: `js/auth.js`)
- Authentication → LINE LIFF: checks identity (evidence: `js/auth.js`)
- Authentication → Bootstrap & loading: loads app (evidence: `js/auth.js`)
- Bootstrap & loading → IndexedDB cache: reads and writes (evidence: `js/data-service.js`)
- Bootstrap & loading → Google Sheets: fetches sheets (evidence: `js/data-service.js`)
- Bootstrap & loading → Document records: parses records (evidence: `js/data-service.js`)
- App state & config → Document records: defines records (evidence: `js/config.js`)
- Search, filters & charts → App state & config: uses state (evidence: `js/ui-render.js`)
- Search, filters & charts → Document records: filters and displays (evidence: `js/ui-render.js`)
- Search, filters & charts → Bootstrap & loading: loads sessions (evidence: `js/ui-render.js`)
- User notifications → Notification settings: fetches settings (evidence: `js/user-notify.js`)
- Visitor → User notifications: interacts
- Visitor → About popup: opens popup (evidence: `js/about-popup.js`)
- Bootstrap & loading → Splash animation: starts and stops (evidence: `js/magic-rings-bg.js`)
