# engineeringdepsethachon/cmms-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/engineeringdepsethachon/cmms-frontend
- Repository: https://github.com/engineeringdepsethachon/cmms-frontend

## Overview

This is a standalone CMMS frontend backed by a Google Apps Script API and Google Sheets. Users enter through the login or request pages, then use role-specific pages for maintenance, inventory, planning, monitoring, reporting, and administration. The frontend bridge sends JSON requests to the backend, which accesses Sheets and also supports LINE webhook/notification workflows. The README documents page capabilities and the overall API/storage flow; backend implementation details were not sampled, so finer backend call relationships are omitted.

Main entry points: [`api.js`](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/api.js) (API bridge), [`รหัส.gs`](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA.gs) (Apps Script API), [`Login.html`](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Login.html) (Universal login), [`Index.html`](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Index.html) (Maintenance request)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend access"]
  node_login["Universal login<br/>[Login.html]"]
  node_home["Role-based home<br/>[Home.html]"]
end

subgraph group_maintenance["Maintenance workflow"]
  node_request["Maintenance request<br/>[Index.html]"]
  node_monitor["Job monitoring<br/>[Monitor.html]"]
  node_mainttech["Maintenance technicians"]
  node_engineroom["Engine-room technicians<br/>[EngineRoom.html]"]
  node_generaltech["General technicians<br/>[GeneralTech.html]"]
  node_handover["Job handover<br/>[Handover.html]"]
  node_approval["Work approval<br/>[Approve.html]"]
end

subgraph group_operations["Operations and reporting"]
  node_inventory["Parts inventory<br/>[Inventory.html]"]
  node_pm["Preventive maintenance<br/>[PM.html]"]
  node_dashboard["KPI dashboard<br/>[Dashboard.html]"]
end

subgraph group_admin["Administration"]
  node_signatures["Electronic signatures<br/>[Signatures.html]"]
  node_roles["Role configuration<br/>[RoleConfig.html]"]
end

subgraph group_backend["API and data"]
  node_api["API bridge<br/>[api.js]"]
  node_config["API configuration<br/>[config.js]"]
  node_router["Apps Script API<br/>[รหัส.gs]"]
  node_sheets[("Google Sheets")]
end

node_users(("CMMS users"))
node_line["LINE service"]

node_users -->|"sign in"| node_login
node_users -->|"submit request"| node_request
node_users -->|"track jobs"| node_monitor
node_login -.->|"enter portal"| node_home
node_request -->|"send requests"| node_api
node_monitor -->|"request status"| node_api
node_mainttech -->|"manage jobs"| node_api
node_engineroom -->|"manage jobs"| node_api
node_generaltech -->|"manage jobs"| node_api
node_handover -->|"close jobs"| node_api
node_approval -->|"approve jobs"| node_api
node_inventory -->|"manage stock"| node_api
node_pm -->|"manage plans"| node_api
node_dashboard -->|"request reports"| node_api
node_signatures -->|"manage signatures"| node_api
node_roles -->|"configure access"| node_api
node_api -->|"reads URL"| node_config
node_api -->|"POST JSON"| node_router
node_router -->|"read and write"| node_sheets
node_line -->|"webhook"| node_router
node_router -->|"send notifications"| node_line

click node_login "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Login.html"
click node_home "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Home.html"
click node_request "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Index.html"
click node_monitor "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Monitor.html"
click node_mainttech "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/MaintenanceTech.html"
click node_engineroom "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/EngineRoom.html"
click node_generaltech "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/GeneralTech.html"
click node_handover "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Handover.html"
click node_approval "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Approve.html"
click node_inventory "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Inventory.html"
click node_pm "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/PM.html"
click node_dashboard "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Dashboard.html"
click node_signatures "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Signatures.html"
click node_roles "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/RoleConfig.html"
click node_api "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/api.js"
click node_config "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/config.js"
click node_router "https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA.gs"

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_home,node_users toneBlue
class node_request,node_monitor,node_mainttech,node_engineroom,node_generaltech,node_handover,node_approval toneAmber
class node_inventory,node_pm,node_dashboard toneMint
class node_signatures,node_roles toneRose
class node_api,node_config,node_router,node_sheets,node_line toneIndigo
```

## Components

### Frontend access

- [Universal login](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Login.html): `Login.html`
- [Role-based home](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Home.html): `Home.html`

### Maintenance workflow

- [Maintenance request](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Index.html): `Index.html`
- [Job monitoring](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Monitor.html): `Monitor.html`
- [Maintenance technicians](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/MaintenanceTech.html): `MaintenanceTech.html`
- [Engine-room technicians](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/EngineRoom.html): `EngineRoom.html`
- [General technicians](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/GeneralTech.html): `GeneralTech.html`
- [Job handover](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Handover.html): `Handover.html`
- [Work approval](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Approve.html): `Approve.html`

### Operations and reporting

- [Parts inventory](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Inventory.html): `Inventory.html`
- [Preventive maintenance](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/PM.html): `PM.html`
- [KPI dashboard](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Dashboard.html): `Dashboard.html`

### Administration

- [Electronic signatures](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/Signatures.html): `Signatures.html`
- [Role configuration](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/RoleConfig.html): `RoleConfig.html`

### API and data

- [API bridge](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/api.js): `api.js`
- [API configuration](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/config.js): `config.js`
- [Apps Script API](https://github.com/engineeringdepsethachon/cmms-frontend/blob/main/%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA.gs): `รหัส.gs`
- **Google Sheets**

### Other components

- **CMMS users**
- **LINE service**

## Connections

- CMMS users → Universal login: sign in (evidence: `README.md`)
- CMMS users → Maintenance request: submit request (evidence: `README.md`)
- CMMS users → Job monitoring: track jobs (evidence: `README.md`)
- Universal login → Role-based home: enter portal
- Maintenance request → API bridge: send requests (evidence: `README.md`)
- Job monitoring → API bridge: request status (evidence: `README.md`)
- Maintenance technicians → API bridge: manage jobs (evidence: `README.md`)
- Engine-room technicians → API bridge: manage jobs (evidence: `README.md`)
- General technicians → API bridge: manage jobs (evidence: `README.md`)
- Job handover → API bridge: close jobs (evidence: `README.md`)
- Work approval → API bridge: approve jobs (evidence: `README.md`)
- Parts inventory → API bridge: manage stock (evidence: `README.md`)
- Preventive maintenance → API bridge: manage plans (evidence: `README.md`)
- KPI dashboard → API bridge: request reports (evidence: `README.md`)
- Electronic signatures → API bridge: manage signatures (evidence: `README.md`)
- Role configuration → API bridge: configure access (evidence: `README.md`)
- API bridge → API configuration: reads URL (evidence: `api.js`)
- API bridge → Apps Script API: POST JSON (evidence: `README.md`)
- Apps Script API → Google Sheets: read and write (evidence: `README.md`)
- LINE service → Apps Script API: webhook (evidence: `README.md`)
- Apps Script API → LINE service: send notifications (evidence: `README.md`)
