# byzaeemazhar/homoeoclinic architecture

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

- Interactive diagram: https://gitdiagram.com/byzaeemazhar/homoeoclinic
- Repository: https://github.com/byzaeemazhar/homoeoclinic

## Overview

HomoeoClinic is an offline clinic and homoeopathic-store app. Its main workflow spans medicine and delivery stock, patient visits and prescriptions, sales, and backup; reporting, cash expenses, alerts, and sharing support that workflow. The excerpts show boot and database initialization, stock and patient logic, order and sales views, backup behavior, and native file/PDF handling. Several view modules are only partially sampled, so their documented capabilities are represented without asserting unshown internal calls.

Main entry points: [`src/core.js`](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/core.js) (Offline database), [`src/main.js`](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/main.js) (Boot and access), [`src/views3.js`](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views3.js) (Patients and prescriptions), [`src/views4.js`](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views4.js) (Backup and restore)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Shell"]
  node_boot["Boot and access<br/>[main.js]"]
  node_database[("Offline database<br/>[core.js]")]
  node_ui["UI toolkit<br/>[ui.js]"]
end

subgraph group_inventory["Stock and Sales"]
  node_stock["Stock ledger<br/>[logic.js]"]
  node_sales["Sales and POS<br/>[views1.js]"]
  node_orders["Orders and deliveries<br/>[views2.js]"]
end

subgraph group_clinic["Clinic and Insights"]
  node_patientlogic["Patient courses<br/>[logic2.js]"]
  node_patients["Patients and prescriptions<br/>[views3.js]"]
  node_reports["Reports and alerts<br/>[views3.js]"]
  node_cash["Cash and packages<br/>[views1.js]"]
end

subgraph group_safety["Data and Sharing"]
  node_backup["Backup and restore<br/>[views4.js]"]
  node_native["Phone file sharing<br/>[native.js]"]
  node_offline["Offline cache<br/>[sw.js]"]
end

node_staff(("Clinic staff"))

node_staff -.->|"uses"| node_boot
node_boot -->|"initializes"| node_database
node_boot -.->|"builds shell"| node_ui
node_sales -->|"reads and writes"| node_database
node_stock -->|"reads ledger"| node_database
node_orders -->|"stores orders"| node_database
node_patients -->|"reads and writes"| node_database
node_patients -.->|"uses course logic"| node_patientlogic
node_reports -.->|"reads records"| node_database
node_cash -->|"stores entries"| node_database
node_backup -->|"exports and imports"| node_database
node_backup -->|"saves snapshots"| node_native
node_native -.->|"shares files"| node_staff
node_offline -->|"serves cached app"| node_staff

click node_boot "https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/main.js"
click node_database "https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/core.js"
click node_ui "https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/ui.js"
click node_stock "https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/logic.js"
click node_sales "https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views1.js"
click node_orders "https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views2.js"
click node_patientlogic "https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/logic2.js"
click node_patients "https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views3.js"
click node_reports "https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views3.js"
click node_cash "https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views1.js"
click node_backup "https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views4.js"
click node_native "https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/native.js"
click node_offline "https://github.com/byzaeemazhar/homoeoclinic/blob/main/www/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_boot,node_database,node_ui toneBlue
class node_stock,node_sales,node_orders toneAmber
class node_patientlogic,node_patients,node_reports,node_cash toneMint
class node_backup,node_native,node_offline toneRose
class node_staff toneIndigo
```

## Components

### App Shell

- [Boot and access](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/main.js): `src/main.js`
- [Offline database](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/core.js): `src/core.js`
- [UI toolkit](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/ui.js): `src/ui.js`

### Stock and Sales

- [Stock ledger](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/logic.js): `src/logic.js`
- [Sales and POS](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views1.js): `src/views1.js`
- [Orders and deliveries](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views2.js): `src/views2.js`

### Clinic and Insights

- [Patient courses](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/logic2.js): `src/logic2.js`
- [Patients and prescriptions](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views3.js): `src/views3.js`
- [Reports and alerts](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views3.js): `src/views3.js`
- [Cash and packages](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views1.js): `src/views1.js`

### Data and Sharing

- [Backup and restore](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/views4.js): `src/views4.js`
- [Phone file sharing](https://github.com/byzaeemazhar/homoeoclinic/blob/main/src/native.js): `src/native.js`
- [Offline cache](https://github.com/byzaeemazhar/homoeoclinic/blob/main/www/sw.js): `www/sw.js`

### Other components

- **Clinic staff**

## Connections

- Clinic staff → Boot and access: uses (evidence: `README.md`)
- Boot and access → Offline database: initializes (evidence: `src/main.js`)
- Boot and access → UI toolkit: builds shell (evidence: `src/main.js`)
- Sales and POS → Offline database: reads and writes (evidence: `src/views1.js`)
- Stock ledger → Offline database: reads ledger (evidence: `src/logic.js`)
- Orders and deliveries → Offline database: stores orders (evidence: `src/views2.js`)
- Patients and prescriptions → Offline database: reads and writes (evidence: `src/views3.js`)
- Patients and prescriptions → Patient courses: uses course logic
- Reports and alerts → Offline database: reads records
- Cash and packages → Offline database: stores entries (evidence: `src/views1.js`)
- Backup and restore → Offline database: exports and imports (evidence: `src/views4.js`)
- Backup and restore → Phone file sharing: saves snapshots (evidence: `src/views4.js`)
- Phone file sharing → Clinic staff: shares files (evidence: `README.md`)
- Offline cache → Clinic staff: serves cached app (evidence: `www/sw.js`)
