# somchaimontha/rdf architecture

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

- Interactive diagram: https://gitdiagram.com/somchaimontha/rdf
- Repository: https://github.com/somchaimontha/rdf

## Overview

This is a bilingual Thai/English student-records web application. Its principal workflow is staff using the student pages to manage records, with browser-side API code connecting to the documented Google Apps Script backend and spreadsheet. The README also identifies academic records, promotion, reports, settings, custom fields, authentication, access control, OCR, and tamper protection as product capabilities. Source excerpts were unavailable, so links between individual pages and helper modules are omitted where the documentation does not establish them; backend files are not present in the supplied tree.

Main entry points: [`students.html`](https://github.com/somchaimontha/rdf/blob/main/students.html) (Students), [`assets/js/i18n.js`](https://github.com/somchaimontha/rdf/blob/main/assets/js/i18n.js) (Thai/English), [`reports.html`](https://github.com/somchaimontha/rdf/blob/main/reports.html) (Reports), [`assets/js/api.js`](https://github.com/somchaimontha/rdf/blob/main/assets/js/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_records["Student records"]
  node_students["Students<br/>[students.html]"]
  node_student_form["Student form<br/>[student-form.html]"]
  node_student_profile["Student profile"]
  node_dashboard["Dashboard<br/>[dashboard.html]"]
end

subgraph group_academic["Academic workflows"]
  node_academic_terms["Academic terms"]
  node_academic_results["Academic results"]
  node_promotion["Promotion<br/>[promotion.html]"]
  node_reports["Reports<br/>[reports.html]"]
end

subgraph group_platform["Shared services"]
  node_settings["Settings<br/>[settings.html]"]
  node_custom_fields["Custom fields<br/>[custom-fields.html]"]
  node_i18n["Thai/English<br/>[i18n.js]"]
  node_dynamic_fields["Dynamic fields<br/>[dynamic-fields.js]"]
  node_auth["Authentication<br/>[auth.js]"]
  node_rbac["Access control<br/>[rbac.js]"]
  node_ocr["OCR<br/>[ocr.js]"]
  node_tamper_guard["Tamper protection<br/>[tamper-guard.js]"]
end

subgraph group_integrations["Data integration"]
  node_config["Configuration<br/>[config.js]"]
  node_api["API client<br/>[api.js]"]
  node_gas["Apps Script backend"]
  node_spreadsheet[("Database spreadsheet")]
end

node_staff(("Staff user"))

node_staff -->|"manages records"| node_students
node_staff -->|"views overview"| node_dashboard
node_staff -->|"manages terms"| node_academic_terms
node_staff -->|"views results"| node_academic_results
node_staff -->|"manages promotion"| node_promotion
node_staff -->|"views reports"| node_reports
node_staff -->|"configures app"| node_settings
node_staff -->|"configures fields"| node_custom_fields
node_students -->|"edits records"| node_student_form
node_students -->|"opens profile"| node_student_profile
node_i18n -->|"translates interface"| node_students
node_i18n -->|"localizes charts"| node_reports
node_api -->|"calls backend"| node_gas
node_gas -->|"reads and writes"| node_spreadsheet

click node_students "https://github.com/somchaimontha/rdf/blob/main/students.html"
click node_student_form "https://github.com/somchaimontha/rdf/blob/main/student-form.html"
click node_student_profile "https://github.com/somchaimontha/rdf/blob/main/student-profile.html"
click node_dashboard "https://github.com/somchaimontha/rdf/blob/main/dashboard.html"
click node_academic_terms "https://github.com/somchaimontha/rdf/blob/main/academic-terms.html"
click node_academic_results "https://github.com/somchaimontha/rdf/blob/main/academic-results.html"
click node_promotion "https://github.com/somchaimontha/rdf/blob/main/promotion.html"
click node_reports "https://github.com/somchaimontha/rdf/blob/main/reports.html"
click node_settings "https://github.com/somchaimontha/rdf/blob/main/settings.html"
click node_custom_fields "https://github.com/somchaimontha/rdf/blob/main/custom-fields.html"
click node_i18n "https://github.com/somchaimontha/rdf/blob/main/assets/js/i18n.js"
click node_dynamic_fields "https://github.com/somchaimontha/rdf/blob/main/assets/js/dynamic-fields.js"
click node_auth "https://github.com/somchaimontha/rdf/blob/main/assets/js/auth.js"
click node_rbac "https://github.com/somchaimontha/rdf/blob/main/assets/js/rbac.js"
click node_ocr "https://github.com/somchaimontha/rdf/blob/main/assets/js/ocr.js"
click node_tamper_guard "https://github.com/somchaimontha/rdf/blob/main/assets/js/tamper-guard.js"
click node_config "https://github.com/somchaimontha/rdf/blob/main/assets/js/config.js"
click node_api "https://github.com/somchaimontha/rdf/blob/main/assets/js/api.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_students,node_student_form,node_student_profile,node_dashboard,node_staff toneBlue
class node_academic_terms,node_academic_results,node_promotion,node_reports toneAmber
class node_settings,node_custom_fields,node_i18n,node_dynamic_fields,node_auth,node_rbac,node_ocr,node_tamper_guard toneMint
class node_config,node_api,node_gas,node_spreadsheet toneRose
```

## Components

### Student records

- [Students](https://github.com/somchaimontha/rdf/blob/main/students.html): `students.html`
- [Student form](https://github.com/somchaimontha/rdf/blob/main/student-form.html): `student-form.html`
- [Student profile](https://github.com/somchaimontha/rdf/blob/main/student-profile.html): `student-profile.html`
- [Dashboard](https://github.com/somchaimontha/rdf/blob/main/dashboard.html): `dashboard.html`

### Academic workflows

- [Academic terms](https://github.com/somchaimontha/rdf/blob/main/academic-terms.html): `academic-terms.html`
- [Academic results](https://github.com/somchaimontha/rdf/blob/main/academic-results.html): `academic-results.html`
- [Promotion](https://github.com/somchaimontha/rdf/blob/main/promotion.html): `promotion.html`
- [Reports](https://github.com/somchaimontha/rdf/blob/main/reports.html): `reports.html`

### Shared services

- [Settings](https://github.com/somchaimontha/rdf/blob/main/settings.html): `settings.html`
- [Custom fields](https://github.com/somchaimontha/rdf/blob/main/custom-fields.html): `custom-fields.html`
- [Thai/English](https://github.com/somchaimontha/rdf/blob/main/assets/js/i18n.js): `assets/js/i18n.js`
- [Dynamic fields](https://github.com/somchaimontha/rdf/blob/main/assets/js/dynamic-fields.js): `assets/js/dynamic-fields.js`
- [Authentication](https://github.com/somchaimontha/rdf/blob/main/assets/js/auth.js): `assets/js/auth.js`
- [Access control](https://github.com/somchaimontha/rdf/blob/main/assets/js/rbac.js): `assets/js/rbac.js`
- [OCR](https://github.com/somchaimontha/rdf/blob/main/assets/js/ocr.js): `assets/js/ocr.js`
- [Tamper protection](https://github.com/somchaimontha/rdf/blob/main/assets/js/tamper-guard.js): `assets/js/tamper-guard.js`

### Data integration

- [Configuration](https://github.com/somchaimontha/rdf/blob/main/assets/js/config.js): `assets/js/config.js`
- [API client](https://github.com/somchaimontha/rdf/blob/main/assets/js/api.js): `assets/js/api.js`
- **Apps Script backend**
- **Database spreadsheet**

### Other components

- **Staff user**

## Connections

- Staff user → Students: manages records
- Staff user → Dashboard: views overview
- Staff user → Academic terms: manages terms
- Staff user → Academic results: views results
- Staff user → Promotion: manages promotion
- Staff user → Reports: views reports
- Staff user → Settings: configures app
- Staff user → Custom fields: configures fields
- Students → Student form: edits records
- Students → Student profile: opens profile
- Thai/English → Students: translates interface
- Thai/English → Reports: localizes charts
- API client → Apps Script backend: calls backend
- Apps Script backend → Database spreadsheet: reads and writes
