# babueiei/tms-d-s-v3 architecture

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

- Interactive diagram: https://gitdiagram.com/babueiei/tms-d-s-v3
- Repository: https://github.com/babueiei/tms-d-s-v3

## Overview

TMS-DS3 is a Thai training-management system delivered as a static web app, with a Google Apps Script API and Google Sheets-backed data. The visible user workflow spans attendance, exams, surveys, assignments, and administration/reporting. The frontend excerpt confirms API requests; backend excerpts show attendance, assignment, and reporting data access. The README is brief and source excerpts are partial, so unsampled capabilities and API dispatch details are not expanded into unsupported connections.

Main entry points: [`script_v2.js`](https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js) (Portal interactions), [`รหัส.js`](https://github.com/babueiei/tms-d-s-v3/blob/main/%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA.js) (Apps Script API), [`index.html`](https://github.com/babueiei/tms-d-s-v3/blob/main/index.html) (Training portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["Training portal<br/>[index.html]"]
  node_client["Portal interactions<br/>[script_v2.js]"]
end

subgraph group_learning["Training activities"]
  node_attendance["Attendance<br/>[script_v2.js]"]
  node_exams["Exams<br/>[script_v2.js]"]
  node_surveys["Surveys<br/>[script_v2.js]"]
  node_assignments["Assignments<br/>[รหัส.js]"]
end

subgraph group_operations["Administration"]
  node_admin["Admin configuration<br/>[script_v2.js]"]
  node_reports["Reports and evaluation<br/>[script_v2.js]"]
end

subgraph group_backend["API and data"]
  node_api["Apps Script API<br/>[รหัส.js]"]
  node_sheets[("Google Sheets")]
end

node_user(("Trainee or staff"))

node_user -->|"uses"| node_webapp
node_webapp -.->|"runs"| node_client
node_client -->|"opens"| node_attendance
node_client -->|"manages"| node_exams
node_client -->|"opens"| node_surveys
node_client -->|"opens"| node_admin
node_client -->|"requests"| node_reports
node_client -->|"sends requests"| node_api
node_api -->|"reads and writes"| node_sheets
node_api -.->|"serves"| node_assignments

click node_webapp "https://github.com/babueiei/tms-d-s-v3/blob/main/index.html"
click node_client "https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js"
click node_attendance "https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js"
click node_exams "https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js"
click node_surveys "https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js"
click node_assignments "https://github.com/babueiei/tms-d-s-v3/blob/main/%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA.js"
click node_admin "https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js"
click node_reports "https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js"
click node_api "https://github.com/babueiei/tms-d-s-v3/blob/main/%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA.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_webapp,node_client toneBlue
class node_attendance,node_exams,node_surveys,node_assignments toneAmber
class node_admin,node_reports toneMint
class node_api,node_sheets toneRose
class node_user toneIndigo
```

## Components

### Web application

- [Training portal](https://github.com/babueiei/tms-d-s-v3/blob/main/index.html): `index.html`
- [Portal interactions](https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js): `script_v2.js`

### Training activities

- [Attendance](https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js): `script_v2.js`
- [Exams](https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js): `script_v2.js`
- [Surveys](https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js): `script_v2.js`
- [Assignments](https://github.com/babueiei/tms-d-s-v3/blob/main/%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA.js): `รหัส.js`

### Administration

- [Admin configuration](https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js): `script_v2.js`
- [Reports and evaluation](https://github.com/babueiei/tms-d-s-v3/blob/main/script_v2.js): `script_v2.js`

### API and data

- [Apps Script API](https://github.com/babueiei/tms-d-s-v3/blob/main/%E0%B8%A3%E0%B8%AB%E0%B8%B1%E0%B8%AA.js): `รหัส.js`
- **Google Sheets**

### Other components

- **Trainee or staff**

## Connections

- Trainee or staff → Training portal: uses (evidence: `README.md`)
- Training portal → Portal interactions: runs
- Portal interactions → Attendance: opens (evidence: `script_v2.js`)
- Portal interactions → Exams: manages (evidence: `script_v2.js`)
- Portal interactions → Surveys: opens (evidence: `script_v2.js`)
- Portal interactions → Admin configuration: opens (evidence: `script_v2.js`)
- Portal interactions → Reports and evaluation: requests (evidence: `script_v2.js`)
- Portal interactions → Apps Script API: sends requests (evidence: `script_v2.js`)
- Apps Script API → Google Sheets: reads and writes (evidence: `รหัส.js`)
- Apps Script API → Assignments: serves (evidence: `รหัส.js`)
