# maheshkarri07-lab/pharmamitra-app-v3 architecture

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

- Interactive diagram: https://gitdiagram.com/maheshkarri07-lab/pharmamitra-app-v3
- Repository: https://github.com/maheshkarri07-lab/pharmamitra-app-v3

## Overview

PHARMAMITRA is an offline Windows pharmacy billing and record-keeping application. The user workflow begins at sign-in, then supports billing and stock checks, with bills, summaries, backups, and records saved locally; settings and user administration provide operational controls. Electron’s preload bridge exposes renderer-facing operations to the main process, which owns local file access and PDF generation. The README documents product capabilities, but index.html was not sampled, so links from individual screens to bridge operations are unverified and omitted.

Main entry points: [`main.js`](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/main.js) (Electron main process), [`index.html`](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html) (Sign-in and lock), [`preload.js`](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/preload.js) (Renderer API bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Pharmacy workflow"]
  node_signin["Sign-in and lock<br/>[index.html]"]
  node_billing["Billing and H1<br/>[index.html]"]
  node_inventory["Stock and expiry<br/>[index.html]"]
  node_doctors["Doctors<br/>[index.html]"]
  node_admin["Settings and users<br/>[index.html]"]
end

subgraph group_records["Records and exports"]
  node_calendar["Calendar summaries<br/>[index.html]"]
  node_orders["Order notes<br/>[index.html]"]
  node_exports["Excel exports<br/>[index.html]"]
  node_live_data[("Live data files<br/>[main.js]")]
  node_period_records[("Period records<br/>[main.js]")]
  node_backup_files[("Backup files<br/>[main.js]")]
  node_pdf_files[("PDF files<br/>[main.js]")]
end

subgraph group_desktop["Desktop runtime"]
  node_bridge["Renderer API bridge<br/>[preload.js]"]
  node_runtime["Electron main process<br/>[main.js]"]
end

node_user(("Pharmacy user"))

node_user -->|"signs in"| node_signin
node_user -->|"creates bills"| node_billing
node_user -->|"reviews summaries"| node_calendar
node_user -->|"saves notes"| node_orders
node_user -->|"configures access"| node_admin
node_runtime -->|"loads window"| node_signin
node_bridge -->|"invokes handlers"| node_runtime
node_runtime -->|"reads and writes"| node_live_data
node_runtime -->|"writes backups"| node_backup_files
node_runtime -->|"writes files"| node_period_records
node_runtime -->|"renders PDFs"| node_pdf_files

click node_signin "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html"
click node_billing "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html"
click node_inventory "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html"
click node_doctors "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html"
click node_admin "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html"
click node_calendar "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html"
click node_orders "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html"
click node_exports "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html"
click node_bridge "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/preload.js"
click node_runtime "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/main.js"
click node_live_data "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/main.js"
click node_period_records "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/main.js"
click node_backup_files "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/main.js"
click node_pdf_files "https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/main.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_signin,node_billing,node_inventory,node_doctors,node_admin,node_user toneBlue
class node_calendar,node_orders,node_exports,node_live_data,node_period_records,node_backup_files,node_pdf_files toneAmber
class node_bridge,node_runtime toneMint
```

## Components

### Pharmacy workflow

- [Sign-in and lock](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html): `index.html`
- [Billing and H1](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html): `index.html`
- [Stock and expiry](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html): `index.html`
- [Doctors](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html): `index.html`
- [Settings and users](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html): `index.html`

### Records and exports

- [Calendar summaries](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html): `index.html`
- [Order notes](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html): `index.html`
- [Excel exports](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/index.html): `index.html`
- [Live data files](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/main.js): `main.js`
- [Period records](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/main.js): `main.js`
- [Backup files](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/main.js): `main.js`
- [PDF files](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/main.js): `main.js`

### Desktop runtime

- [Renderer API bridge](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/preload.js): `preload.js`
- [Electron main process](https://github.com/maheshkarri07-lab/pharmamitra-app-v3/blob/main/main.js): `main.js`

### Other components

- **Pharmacy user**

## Connections

- Pharmacy user → Sign-in and lock: signs in (evidence: `README.md`)
- Pharmacy user → Billing and H1: creates bills (evidence: `README.md`)
- Pharmacy user → Calendar summaries: reviews summaries (evidence: `README.md`)
- Pharmacy user → Order notes: saves notes (evidence: `README.md`)
- Pharmacy user → Settings and users: configures access (evidence: `README.md`)
- Electron main process → Sign-in and lock: loads window (evidence: `main.js`)
- Renderer API bridge → Electron main process: invokes handlers (evidence: `preload.js`)
- Electron main process → Live data files: reads and writes (evidence: `main.js`)
- Electron main process → Backup files: writes backups (evidence: `main.js`)
- Electron main process → Period records: writes files (evidence: `main.js`)
- Electron main process → PDF files: renders PDFs (evidence: `main.js`)
