# mathieu7483/dashboard-pharma architecture

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

- Interactive diagram: https://gitdiagram.com/mathieu7483/dashboard-pharma
- Repository: https://github.com/mathieu7483/dashboard-pharma

## Overview

Pharmacy-Dashboard is an internal pharmacist web application for inventory, sales, people, scheduling, and operational records, with a natural-language assistant for stock and related queries. The main workflow is pharmacist interaction with the dashboard, HTTP requests to Flask endpoints, facade-mediated business operations, and persisted records. The README documents broader capabilities such as alerts, analytics, RBAC, and interaction checks; these are represented where the tree and excerpts support them. Some endpoint-to-facade links rely on SOURCE INDEX references rather than inspected endpoint bodies.

Main entry points: [`Server/services/facade.py`](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/services/facade.py) (Facade service), [`Server/app.py`](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/app.py) (App and routing), [`Server/core/chatbot/ChatBot_engine.py`](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/core/chatbot/ChatBot_engine.py) (Chatbot engine), [`Server/api/clients.py`](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/clients.py) (Clients and doctors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Dashboard client"]
  node_dashboard["Dashboard UI"]
  node_auth_ui["Authentication UI<br/>[auth.js]"]
  node_inventory_ui["Inventory UI<br/>[inventory.js]"]
  node_dashboard_ui["Dashboard views<br/>[dashboard.js]"]
end

subgraph group_api["Flask API"]
  node_flask_app["App and routing<br/>[app.py]"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_inventory_api["Inventory API<br/>[inventory.py]"]
  node_products_api["Products API<br/>[products.py]"]
  node_sales_api["Sales API<br/>[sales.py]"]
  node_analytics_api["Analytics API<br/>[analytics.py]"]
  node_people_api["Clients and doctors<br/>[clients.py]"]
  node_calendar_api["Calendar API<br/>[calendar_events.py]"]
  node_records_api["Operational records"]
  node_users_api["User management API<br/>[users.py]"]
  node_chat_api["Chatbot API<br/>[chatbot.py]"]
end

subgraph group_business["Business services"]
  node_access["Role access checks<br/>[decorator.py]"]
  node_facade["Facade service<br/>[facade.py]"]
end

subgraph group_domain["Domain and persistence"]
  node_product_model["Product and aliases<br/>[product.py]"]
  node_sales_model["Sales records<br/>[sale.py]"]
  node_people_models["Client and doctor records<br/>[client.py]"]
  node_calendar_model["Calendar events<br/>[calendar.py]"]
  node_other_models["Other domain records"]
  node_db_access[("Database access<br/>[data_manager.py]")]
end

subgraph group_assistant["Chatbot"]
  node_chat_engine["Chatbot engine<br/>[ChatBot_engine.py]"]
  node_nlu["Intent and entity analysis<br/>[NLUProcessor.py]"]
end

node_pharmacist(("Pharmacist"))

node_pharmacist -->|"uses"| node_dashboard
node_dashboard -.->|"sends requests"| node_flask_app
node_auth_ui -.->|"authenticates through"| node_flask_app
node_inventory_ui -.->|"requests inventory"| node_flask_app
node_dashboard_ui -.->|"requests dashboard data"| node_flask_app
node_flask_app -->|"registers"| node_auth_api
node_flask_app -->|"registers"| node_inventory_api
node_flask_app -->|"registers"| node_products_api
node_flask_app -->|"registers"| node_sales_api
node_flask_app -->|"registers"| node_analytics_api
node_flask_app -->|"registers"| node_people_api
node_flask_app -->|"registers"| node_calendar_api
node_flask_app -->|"registers"| node_records_api
node_flask_app -->|"registers"| node_users_api
node_auth_api -->|"delegates"| node_facade
node_inventory_api -->|"delegates"| node_facade
node_products_api -->|"delegates"| node_facade
node_sales_api -->|"delegates"| node_facade
node_analytics_api -->|"delegates"| node_facade
node_people_api -->|"delegates"| node_facade
node_users_api -->|"delegates"| node_facade
node_calendar_api -->|"queries"| node_db_access
node_calendar_api -->|"uses"| node_calendar_model
node_people_api -->|"checks admin access"| node_access
node_users_api -->|"checks admin access"| node_access
node_facade -->|"queries and persists"| node_db_access
node_facade -->|"manages"| node_product_model
node_facade -->|"manages"| node_sales_model
node_facade -->|"manages"| node_people_models
node_facade -->|"manages"| node_calendar_model
node_facade -->|"manages"| node_other_models
node_chat_api -->|"dispatches to"| node_chat_engine
node_chat_engine -->|"analyzes text with"| node_nlu
node_chat_engine -->|"uses services"| node_facade
node_chat_engine -->|"queries stock and aliases"| node_product_model
node_chat_engine -->|"queries sales"| node_sales_model
node_chat_engine -->|"queries events"| node_calendar_model
node_chat_engine -->|"queries records"| node_db_access

click node_dashboard "https://github.com/mathieu7483/dashboard-pharma/tree/main/Client/javascript"
click node_auth_ui "https://github.com/mathieu7483/dashboard-pharma/blob/main/Client/javascript/auth.js"
click node_inventory_ui "https://github.com/mathieu7483/dashboard-pharma/blob/main/Client/javascript/inventory.js"
click node_dashboard_ui "https://github.com/mathieu7483/dashboard-pharma/blob/main/Client/javascript/dashboard.js"
click node_flask_app "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/app.py"
click node_auth_api "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/auth.py"
click node_inventory_api "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/inventory.py"
click node_products_api "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/products.py"
click node_sales_api "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/sales.py"
click node_analytics_api "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/analytics.py"
click node_people_api "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/clients.py"
click node_calendar_api "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/calendar_events.py"
click node_records_api "https://github.com/mathieu7483/dashboard-pharma/tree/main/Server/api"
click node_users_api "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/users.py"
click node_access "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/utils/decorator.py"
click node_facade "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/services/facade.py"
click node_chat_api "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/chatbot.py"
click node_chat_engine "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/core/chatbot/ChatBot_engine.py"
click node_nlu "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/core/chatbot/NLUProcessor.py"
click node_product_model "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/models/product.py"
click node_sales_model "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/models/sale.py"
click node_people_models "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/models/client.py"
click node_calendar_model "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/models/calendar.py"
click node_other_models "https://github.com/mathieu7483/dashboard-pharma/tree/main/Server/models"
click node_db_access "https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/database/data_manager.py"

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_dashboard,node_auth_ui,node_inventory_ui,node_dashboard_ui toneBlue
class node_flask_app,node_auth_api,node_inventory_api,node_products_api,node_sales_api,node_analytics_api,node_people_api,node_calendar_api,node_records_api,node_users_api,node_chat_api toneAmber
class node_access,node_facade toneMint
class node_product_model,node_sales_model,node_people_models,node_calendar_model,node_other_models,node_db_access toneRose
class node_chat_engine,node_nlu,node_pharmacist toneIndigo
```

## Components

### Dashboard client

- [Dashboard UI](https://github.com/mathieu7483/dashboard-pharma/tree/main/Client/javascript): `Client/javascript`
- [Authentication UI](https://github.com/mathieu7483/dashboard-pharma/blob/main/Client/javascript/auth.js): `Client/javascript/auth.js`
- [Inventory UI](https://github.com/mathieu7483/dashboard-pharma/blob/main/Client/javascript/inventory.js): `Client/javascript/inventory.js`
- [Dashboard views](https://github.com/mathieu7483/dashboard-pharma/blob/main/Client/javascript/dashboard.js): `Client/javascript/dashboard.js`

### Flask API

- [App and routing](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/app.py): `Server/app.py`
- [Authentication API](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/auth.py): `Server/api/auth.py`
- [Inventory API](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/inventory.py): `Server/api/inventory.py`
- [Products API](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/products.py): `Server/api/products.py`
- [Sales API](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/sales.py): `Server/api/sales.py`
- [Analytics API](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/analytics.py): `Server/api/analytics.py`
- [Clients and doctors](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/clients.py): `Server/api/clients.py`
- [Calendar API](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/calendar_events.py): `Server/api/calendar_events.py`
- [Operational records](https://github.com/mathieu7483/dashboard-pharma/tree/main/Server/api): `Server/api`
- [User management API](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/users.py): `Server/api/users.py`
- [Chatbot API](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/api/chatbot.py): `Server/api/chatbot.py`

### Business services

- [Role access checks](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/utils/decorator.py): `Server/utils/decorator.py`
- [Facade service](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/services/facade.py): `Server/services/facade.py`

### Domain and persistence

- [Product and aliases](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/models/product.py): `Server/models/product.py`
- [Sales records](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/models/sale.py): `Server/models/sale.py`
- [Client and doctor records](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/models/client.py): `Server/models/client.py`
- [Calendar events](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/models/calendar.py): `Server/models/calendar.py`
- [Other domain records](https://github.com/mathieu7483/dashboard-pharma/tree/main/Server/models): `Server/models`
- [Database access](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/database/data_manager.py): `Server/database/data_manager.py`

### Chatbot

- [Chatbot engine](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/core/chatbot/ChatBot_engine.py): `Server/core/chatbot/ChatBot_engine.py`
- [Intent and entity analysis](https://github.com/mathieu7483/dashboard-pharma/blob/main/Server/core/chatbot/NLUProcessor.py): `Server/core/chatbot/NLUProcessor.py`

### Other components

- **Pharmacist**

## Connections

- Pharmacist → Dashboard UI: uses (evidence: `README.md`)
- Dashboard UI → App and routing: sends requests
- Authentication UI → App and routing: authenticates through
- Inventory UI → App and routing: requests inventory
- Dashboard views → App and routing: requests dashboard data
- App and routing → Authentication API: registers (evidence: `Server/app.py`)
- App and routing → Inventory API: registers (evidence: `Server/app.py`)
- App and routing → Products API: registers (evidence: `Server/app.py`)
- App and routing → Sales API: registers (evidence: `Server/app.py`)
- App and routing → Analytics API: registers (evidence: `Server/app.py`)
- App and routing → Clients and doctors: registers (evidence: `Server/app.py`)
- App and routing → Calendar API: registers (evidence: `Server/app.py`)
- App and routing → Operational records: registers (evidence: `Server/app.py`)
- App and routing → User management API: registers (evidence: `Server/app.py`)
- Authentication API → Facade service: delegates (evidence: `Server/api/auth.py`)
- Inventory API → Facade service: delegates (evidence: `Server/api/inventory.py`)
- Products API → Facade service: delegates (evidence: `Server/api/products.py`)
- Sales API → Facade service: delegates (evidence: `Server/api/sales.py`)
- Analytics API → Facade service: delegates (evidence: `Server/api/analytics.py`)
- Clients and doctors → Facade service: delegates (evidence: `Server/api/clients.py`)
- User management API → Facade service: delegates (evidence: `Server/api/users.py`)
- Calendar API → Database access: queries (evidence: `Server/api/calendar_events.py`)
- Calendar API → Calendar events: uses (evidence: `Server/api/calendar_events.py`)
- Clients and doctors → Role access checks: checks admin access (evidence: `Server/api/clients.py`)
- User management API → Role access checks: checks admin access (evidence: `Server/api/users.py`)
- Facade service → Database access: queries and persists (evidence: `Server/services/facade.py`)
- Facade service → Product and aliases: manages (evidence: `Server/services/facade.py`)
- Facade service → Sales records: manages (evidence: `Server/services/facade.py`)
- Facade service → Client and doctor records: manages (evidence: `Server/services/facade.py`)
- Facade service → Calendar events: manages (evidence: `Server/services/facade.py`)
- Facade service → Other domain records: manages (evidence: `Server/services/facade.py`)
- Chatbot API → Chatbot engine: dispatches to (evidence: `Server/api/chatbot.py`)
- Chatbot engine → Intent and entity analysis: analyzes text with (evidence: `Server/core/chatbot/ChatBot_engine.py`)
- Chatbot engine → Facade service: uses services (evidence: `Server/core/chatbot/ChatBot_engine.py`)
- Chatbot engine → Product and aliases: queries stock and aliases (evidence: `Server/core/chatbot/ChatBot_engine.py`)
- Chatbot engine → Sales records: queries sales (evidence: `Server/core/chatbot/ChatBot_engine.py`)
- Chatbot engine → Calendar events: queries events (evidence: `Server/core/chatbot/ChatBot_engine.py`)
- Chatbot engine → Database access: queries records (evidence: `Server/core/chatbot/ChatBot_engine.py`)
