# davy2898/microservicepharmacy architecture

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

- Interactive diagram: https://gitdiagram.com/davy2898/microservicepharmacy
- Repository: https://github.com/davy2898/microservicepharmacy

## Overview

This repository implements a pharmacy-management application: staff use a Vue interface to manage medicines, stock, prescriptions, and pharmacy configuration; an Express API serves pharmacy data backed by PostgreSQL. A separate category service owns category CRUD, and the UI also includes dosage calculators. The sampled code confirms the prescription store’s API calls and the main backend’s database access. Several view-to-route and service integrations are represented by their tree paths but lack sampled wiring evidence, so uncertain links are omitted.

Main entry points: [`vue-project/pharmacy-backend/config/db.js`](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/config/db.js) (Database connection), [`vue-project/src/App.vue`](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/App.vue) (App shell), [`vue-project/pharmacy-backend/server.js`](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/server.js) (Prescription endpoints), [`pharmacy-category-service/config/db.js`](https://github.com/davy2898/microservicepharmacy/blob/master/pharmacy-category-service/config/db.js) (Category DB connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Pharmacy interface"]
  node_app["App shell<br/>[App.vue]"]
  node_sidebar["Navigation<br/>[Sidebar.vue]"]
  node_pharmacy_view["Pharmacy operations<br/>[PharmacyView.vue]"]
  node_inventory_view["Inventory<br/>[InventoryView.vue]"]
  node_medicine_view["Medicines<br/>[MedicineView.vue]"]
  node_settings_views["Reference settings<br/>[CategoryView.vue]"]
  node_other_settings["Additional settings<br/>[UnitView.vue]"]
  node_other_views["Other configuration views<br/>[TemplateView.vue]"]
  node_pharmacy_store["Prescription store<br/>[pharmacyStore.js]"]
  node_i18n["Localization<br/>[i18n.js]"]
end

subgraph group_api["Pharmacy API"]
  node_main_api["Pharmacy API<br/>[server.js]"]
  node_prescription_api["Prescription endpoints<br/>[server.js]"]
  node_inventory_api["Inventory endpoints<br/>[server.js]"]
  node_catalog_api["Medicine and settings endpoints<br/>[server.js]"]
  node_pharmacy_db_config["Database connection<br/>[db.js]"]
  node_pharmacy_db[("Pharmacy PostgreSQL")]
  node_stock_import["Stock import<br/>[import-stock.js]"]
end

subgraph group_category["Category service"]
  node_category_api["Category CRUD API<br/>[server.js]"]
  node_category_db_config["Category DB connection<br/>[db.js]"]
  node_category_db[("Category PostgreSQL")]
end

subgraph group_dosage["Dosage tools"]
  node_dosage_view["Dosage workspace<br/>[DosageView.vue]"]
  node_dosage_service["Dosage service<br/>[dosageService.js]"]
  node_dosage_calculators["Dosage calculators"]
end

node_staff(("Pharmacy staff"))

node_staff -->|"uses"| node_app
node_app -->|"renders"| node_sidebar
node_pharmacy_store -->|"requests"| node_prescription_api
node_prescription_api -->|"queries"| node_pharmacy_db_config
node_inventory_api -->|"queries"| node_pharmacy_db_config
node_catalog_api -->|"queries"| node_pharmacy_db_config
node_stock_import -->|"writes"| node_pharmacy_db_config
node_pharmacy_db_config -->|"connects"| node_pharmacy_db
node_category_api -->|"queries"| node_category_db_config
node_category_db_config -->|"connects"| node_category_db

click node_app "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/App.vue"
click node_sidebar "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/components/Sidebar.vue"
click node_pharmacy_view "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/PharmacyView.vue"
click node_inventory_view "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/InventoryView.vue"
click node_medicine_view "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/MedicineView.vue"
click node_settings_views "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/CategoryView.vue"
click node_other_settings "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/UnitView.vue"
click node_other_views "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/TemplateView.vue"
click node_pharmacy_store "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/stores/pharmacyStore.js"
click node_i18n "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/i18n.js"
click node_main_api "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/server.js"
click node_prescription_api "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/server.js"
click node_inventory_api "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/server.js"
click node_catalog_api "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/server.js"
click node_pharmacy_db_config "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/config/db.js"
click node_stock_import "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/import-stock.js"
click node_category_api "https://github.com/davy2898/microservicepharmacy/blob/master/pharmacy-category-service/server.js"
click node_category_db_config "https://github.com/davy2898/microservicepharmacy/blob/master/pharmacy-category-service/config/db.js"
click node_dosage_view "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/dosage/DosageView.vue"
click node_dosage_service "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/services/dosageService.js"
click node_dosage_calculators "https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/dosage/components/PediatricDosageCalculator.vue"

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_app,node_sidebar,node_pharmacy_view,node_inventory_view,node_medicine_view,node_settings_views,node_other_settings,node_other_views,node_pharmacy_store,node_i18n toneBlue
class node_main_api,node_prescription_api,node_inventory_api,node_catalog_api,node_pharmacy_db_config,node_pharmacy_db,node_stock_import toneAmber
class node_category_api,node_category_db_config,node_category_db toneMint
class node_dosage_view,node_dosage_service,node_dosage_calculators toneRose
class node_staff toneIndigo
```

## Components

### Pharmacy interface

- [App shell](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/App.vue): `vue-project/src/App.vue`
- [Navigation](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/components/Sidebar.vue): `vue-project/src/components/Sidebar.vue`
- [Pharmacy operations](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/PharmacyView.vue): `vue-project/src/views/PharmacyView.vue`
- [Inventory](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/InventoryView.vue): `vue-project/src/views/InventoryView.vue`
- [Medicines](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/MedicineView.vue): `vue-project/src/views/MedicineView.vue`
- [Reference settings](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/CategoryView.vue): `vue-project/src/views/CategoryView.vue`
- [Additional settings](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/UnitView.vue): `vue-project/src/views/UnitView.vue`
- [Other configuration views](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/TemplateView.vue): `vue-project/src/views/TemplateView.vue`
- [Prescription store](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/stores/pharmacyStore.js): `vue-project/src/stores/pharmacyStore.js`
- [Localization](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/i18n.js): `vue-project/src/i18n.js`

### Pharmacy API

- [Pharmacy API](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/server.js): `vue-project/pharmacy-backend/server.js`
- [Prescription endpoints](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/server.js): `vue-project/pharmacy-backend/server.js`
- [Inventory endpoints](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/server.js): `vue-project/pharmacy-backend/server.js`
- [Medicine and settings endpoints](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/server.js): `vue-project/pharmacy-backend/server.js`
- [Database connection](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/config/db.js): `vue-project/pharmacy-backend/config/db.js`
- **Pharmacy PostgreSQL**
- [Stock import](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/import-stock.js): `vue-project/pharmacy-backend/import-stock.js`

### Category service

- [Category CRUD API](https://github.com/davy2898/microservicepharmacy/blob/master/pharmacy-category-service/server.js): `pharmacy-category-service/server.js`
- [Category DB connection](https://github.com/davy2898/microservicepharmacy/blob/master/pharmacy-category-service/config/db.js): `pharmacy-category-service/config/db.js`
- **Category PostgreSQL**

### Dosage tools

- [Dosage workspace](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/dosage/DosageView.vue): `vue-project/src/views/dosage/DosageView.vue`
- [Dosage service](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/pharmacy-backend/services/dosageService.js): `vue-project/pharmacy-backend/services/dosageService.js`
- [Dosage calculators](https://github.com/davy2898/microservicepharmacy/blob/master/vue-project/src/views/dosage/components/PediatricDosageCalculator.vue): `vue-project/src/views/dosage/components/PediatricDosageCalculator.vue`

### Other components

- **Pharmacy staff**

## Connections

- Pharmacy staff → App shell: uses
- App shell → Navigation: renders (evidence: `vue-project/src/App.vue`)
- Prescription store → Prescription endpoints: requests (evidence: `vue-project/src/stores/pharmacyStore.js`)
- Prescription endpoints → Database connection: queries (evidence: `vue-project/pharmacy-backend/server.js`)
- Inventory endpoints → Database connection: queries (evidence: `vue-project/pharmacy-backend/server.js`)
- Medicine and settings endpoints → Database connection: queries (evidence: `vue-project/pharmacy-backend/server.js`)
- Stock import → Database connection: writes (evidence: `vue-project/pharmacy-backend/import-stock.js`)
- Database connection → Pharmacy PostgreSQL: connects (evidence: `vue-project/pharmacy-backend/config/db.js`)
- Category CRUD API → Category DB connection: queries (evidence: `pharmacy-category-service/server.js`)
- Category DB connection → Category PostgreSQL: connects (evidence: `pharmacy-category-service/config/db.js`)
