# moh775-m/saydaliyat-hadhramout architecture

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

- Interactive diagram: https://gitdiagram.com/moh775-m/saydaliyat-hadhramout
- Repository: https://github.com/moh775-m/saydaliyat-hadhramout

## Overview

Aliyat Hadhramout is a React pharmacy-management system with public pharmacy discovery and per-pharmacy storefronts, pharmacy operations, and a manager console. The main customer workflow is landing-page discovery or a pharmacy-specific link, browsing medicines, submitting an order with optional prescription/payment uploads, then pharmacy-side order handling and sales recording. README documents reporting, inventory, direct sales, payment accounts, and subscription administration; excerpts confirm only some implementation details, so unsampled links are omitted. Supabase is the shared backend; its schema and order-completion behavior are documented in the README.

Main entry points: [`src/pages/Dashboard.jsx`](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Dashboard.jsx) (Pharmacy dashboard), [`src/App.jsx`](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/App.jsx) (Route dispatcher), [`src/pages/Shop.jsx`](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Shop.jsx) (Customer storefront), [`src/supabase.js`](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/supabase.js) (Supabase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Public entry"]
  node_app_routes["Route dispatcher<br/>[App.jsx]"]
  node_landing["Pharmacy discovery<br/>[Landing.jsx]"]
  node_login["Pharmacy login<br/>[login.jsx]"]
end

subgraph group_commerce["Store and orders"]
  node_storefront["Customer storefront<br/>[Shop.jsx]"]
end

subgraph group_operations["Pharmacy operations"]
  node_dashboard["Pharmacy dashboard<br/>[Dashboard.jsx]"]
  node_inventory["Medicine inventory<br/>[Dashboard.jsx]"]
  node_sales_reports["Sales and reports<br/>[Dashboard.jsx]"]
  node_payment_accounts["Payment accounts<br/>[Dashboard.jsx]"]
end

subgraph group_management["Platform management"]
  node_admin_console["Pharmacy administration<br/>[Admin.jsx]"]
end

subgraph group_backend["Backend services"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
  node_supabase_data[("Pharmacy data")]
  node_file_storage[("Prescription storage")]
  node_whatsapp["WhatsApp contact"]
end

node_visitor(("Customer"))
node_pharmacist(("Pharmacy staff"))
node_administrator(("Administrator"))

node_visitor -->|"opens app"| node_app_routes
node_app_routes -->|"routes to"| node_landing
node_app_routes -->|"routes to"| node_login
node_app_routes -->|"routes to"| node_storefront
node_app_routes -->|"protects route"| node_dashboard
node_app_routes -->|"routes to"| node_admin_console
node_landing -->|"queries pharmacies"| node_supabase_client
node_landing -->|"navigates to"| node_login
node_landing -->|"navigates to"| node_admin_console
node_login -->|"checks credentials"| node_supabase_client
node_login -.->|"navigates after login"| node_dashboard
node_pharmacist -->|"signs in"| node_login
node_pharmacist -->|"uses operations"| node_dashboard
node_visitor -->|"places order"| node_storefront
node_storefront -->|"loads pharmacy"| node_supabase_client
node_storefront -->|"uploads prescription"| node_file_storage
node_storefront -.->|"submits order"| node_supabase_data
node_storefront -->|"offers contact"| node_whatsapp
node_dashboard -->|"loads and updates"| node_supabase_client
node_dashboard -->|"manages medicines"| node_inventory
node_dashboard -->|"tracks sales"| node_sales_reports
node_dashboard -->|"manages accounts"| node_payment_accounts
node_dashboard -->|"records direct sales"| node_supabase_data
node_admin_console -->|"manages pharmacies"| node_supabase_client
node_administrator -->|"administers tenants"| node_admin_console
node_supabase_client -->|"reads and writes"| node_supabase_data
node_supabase_data -.->|"stores sales records"| node_sales_reports

click node_app_routes "https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/App.jsx"
click node_landing "https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Landing.jsx"
click node_login "https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/login.jsx"
click node_storefront "https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Shop.jsx"
click node_dashboard "https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Dashboard.jsx"
click node_inventory "https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Dashboard.jsx"
click node_sales_reports "https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Dashboard.jsx"
click node_payment_accounts "https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Dashboard.jsx"
click node_admin_console "https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Admin.jsx"
click node_supabase_client "https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/supabase.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_app_routes,node_landing,node_login toneBlue
class node_storefront toneAmber
class node_dashboard,node_inventory,node_sales_reports,node_payment_accounts toneMint
class node_admin_console toneRose
class node_supabase_client,node_supabase_data,node_file_storage,node_whatsapp,node_visitor,node_pharmacist,node_administrator toneIndigo
```

## Components

### Public entry

- [Route dispatcher](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/App.jsx): `src/App.jsx`
- [Pharmacy discovery](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Landing.jsx): `src/pages/Landing.jsx`
- [Pharmacy login](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/login.jsx): `src/pages/login.jsx`

### Store and orders

- [Customer storefront](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Shop.jsx): `src/pages/Shop.jsx`

### Pharmacy operations

- [Pharmacy dashboard](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Medicine inventory](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Sales and reports](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Payment accounts](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`

### Platform management

- [Pharmacy administration](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/pages/Admin.jsx): `src/pages/Admin.jsx`

### Backend services

- [Supabase client](https://github.com/moh775-m/saydaliyat-hadhramout/blob/main/src/supabase.js): `src/supabase.js`
- **Pharmacy data**
- **Prescription storage**
- **WhatsApp contact**

### Other components

- **Customer**
- **Pharmacy staff**
- **Administrator**

## Connections

- Customer → Route dispatcher: opens app (evidence: `src/App.jsx`)
- Route dispatcher → Pharmacy discovery: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Pharmacy login: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Customer storefront: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Pharmacy dashboard: protects route (evidence: `src/App.jsx`)
- Route dispatcher → Pharmacy administration: routes to (evidence: `src/App.jsx`)
- Pharmacy discovery → Supabase client: queries pharmacies (evidence: `src/pages/Landing.jsx`)
- Pharmacy discovery → Pharmacy login: navigates to (evidence: `src/pages/Landing.jsx`)
- Pharmacy discovery → Pharmacy administration: navigates to (evidence: `src/pages/Landing.jsx`)
- Pharmacy login → Supabase client: checks credentials (evidence: `src/pages/login.jsx`)
- Pharmacy login → Pharmacy dashboard: navigates after login
- Pharmacy staff → Pharmacy login: signs in (evidence: `README.md`)
- Pharmacy staff → Pharmacy dashboard: uses operations (evidence: `README.md`)
- Customer → Customer storefront: places order (evidence: `README.md`)
- Customer storefront → Supabase client: loads pharmacy (evidence: `src/pages/Shop.jsx`)
- Customer storefront → Prescription storage: uploads prescription (evidence: `src/pages/Shop.jsx`)
- Customer storefront → Pharmacy data: submits order
- Customer storefront → WhatsApp contact: offers contact (evidence: `src/pages/Shop.jsx`)
- Pharmacy dashboard → Supabase client: loads and updates (evidence: `src/pages/Dashboard.jsx`)
- Pharmacy dashboard → Medicine inventory: manages medicines (evidence: `README.md`)
- Pharmacy dashboard → Sales and reports: tracks sales (evidence: `README.md`)
- Pharmacy dashboard → Payment accounts: manages accounts (evidence: `src/pages/Dashboard.jsx`)
- Pharmacy dashboard → Pharmacy data: records direct sales (evidence: `src/pages/Dashboard.jsx`)
- Pharmacy administration → Supabase client: manages pharmacies (evidence: `src/pages/Admin.jsx`)
- Administrator → Pharmacy administration: administers tenants (evidence: `README.md`)
- Supabase client → Pharmacy data: reads and writes (evidence: `src/supabase.js`)
- Pharmacy data → Sales and reports: stores sales records (evidence: `README.md`)
