# kailashkalidoss/vascflow architecture

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

- Interactive diagram: https://gitdiagram.com/kailashkalidoss/vascflow
- Repository: https://github.com/kailashkalidoss/vascflow

## Overview

VascFlow is an offline-capable ABI wellness tracker: a user enters or scans blood-pressure readings, reviews calculated ABI results, and can save sessions or export a printable summary. Its main runtime is a single vanilla-JavaScript application, with localStorage for drafts and history and a service worker for cached access. The excerpts show the calculation, history, camera/OCR, export, and caching responsibilities, but not every handoff between them; uncertain links are omitted.

Main entry points: [`app.js`](https://github.com/kailashkalidoss/vascflow/blob/main/app.js) (Reading entry), [`sw.js`](https://github.com/kailashkalidoss/vascflow/blob/main/sw.js) (Cache handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Measurement workflow"]
  node_entry["Reading entry<br/>[app.js]"]
  node_validation["Input validation<br/>[app.js]"]
  node_abi["ABI calculation<br/>[app.js]"]
end

subgraph group_results["Results and records"]
  node_resultsview["Results view<br/>[app.js]"]
  node_classification["ABI categories<br/>[app.js]"]
  node_history["Session history<br/>[app.js]"]
  node_drafts["Draft persistence<br/>[app.js]"]
  node_storage[("Local storage")]
  node_pdf["Printable export<br/>[app.js]"]
end

subgraph group_capture["Reading capture"]
  node_camera["Device camera"]
  node_ocr["Text recognition<br/>[app.js]"]
  node_tesseract["Tesseract.js"]
end

subgraph group_offline["Offline support"]
  node_serviceworker["Cache handler<br/>[sw.js]"]
  node_cache[("Asset cache")]
end

node_user(("User"))
node_network["Network"]

node_user -->|"enters readings"| node_entry
node_entry -->|"checks pressures"| node_validation
node_validation -->|"calculates maxima"| node_abi
node_abi -->|"renders results"| node_resultsview
node_resultsview -->|"categorizes ABI"| node_classification
node_entry -->|"persists draft"| node_drafts
node_drafts -->|"writes draft"| node_storage
node_history -->|"reads sessions"| node_storage
node_user -->|"saves session"| node_history
node_user -->|"exports summary"| node_pdf
node_user -->|"starts scan"| node_camera
node_camera -->|"provides image"| node_ocr
node_ocr -->|"recognizes text"| node_tesseract
node_serviceworker -->|"caches assets"| node_cache
node_serviceworker -->|"fetches misses"| node_network
node_network -->|"returns response"| node_serviceworker

click node_entry "https://github.com/kailashkalidoss/vascflow/blob/main/app.js"
click node_validation "https://github.com/kailashkalidoss/vascflow/blob/main/app.js"
click node_abi "https://github.com/kailashkalidoss/vascflow/blob/main/app.js"
click node_resultsview "https://github.com/kailashkalidoss/vascflow/blob/main/app.js"
click node_classification "https://github.com/kailashkalidoss/vascflow/blob/main/app.js"
click node_history "https://github.com/kailashkalidoss/vascflow/blob/main/app.js"
click node_drafts "https://github.com/kailashkalidoss/vascflow/blob/main/app.js"
click node_pdf "https://github.com/kailashkalidoss/vascflow/blob/main/app.js"
click node_ocr "https://github.com/kailashkalidoss/vascflow/blob/main/app.js"
click node_serviceworker "https://github.com/kailashkalidoss/vascflow/blob/main/sw.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_entry,node_validation,node_abi,node_user toneBlue
class node_resultsview,node_classification,node_history,node_drafts,node_storage,node_pdf toneAmber
class node_camera,node_ocr,node_tesseract toneMint
class node_serviceworker,node_cache toneRose
class node_network toneIndigo
```

## Components

### Measurement workflow

- [Reading entry](https://github.com/kailashkalidoss/vascflow/blob/main/app.js): `app.js`
- [Input validation](https://github.com/kailashkalidoss/vascflow/blob/main/app.js): `app.js`
- [ABI calculation](https://github.com/kailashkalidoss/vascflow/blob/main/app.js): `app.js`

### Results and records

- [Results view](https://github.com/kailashkalidoss/vascflow/blob/main/app.js): `app.js`
- [ABI categories](https://github.com/kailashkalidoss/vascflow/blob/main/app.js): `app.js`
- [Session history](https://github.com/kailashkalidoss/vascflow/blob/main/app.js): `app.js`
- [Draft persistence](https://github.com/kailashkalidoss/vascflow/blob/main/app.js): `app.js`
- **Local storage**
- [Printable export](https://github.com/kailashkalidoss/vascflow/blob/main/app.js): `app.js`

### Reading capture

- **Device camera**
- [Text recognition](https://github.com/kailashkalidoss/vascflow/blob/main/app.js): `app.js`
- **Tesseract.js**

### Offline support

- [Cache handler](https://github.com/kailashkalidoss/vascflow/blob/main/sw.js): `sw.js`
- **Asset cache**

### Other components

- **User**
- **Network**

## Connections

- User → Reading entry: enters readings (evidence: `app.js`)
- Reading entry → Input validation: checks pressures (evidence: `app.js`)
- Input validation → ABI calculation: calculates maxima (evidence: `app.js`)
- ABI calculation → Results view: renders results (evidence: `app.js`)
- Results view → ABI categories: categorizes ABI (evidence: `app.js`)
- Reading entry → Draft persistence: persists draft (evidence: `app.js`)
- Draft persistence → Local storage: writes draft (evidence: `app.js`)
- Session history → Local storage: reads sessions (evidence: `app.js`)
- User → Session history: saves session (evidence: `app.js`)
- User → Printable export: exports summary (evidence: `app.js`)
- User → Device camera: starts scan
- Device camera → Text recognition: provides image (evidence: `app.js`)
- Text recognition → Tesseract.js: recognizes text (evidence: `app.js`)
- Cache handler → Asset cache: caches assets (evidence: `sw.js`)
- Cache handler → Network: fetches misses (evidence: `sw.js`)
- Network → Cache handler: returns response (evidence: `sw.js`)
