# measvuthy168/cm_pro architecture

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

- Interactive diagram: https://gitdiagram.com/measvuthy168/cm_pro
- Repository: https://github.com/measvuthy168/cm_pro

## Overview

CM_Pro is a browser-based credit-management PWA. Its apparent user journey is sign-in to a home dashboard and then operational pages such as arrears, customer search, loan calculation, and credit reports; administrators also have management tools. The tree shows these product areas, but the README is empty and most page scripts were not sampled, so their internal call flow and backend data paths cannot be verified. The evidenced internals include API helpers, localization, session handling, and service-worker caching and push notifications.

Main entry points: [`index.html`](https://github.com/measvuthy168/cm_pro/blob/main/index.html) (Home dashboard), [`service-worker.js`](https://github.com/measvuthy168/cm_pro/blob/main/service-worker.js) (Offline and push worker), [`shared/i18n.js`](https://github.com/measvuthy168/cm_pro/blob/main/shared/i18n.js) (Translation runtime), [`login.html`](https://github.com/measvuthy168/cm_pro/blob/main/login.html) (Sign in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_login["Sign in<br/>[login.html]"]
  node_dashboard["Home dashboard<br/>[index.html]"]
end

subgraph group_operations["Credit operations"]
  node_arrears["Arrears<br/>[index.html]"]
  node_customers["Customer search<br/>[index.html]"]
  node_calculator["Loan calculator<br/>[index.html]"]
  node_retirement["Retirement<br/>[index.html]"]
  node_spotcheck["Spot check<br/>[index.html]"]
  node_turnover["Average turnover<br/>[index.html]"]
end

subgraph group_insight["Reports and data"]
  node_creditreports["Credit reports"]
  node_masterdata["Master data"]
  node_officertasks["Officer tasks<br/>[index.html]"]
  node_landclassify["Land classification<br/>[index.html]"]
end

subgraph group_admin["Administration"]
  node_admin["Admin tools"]
end

subgraph group_platform["Shared platform"]
  node_settings["Settings"]
  node_notifications["Notifications<br/>[index.html]"]
  node_api["API client<br/>[api.js]"]
  node_session["Session timeout<br/>[session.js]"]
  node_pushconfig["Push subscription<br/>[push.js]"]
  node_worker["Offline and push worker<br/>[service-worker.js]"]
  node_idb[("Pending request store<br/>[service-worker.js]")]
  node_i18n["Translation runtime<br/>[i18n.js]"]
  node_dictionaries["Translation dictionaries"]
  node_topbar["Top bar<br/>[topbar.js]"]
end

node_user(("Credit officer"))

node_user -.->|"signs in"| node_login
node_login -.->|"opens home"| node_dashboard
node_dashboard -.->|"opens feature"| node_arrears
node_dashboard -.->|"opens feature"| node_customers
node_dashboard -.->|"opens feature"| node_calculator
node_dashboard -.->|"opens feature"| node_retirement
node_dashboard -.->|"opens feature"| node_spotcheck
node_dashboard -.->|"opens feature"| node_turnover
node_dashboard -.->|"opens reports"| node_creditreports
node_dashboard -.->|"opens data"| node_masterdata
node_api -->|"registers"| node_worker
node_pushconfig -->|"registers"| node_worker
node_worker -->|"stores pending data"| node_idb
node_worker -.->|"delivers push"| node_notifications
node_i18n -->|"registers strings"| node_dictionaries
node_i18n -->|"translates dynamic content"| node_topbar

click node_login "https://github.com/measvuthy168/cm_pro/blob/main/login.html"
click node_dashboard "https://github.com/measvuthy168/cm_pro/blob/main/index.html"
click node_arrears "https://github.com/measvuthy168/cm_pro/blob/main/pages/arrears/index.html"
click node_customers "https://github.com/measvuthy168/cm_pro/blob/main/pages/customers/index.html"
click node_calculator "https://github.com/measvuthy168/cm_pro/blob/main/pages/loanCalculate/index.html"
click node_retirement "https://github.com/measvuthy168/cm_pro/blob/main/pages/retirement/index.html"
click node_spotcheck "https://github.com/measvuthy168/cm_pro/blob/main/pages/spotcheck/index.html"
click node_turnover "https://github.com/measvuthy168/cm_pro/blob/main/pages/turnover/index.html"
click node_creditreports "https://github.com/measvuthy168/cm_pro/tree/main/pages/creditreport"
click node_masterdata "https://github.com/measvuthy168/cm_pro/tree/main/pages/masterdata"
click node_officertasks "https://github.com/measvuthy168/cm_pro/blob/main/pages/officertask/index.html"
click node_landclassify "https://github.com/measvuthy168/cm_pro/blob/main/pages/landClassisfy/index.html"
click node_admin "https://github.com/measvuthy168/cm_pro/tree/main/pages/admin"
click node_settings "https://github.com/measvuthy168/cm_pro/tree/main/pages/settings"
click node_notifications "https://github.com/measvuthy168/cm_pro/blob/main/pages/notifications/index.html"
click node_api "https://github.com/measvuthy168/cm_pro/blob/main/config/api.js"
click node_session "https://github.com/measvuthy168/cm_pro/blob/main/config/session.js"
click node_pushconfig "https://github.com/measvuthy168/cm_pro/blob/main/config/push.js"
click node_worker "https://github.com/measvuthy168/cm_pro/blob/main/service-worker.js"
click node_idb "https://github.com/measvuthy168/cm_pro/blob/main/service-worker.js"
click node_i18n "https://github.com/measvuthy168/cm_pro/blob/main/shared/i18n.js"
click node_dictionaries "https://github.com/measvuthy168/cm_pro/tree/main/shared/i18n"
click node_topbar "https://github.com/measvuthy168/cm_pro/blob/main/shared/topbar.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_login,node_dashboard toneBlue
class node_arrears,node_customers,node_calculator,node_retirement,node_spotcheck,node_turnover toneAmber
class node_creditreports,node_masterdata,node_officertasks,node_landclassify toneMint
class node_admin toneRose
class node_settings,node_notifications,node_api,node_session,node_pushconfig,node_worker,node_idb,node_i18n,node_dictionaries,node_topbar,node_user toneIndigo
```

## Components

### App entry

- [Sign in](https://github.com/measvuthy168/cm_pro/blob/main/login.html): `login.html`
- [Home dashboard](https://github.com/measvuthy168/cm_pro/blob/main/index.html): `index.html`

### Credit operations

- [Arrears](https://github.com/measvuthy168/cm_pro/blob/main/pages/arrears/index.html): `pages/arrears/index.html`
- [Customer search](https://github.com/measvuthy168/cm_pro/blob/main/pages/customers/index.html): `pages/customers/index.html`
- [Loan calculator](https://github.com/measvuthy168/cm_pro/blob/main/pages/loanCalculate/index.html): `pages/loanCalculate/index.html`
- [Retirement](https://github.com/measvuthy168/cm_pro/blob/main/pages/retirement/index.html): `pages/retirement/index.html`
- [Spot check](https://github.com/measvuthy168/cm_pro/blob/main/pages/spotcheck/index.html): `pages/spotcheck/index.html`
- [Average turnover](https://github.com/measvuthy168/cm_pro/blob/main/pages/turnover/index.html): `pages/turnover/index.html`

### Reports and data

- [Credit reports](https://github.com/measvuthy168/cm_pro/tree/main/pages/creditreport): `pages/creditreport`
- [Master data](https://github.com/measvuthy168/cm_pro/tree/main/pages/masterdata): `pages/masterdata`
- [Officer tasks](https://github.com/measvuthy168/cm_pro/blob/main/pages/officertask/index.html): `pages/officertask/index.html`
- [Land classification](https://github.com/measvuthy168/cm_pro/blob/main/pages/landClassisfy/index.html): `pages/landClassisfy/index.html`

### Administration

- [Admin tools](https://github.com/measvuthy168/cm_pro/tree/main/pages/admin): `pages/admin`

### Shared platform

- [Settings](https://github.com/measvuthy168/cm_pro/tree/main/pages/settings): `pages/settings`
- [Notifications](https://github.com/measvuthy168/cm_pro/blob/main/pages/notifications/index.html): `pages/notifications/index.html`
- [API client](https://github.com/measvuthy168/cm_pro/blob/main/config/api.js): `config/api.js`
- [Session timeout](https://github.com/measvuthy168/cm_pro/blob/main/config/session.js): `config/session.js`
- [Push subscription](https://github.com/measvuthy168/cm_pro/blob/main/config/push.js): `config/push.js`
- [Offline and push worker](https://github.com/measvuthy168/cm_pro/blob/main/service-worker.js): `service-worker.js`
- [Pending request store](https://github.com/measvuthy168/cm_pro/blob/main/service-worker.js): `service-worker.js`
- [Translation runtime](https://github.com/measvuthy168/cm_pro/blob/main/shared/i18n.js): `shared/i18n.js`
- [Translation dictionaries](https://github.com/measvuthy168/cm_pro/tree/main/shared/i18n): `shared/i18n`
- [Top bar](https://github.com/measvuthy168/cm_pro/blob/main/shared/topbar.js): `shared/topbar.js`

### Other components

- **Credit officer**

## Connections

- Credit officer → Sign in: signs in
- Sign in → Home dashboard: opens home
- Home dashboard → Arrears: opens feature
- Home dashboard → Customer search: opens feature
- Home dashboard → Loan calculator: opens feature
- Home dashboard → Retirement: opens feature
- Home dashboard → Spot check: opens feature
- Home dashboard → Average turnover: opens feature
- Home dashboard → Credit reports: opens reports
- Home dashboard → Master data: opens data
- API client → Offline and push worker: registers (evidence: `config/api.js`)
- Push subscription → Offline and push worker: registers (evidence: `config/push.js`)
- Offline and push worker → Pending request store: stores pending data (evidence: `service-worker.js`)
- Offline and push worker → Notifications: delivers push
- Translation runtime → Translation dictionaries: registers strings (evidence: `shared/i18n/features.js`)
- Translation runtime → Top bar: translates dynamic content (evidence: `shared/i18n.js`)
