# vijay027th/e_pharmacy architecture

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

- Interactive diagram: https://gitdiagram.com/vijay027th/e_pharmacy
- Repository: https://github.com/vijay027th/e_pharmacy

## Overview

This repository snapshot exposes the React frontend of a full-stack e-pharmacy; the backend described in the README is not present in the supplied tree. The main customer flow is catalog discovery and medicine detail, cart, prescription upload when required, checkout, then order tracking and notifications. Admin screens cover catalog, categories, users, prescription review, fulfillment, dashboard, and reports. API edges show frontend HTTP requests; backend internals and several unsampled page-to-service calls are not evidenced here.

Main entry points: [`frontend/src/App.jsx`](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/App.jsx) (SPA routing), [`frontend/src/services/adminService.js`](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/adminService.js) (Admin service), [`frontend/src/services/api.js`](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/api.js) (Axios API client), [`frontend/src/pages/admin/AdminOrders.jsx`](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminOrders.jsx) (Order fulfillment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["SPA routing<br/>[App.jsx]"]
  node_auth["Authentication state<br/>[AuthContext.jsx]"]
end

subgraph group_customer["Customer pharmacy"]
  node_catalog["Catalog browsing<br/>[Medicines.jsx]"]
  node_medicine["Medicine details"]
  node_search["Catalog search<br/>[SearchBar.jsx]"]
  node_cart["Cart state<br/>[CartContext.jsx]"]
  node_cartpage["Cart review<br/>[Cart.jsx]"]
  node_prescription["Prescription upload"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_orders["Order history<br/>[Orders.jsx]"]
  node_notifications["Notifications<br/>[Notifications.jsx]"]
  node_profile["Customer profile<br/>[Profile.jsx]"]
  node_reviews["Medicine reviews"]
end

subgraph group_services["Frontend API access"]
  node_api["Axios API client<br/>[api.js]"]
  node_authsvc["Auth service<br/>[authService.js]"]
  node_medsvc["Medicine service<br/>[medicineService.js]"]
  node_cartsvc["Cart service<br/>[cartService.js]"]
  node_ordersvc["Order service<br/>[orderService.js]"]
  node_prescsvc["Prescription service"]
  node_adminsvc["Admin service<br/>[adminService.js]"]
  node_dateutils["Date formatting<br/>[dateUtils.js]"]
end

subgraph group_admin["Admin operations"]
  node_adminshell["Admin workspace<br/>[AdminShell.jsx]"]
  node_dashboard["Admin dashboard<br/>[Dashboard.jsx]"]
  node_adminmed["Medicine management<br/>[AdminMedicines.jsx]"]
  node_categories["Category management"]
  node_adminusers["User management<br/>[AdminUsers.jsx]"]
  node_adminrx["Prescription desk"]
  node_adminorders["Order fulfillment<br/>[AdminOrders.jsx]"]
  node_reports["Sales and inventory reports<br/>[AdminReports.jsx]"]
  node_adminui["Admin UI primitives<br/>[AdminUI.jsx]"]
end

node_shopper(("Shopper"))
node_backend["Spring Boot API"]

node_shopper -.->|"uses"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_medicine
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_orders
node_app -->|"routes to"| node_prescription
node_app -->|"routes to"| node_notifications
node_app -->|"provides state"| node_auth
node_app -->|"provides state"| node_cart
node_auth -->|"calls"| node_authsvc
node_medicine -->|"loads details"| node_medsvc
node_medicine -->|"adds items"| node_cart
node_medicine -->|"shows reviews"| node_reviews
node_search -.->|"supports search"| node_catalog
node_cart -.->|"uses"| node_cartsvc
node_cartpage -.->|"reads state"| node_cart
node_checkout -.->|"places orders"| node_ordersvc
node_prescription -.->|"uploads via"| node_prescsvc
node_orders -.->|"loads orders"| node_ordersvc
node_authsvc -->|"sends requests"| node_api
node_medsvc -->|"sends requests"| node_api
node_cartsvc -->|"sends requests"| node_api
node_ordersvc -->|"sends requests"| node_api
node_prescsvc -->|"sends requests"| node_api
node_adminsvc -->|"sends requests"| node_api
node_api -.->|"HTTP requests"| node_backend
node_app -->|"wraps admin routes"| node_adminshell
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_adminmed
node_app -->|"routes to"| node_categories
node_app -->|"routes to"| node_adminusers
node_app -->|"routes to"| node_adminrx
node_app -->|"routes to"| node_adminorders
node_app -->|"routes to"| node_reports
node_adminmed -->|"writes catalog"| node_adminsvc
node_adminmed -->|"loads catalog"| node_medsvc
node_adminmed -->|"renders"| node_adminui
node_adminorders -->|"loads orders"| node_adminsvc
node_adminorders -->|"loads tracking"| node_ordersvc
node_adminorders -->|"renders"| node_adminui
node_adminorders -->|"parses dates"| node_dateutils
node_adminsvc -.->|"admin API calls"| node_backend
node_adminsvc -.->|"supplies metrics"| node_dashboard
node_adminsvc -.->|"manages categories"| node_categories
node_adminsvc -.->|"manages accounts"| node_adminusers
node_adminsvc -.->|"reviews prescriptions"| node_adminrx
node_adminsvc -.->|"provides reports"| node_reports

click node_app "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/App.jsx"
click node_auth "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/context/AuthContext.jsx"
click node_catalog "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/Medicines.jsx"
click node_medicine "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/MedicineDetails.jsx"
click node_search "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/components/SearchBar.jsx"
click node_cart "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/context/CartContext.jsx"
click node_cartpage "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/Cart.jsx"
click node_prescription "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/PrescriptionUpload.jsx"
click node_checkout "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/Checkout.jsx"
click node_orders "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/Orders.jsx"
click node_notifications "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/Notifications.jsx"
click node_profile "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/Profile.jsx"
click node_reviews "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/MedicineDetails.jsx"
click node_api "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/api.js"
click node_authsvc "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/authService.js"
click node_medsvc "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/medicineService.js"
click node_cartsvc "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/cartService.js"
click node_ordersvc "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/orderService.js"
click node_prescsvc "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/prescriptionService.js"
click node_adminshell "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/components/admin/AdminShell.jsx"
click node_dashboard "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/Dashboard.jsx"
click node_adminmed "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminMedicines.jsx"
click node_categories "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminCategories.jsx"
click node_adminusers "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminUsers.jsx"
click node_adminrx "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminPrescriptions.jsx"
click node_adminorders "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminOrders.jsx"
click node_reports "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminReports.jsx"
click node_adminsvc "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/adminService.js"
click node_adminui "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/components/admin/AdminUI.jsx"
click node_dateutils "https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/utils/dateUtils.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,node_auth toneBlue
class node_catalog,node_medicine,node_search,node_cart,node_cartpage,node_prescription,node_checkout,node_orders,node_notifications,node_profile,node_reviews toneAmber
class node_api,node_authsvc,node_medsvc,node_cartsvc,node_ordersvc,node_prescsvc,node_adminsvc,node_dateutils,node_backend toneMint
class node_adminshell,node_dashboard,node_adminmed,node_categories,node_adminusers,node_adminrx,node_adminorders,node_reports,node_adminui toneRose
class node_shopper toneIndigo
```

## Components

### Application shell

- [SPA routing](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Authentication state](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`

### Customer pharmacy

- [Catalog browsing](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/Medicines.jsx): `frontend/src/pages/Medicines.jsx`
- [Medicine details](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/MedicineDetails.jsx): `frontend/src/pages/MedicineDetails.jsx`
- [Catalog search](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/components/SearchBar.jsx): `frontend/src/components/SearchBar.jsx`
- [Cart state](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/context/CartContext.jsx): `frontend/src/context/CartContext.jsx`
- [Cart review](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/Cart.jsx): `frontend/src/pages/Cart.jsx`
- [Prescription upload](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/PrescriptionUpload.jsx): `frontend/src/pages/PrescriptionUpload.jsx`
- [Checkout](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/Checkout.jsx): `frontend/src/pages/Checkout.jsx`
- [Order history](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/Orders.jsx): `frontend/src/pages/Orders.jsx`
- [Notifications](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/Notifications.jsx): `frontend/src/pages/Notifications.jsx`
- [Customer profile](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/Profile.jsx): `frontend/src/pages/Profile.jsx`
- [Medicine reviews](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/MedicineDetails.jsx): `frontend/src/pages/MedicineDetails.jsx`

### Frontend API access

- [Axios API client](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Auth service](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/authService.js): `frontend/src/services/authService.js`
- [Medicine service](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/medicineService.js): `frontend/src/services/medicineService.js`
- [Cart service](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/cartService.js): `frontend/src/services/cartService.js`
- [Order service](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/orderService.js): `frontend/src/services/orderService.js`
- [Prescription service](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/prescriptionService.js): `frontend/src/services/prescriptionService.js`
- [Admin service](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/services/adminService.js): `frontend/src/services/adminService.js`
- [Date formatting](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/utils/dateUtils.js): `frontend/src/utils/dateUtils.js`

### Admin operations

- [Admin workspace](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/components/admin/AdminShell.jsx): `frontend/src/components/admin/AdminShell.jsx`
- [Admin dashboard](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/Dashboard.jsx): `frontend/src/pages/admin/Dashboard.jsx`
- [Medicine management](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminMedicines.jsx): `frontend/src/pages/admin/AdminMedicines.jsx`
- [Category management](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminCategories.jsx): `frontend/src/pages/admin/AdminCategories.jsx`
- [User management](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminUsers.jsx): `frontend/src/pages/admin/AdminUsers.jsx`
- [Prescription desk](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminPrescriptions.jsx): `frontend/src/pages/admin/AdminPrescriptions.jsx`
- [Order fulfillment](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminOrders.jsx): `frontend/src/pages/admin/AdminOrders.jsx`
- [Sales and inventory reports](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/pages/admin/AdminReports.jsx): `frontend/src/pages/admin/AdminReports.jsx`
- [Admin UI primitives](https://github.com/vijay027th/e_pharmacy/blob/main/frontend/src/components/admin/AdminUI.jsx): `frontend/src/components/admin/AdminUI.jsx`

### Other components

- **Shopper**
- **Spring Boot API**

## Connections

- Shopper → SPA routing: uses
- SPA routing → Catalog browsing: routes to (evidence: `frontend/src/App.jsx`)
- SPA routing → Medicine details: routes to (evidence: `frontend/src/App.jsx`)
- SPA routing → Checkout: routes to (evidence: `frontend/src/App.jsx`)
- SPA routing → Order history: routes to (evidence: `frontend/src/App.jsx`)
- SPA routing → Prescription upload: routes to (evidence: `frontend/src/App.jsx`)
- SPA routing → Notifications: routes to (evidence: `frontend/src/App.jsx`)
- SPA routing → Authentication state: provides state (evidence: `frontend/src/App.jsx`)
- SPA routing → Cart state: provides state (evidence: `frontend/src/App.jsx`)
- Authentication state → Auth service: calls (evidence: `frontend/src/context/AuthContext.jsx`)
- Medicine details → Medicine service: loads details (evidence: `frontend/src/pages/MedicineDetails.jsx`)
- Medicine details → Cart state: adds items (evidence: `frontend/src/pages/MedicineDetails.jsx`)
- Medicine details → Medicine reviews: shows reviews (evidence: `frontend/src/pages/MedicineDetails.jsx`)
- Catalog search → Catalog browsing: supports search
- Cart state → Cart service: uses
- Cart review → Cart state: reads state
- Checkout → Order service: places orders
- Prescription upload → Prescription service: uploads via
- Order history → Order service: loads orders
- Auth service → Axios API client: sends requests (evidence: `frontend/src/services/authService.js`)
- Medicine service → Axios API client: sends requests (evidence: `frontend/src/services/medicineService.js`)
- Cart service → Axios API client: sends requests (evidence: `frontend/src/services/cartService.js`)
- Order service → Axios API client: sends requests (evidence: `frontend/src/services/orderService.js`)
- Prescription service → Axios API client: sends requests (evidence: `frontend/src/services/prescriptionService.js`)
- Admin service → Axios API client: sends requests (evidence: `frontend/src/services/adminService.js`)
- Axios API client → Spring Boot API: HTTP requests
- SPA routing → Admin workspace: wraps admin routes (evidence: `frontend/src/App.jsx`)
- SPA routing → Admin dashboard: routes to (evidence: `frontend/src/App.jsx`)
- SPA routing → Medicine management: routes to (evidence: `frontend/src/App.jsx`)
- SPA routing → Category management: routes to (evidence: `frontend/src/App.jsx`)
- SPA routing → User management: routes to (evidence: `frontend/src/App.jsx`)
- SPA routing → Prescription desk: routes to (evidence: `frontend/src/App.jsx`)
- SPA routing → Order fulfillment: routes to (evidence: `frontend/src/App.jsx`)
- SPA routing → Sales and inventory reports: routes to (evidence: `frontend/src/App.jsx`)
- Medicine management → Admin service: writes catalog (evidence: `frontend/src/pages/admin/AdminMedicines.jsx`)
- Medicine management → Medicine service: loads catalog (evidence: `frontend/src/pages/admin/AdminMedicines.jsx`)
- Medicine management → Admin UI primitives: renders (evidence: `frontend/src/pages/admin/AdminMedicines.jsx`)
- Order fulfillment → Admin service: loads orders (evidence: `frontend/src/pages/admin/AdminOrders.jsx`)
- Order fulfillment → Order service: loads tracking (evidence: `frontend/src/pages/admin/AdminOrders.jsx`)
- Order fulfillment → Admin UI primitives: renders (evidence: `frontend/src/pages/admin/AdminOrders.jsx`)
- Order fulfillment → Date formatting: parses dates (evidence: `frontend/src/pages/admin/AdminOrders.jsx`)
- Admin service → Spring Boot API: admin API calls
- Admin service → Admin dashboard: supplies metrics
- Admin service → Category management: manages categories
- Admin service → User management: manages accounts
- Admin service → Prescription desk: reviews prescriptions
- Admin service → Sales and inventory reports: provides reports
