# sienta01/temp-curve architecture

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

- Interactive diagram: https://gitdiagram.com/sienta01/temp-curve
- Repository: https://github.com/sienta01/temp-curve

## Overview

Kurva Suhu is an Indonesian patient temperature-log application. Users enter patient details, temperatures, and daily PELOD-2 and Candida data; the app calculates scores and renders a printable chart, then saves locally or syncs patients through the server. It also supports exports and backup/restore. The README documents how the parts fit together, while excerpts show grid/model, score-table/calculator, chart/model, and storage/server behavior. The application coordinator and some export/restore wiring are unsampled, so those links rely on README statements.

Main entry points: [`js/app.js`](https://github.com/sienta01/temp-curve/blob/main/js/app.js) (App coordinator), [`js/score-table.js`](https://github.com/sienta01/temp-curve/blob/main/js/score-table.js) (Daily score tables), [`js/store.js`](https://github.com/sienta01/temp-curve/blob/main/js/store.js) (Patient store), [`server/server.js`](https://github.com/sienta01/temp-curve/blob/main/server/server.js) (Sync server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Patient entry"]
  node_page["App page<br/>[index.html]"]
  node_app["App coordinator<br/>[app.js]"]
  node_model["Patient model<br/>[model.js]"]
  node_grid["Temperature spreadsheet<br/>[grid.js]"]
end

subgraph group_clinical["Clinical scoring"]
  node_scoretable["Daily score tables<br/>[score-table.js]"]
  node_pelod["PELOD-2 scoring<br/>[pelod.js]"]
  node_candida["Candida scoring<br/>[candida.js]"]
end

subgraph group_output["Chart and export"]
  node_chart["Temperature chart<br/>[chart.js]"]
  node_export["Export and restore<br/>[app.js]"]
end

subgraph group_persistence["Storage and sync"]
  node_store["Patient store<br/>[store.js]"]
  node_browserdata[("Browser storage")]
  node_server["Sync server<br/>[server.js]"]
  node_patientfiles[("Patient files")]
  node_backups[("Daily backups")]
end

node_user(("Care team"))

node_user -->|"uses"| node_page
node_page -->|"loads"| node_app
node_app -->|"connects"| node_grid
node_grid -->|"updates"| node_model
node_app -->|"connects"| node_scoretable
node_scoretable -->|"reads and writes"| node_model
node_scoretable -->|"scores with"| node_pelod
node_scoretable -->|"scores with"| node_candida
node_app -->|"connects"| node_chart
node_chart -->|"reads"| node_model
node_app -->|"provides"| node_export
node_export -->|"exports"| node_chart
node_app -->|"connects"| node_store
node_store -->|"saves locally"| node_browserdata
node_store -->|"syncs with"| node_server
node_server -->|"reads and writes"| node_patientfiles
node_server -->|"creates"| node_backups

click node_page "https://github.com/sienta01/temp-curve/blob/main/index.html"
click node_app "https://github.com/sienta01/temp-curve/blob/main/js/app.js"
click node_model "https://github.com/sienta01/temp-curve/blob/main/js/model.js"
click node_grid "https://github.com/sienta01/temp-curve/blob/main/js/grid.js"
click node_scoretable "https://github.com/sienta01/temp-curve/blob/main/js/score-table.js"
click node_pelod "https://github.com/sienta01/temp-curve/blob/main/js/pelod.js"
click node_candida "https://github.com/sienta01/temp-curve/blob/main/js/candida.js"
click node_chart "https://github.com/sienta01/temp-curve/blob/main/js/chart.js"
click node_export "https://github.com/sienta01/temp-curve/blob/main/js/app.js"
click node_store "https://github.com/sienta01/temp-curve/blob/main/js/store.js"
click node_server "https://github.com/sienta01/temp-curve/blob/main/server/server.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_page,node_app,node_model,node_grid toneBlue
class node_scoretable,node_pelod,node_candida toneAmber
class node_chart,node_export toneMint
class node_store,node_browserdata,node_server,node_patientfiles,node_backups toneRose
class node_user toneIndigo
```

## Components

### Patient entry

- [App page](https://github.com/sienta01/temp-curve/blob/main/index.html): `index.html`
- [App coordinator](https://github.com/sienta01/temp-curve/blob/main/js/app.js): `js/app.js`
- [Patient model](https://github.com/sienta01/temp-curve/blob/main/js/model.js): `js/model.js`
- [Temperature spreadsheet](https://github.com/sienta01/temp-curve/blob/main/js/grid.js): `js/grid.js`

### Clinical scoring

- [Daily score tables](https://github.com/sienta01/temp-curve/blob/main/js/score-table.js): `js/score-table.js`
- [PELOD-2 scoring](https://github.com/sienta01/temp-curve/blob/main/js/pelod.js): `js/pelod.js`
- [Candida scoring](https://github.com/sienta01/temp-curve/blob/main/js/candida.js): `js/candida.js`

### Chart and export

- [Temperature chart](https://github.com/sienta01/temp-curve/blob/main/js/chart.js): `js/chart.js`
- [Export and restore](https://github.com/sienta01/temp-curve/blob/main/js/app.js): `js/app.js`

### Storage and sync

- [Patient store](https://github.com/sienta01/temp-curve/blob/main/js/store.js): `js/store.js`
- **Browser storage**
- [Sync server](https://github.com/sienta01/temp-curve/blob/main/server/server.js): `server/server.js`
- **Patient files**
- **Daily backups**

### Other components

- **Care team**

## Connections

- Care team → App page: uses (evidence: `README.md`)
- App page → App coordinator: loads (evidence: `README.md`)
- App coordinator → Temperature spreadsheet: connects (evidence: `README.md`)
- Temperature spreadsheet → Patient model: updates (evidence: `js/grid.js`)
- App coordinator → Daily score tables: connects (evidence: `README.md`)
- Daily score tables → Patient model: reads and writes (evidence: `js/score-table.js`)
- Daily score tables → PELOD-2 scoring: scores with (evidence: `js/score-table.js`)
- Daily score tables → Candida scoring: scores with (evidence: `js/score-table.js`)
- App coordinator → Temperature chart: connects (evidence: `README.md`)
- Temperature chart → Patient model: reads (evidence: `js/chart.js`)
- App coordinator → Export and restore: provides (evidence: `README.md`)
- Export and restore → Temperature chart: exports (evidence: `README.md`)
- App coordinator → Patient store: connects (evidence: `README.md`)
- Patient store → Browser storage: saves locally (evidence: `js/store.js`)
- Patient store → Sync server: syncs with (evidence: `js/store.js`)
- Sync server → Patient files: reads and writes (evidence: `server/server.js`)
- Sync server → Daily backups: creates (evidence: `server/server.js`)
