# rupeshkeesaram/medisupply-demo architecture

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

- Interactive diagram: https://gitdiagram.com/rupeshkeesaram/medisupply-demo
- Repository: https://github.com/rupeshkeesaram/medisupply-demo

## Overview

MediSupply is a fictional pharmacy procurement portal. Pharmacy staff sign in, search the catalog, build and quote a cart, then submit an order that reserves stock; they can track and cancel eligible orders. Administrators adjust inventory and advance fulfillment. The graph follows the browser-to-HTTP workflow and the sampled server, order-policy and SQLite layers. Dashboard and inventory views are documented capabilities, but their complete implementations were not sampled, so their internal links are omitted where evidence is unavailable.

Main entry points: [`static/app.js`](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/static/app.js) (Portal UI), [`store.py`](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/store.py) (Workspace storage), [`server.py`](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/server.py) (Cart and order API), [`orders.py`](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/orders.py) (Quotation and cart pricing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser portal"]
  node_ui["Portal UI<br/>[app.js]"]
  node_dashboard["Dashboard view<br/>[app.js]"]
  node_inventory_view["Inventory view<br/>[app.js]"]
  node_order_history["Order history and tracking<br/>[app.js]"]
end

subgraph group_http["HTTP application"]
  node_session["Session access<br/>[server.py]"]
  node_catalog_api["Catalog and quote API<br/>[server.py]"]
  node_order_api["Cart and order API<br/>[server.py]"]
  node_fulfillment_api["Fulfillment and inventory API<br/>[server.py]"]
end

subgraph group_domain["Ordering domain"]
  node_catalog_policy["Catalog policy<br/>[orders.py]"]
  node_quotation["Quotation and cart pricing<br/>[orders.py]"]
  node_order_lifecycle["Order lifecycle<br/>[orders.py]"]
end

subgraph group_persistence["Workspace persistence"]
  node_workspace[("Workspace storage<br/>[store.py]")]
end

node_pharmacy(("Pharmacy staff"))
node_admin(("Distribution admin"))

node_pharmacy -->|"uses"| node_ui
node_admin -->|"uses"| node_ui
node_ui -->|"requests session"| node_session
node_ui -->|"requests catalog"| node_catalog_api
node_ui -->|"requests cart"| node_order_api
node_ui -->|"renders"| node_dashboard
node_ui -->|"renders"| node_inventory_view
node_ui -->|"renders"| node_order_history
node_session -->|"loads and saves"| node_workspace
node_catalog_api -->|"builds product views"| node_catalog_policy
node_catalog_api -->|"calculates quote"| node_quotation
node_order_api -->|"prices cart"| node_quotation
node_order_api -->|"creates orders"| node_order_lifecycle
node_order_api -->|"updates workspace"| node_workspace
node_fulfillment_api -->|"advances orders"| node_order_lifecycle
node_fulfillment_api -->|"updates inventory"| node_workspace
node_catalog_policy -.->|"reads products"| node_workspace
node_quotation -.->|"reads stock and prices"| node_workspace
node_order_lifecycle -.->|"reserves stock"| node_workspace

click node_ui "https://github.com/rupeshkeesaram/medisupply-demo/blob/main/static/app.js"
click node_session "https://github.com/rupeshkeesaram/medisupply-demo/blob/main/server.py"
click node_catalog_api "https://github.com/rupeshkeesaram/medisupply-demo/blob/main/server.py"
click node_order_api "https://github.com/rupeshkeesaram/medisupply-demo/blob/main/server.py"
click node_fulfillment_api "https://github.com/rupeshkeesaram/medisupply-demo/blob/main/server.py"
click node_catalog_policy "https://github.com/rupeshkeesaram/medisupply-demo/blob/main/orders.py"
click node_quotation "https://github.com/rupeshkeesaram/medisupply-demo/blob/main/orders.py"
click node_order_lifecycle "https://github.com/rupeshkeesaram/medisupply-demo/blob/main/orders.py"
click node_workspace "https://github.com/rupeshkeesaram/medisupply-demo/blob/main/store.py"
click node_dashboard "https://github.com/rupeshkeesaram/medisupply-demo/blob/main/static/app.js"
click node_inventory_view "https://github.com/rupeshkeesaram/medisupply-demo/blob/main/static/app.js"
click node_order_history "https://github.com/rupeshkeesaram/medisupply-demo/blob/main/static/app.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_ui,node_dashboard,node_inventory_view,node_order_history toneBlue
class node_session,node_catalog_api,node_order_api,node_fulfillment_api toneAmber
class node_catalog_policy,node_quotation,node_order_lifecycle toneMint
class node_workspace toneRose
class node_pharmacy,node_admin toneIndigo
```

## Components

### Browser portal

- [Portal UI](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/static/app.js): `static/app.js`
- [Dashboard view](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/static/app.js): `static/app.js`
- [Inventory view](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/static/app.js): `static/app.js`
- [Order history and tracking](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/static/app.js): `static/app.js`

### HTTP application

- [Session access](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/server.py): `server.py`
- [Catalog and quote API](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/server.py): `server.py`
- [Cart and order API](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/server.py): `server.py`
- [Fulfillment and inventory API](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/server.py): `server.py`

### Ordering domain

- [Catalog policy](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/orders.py): `orders.py`
- [Quotation and cart pricing](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/orders.py): `orders.py`
- [Order lifecycle](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/orders.py): `orders.py`

### Workspace persistence

- [Workspace storage](https://github.com/rupeshkeesaram/medisupply-demo/blob/main/store.py): `store.py`

### Other components

- **Pharmacy staff**
- **Distribution admin**

## Connections

- Pharmacy staff → Portal UI: uses (evidence: `README.md`)
- Distribution admin → Portal UI: uses (evidence: `README.md`)
- Portal UI → Session access: requests session (evidence: `static/app.js`)
- Portal UI → Catalog and quote API: requests catalog (evidence: `static/app.js`)
- Portal UI → Cart and order API: requests cart (evidence: `static/app.js`)
- Portal UI → Dashboard view: renders (evidence: `static/app.js`)
- Portal UI → Inventory view: renders (evidence: `static/app.js`)
- Portal UI → Order history and tracking: renders (evidence: `static/app.js`)
- Session access → Workspace storage: loads and saves (evidence: `server.py`)
- Catalog and quote API → Catalog policy: builds product views (evidence: `server.py`)
- Catalog and quote API → Quotation and cart pricing: calculates quote (evidence: `server.py`)
- Cart and order API → Quotation and cart pricing: prices cart (evidence: `server.py`)
- Cart and order API → Order lifecycle: creates orders (evidence: `server.py`)
- Cart and order API → Workspace storage: updates workspace (evidence: `server.py`)
- Fulfillment and inventory API → Order lifecycle: advances orders (evidence: `server.py`)
- Fulfillment and inventory API → Workspace storage: updates inventory (evidence: `server.py`)
- Catalog policy → Workspace storage: reads products
- Quotation and cart pricing → Workspace storage: reads stock and prices
- Order lifecycle → Workspace storage: reserves stock
