# jineshprajapat/dristidocs-client architecture

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

- Interactive diagram: https://gitdiagram.com/jineshprajapat/dristidocs-client
- Repository: https://github.com/jineshprajapat/dristidocs-client

## Overview

DristiDocs is a React/Redux frontend for pharmacy operations. The main workflow is role-based sign-in, then chemists manage stock and orders or upload invoices for review; administrators manage pharmacy participants and view analytics. Domain screens and services are grouped below, with Redux state and the API client as internal layers. README documents invoice extraction and inventory synchronization, but sampled source does not establish the extraction provider or the complete upload-to-inventory wiring, so those links are omitted.

Main entry points: [`src/App.tsx`](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/App.tsx) (App routes), [`src/api/api.ts`](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/api/api.ts) (API client), [`src/services/auth.ts`](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/services/auth.ts) (Authentication requests), [`src/pages/AdminDashboard.tsx`](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/pages/AdminDashboard.tsx) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and routing"]
  node_app["App routes<br/>[App.tsx]"]
  node_login["Login and signup<br/>[LoginForm.tsx]"]
  node_auth_service["Authentication requests<br/>[auth.ts]"]
end

subgraph group_operations["Pharmacy operations"]
  node_inventory_page["Inventory view<br/>[Inventory.tsx]"]
  node_inventory_ui["Stock management<br/>[warehouse.tsx]"]
  node_stock_modal["Stock actions"]
  node_products["Product management<br/>[createProduct.tsx]"]
  node_orders_page["Orders view<br/>[Order.tsx]"]
  node_order_create["Order creation<br/>[createOrder.tsx]"]
  node_timeline["Operations timeline<br/>[timeline.tsx]"]
end

subgraph group_documents["Invoice workflow"]
  node_upload_page["Invoice upload"]
  node_invoice_editor["Invoice review<br/>[InvoiceEditor.tsx]"]
end

subgraph group_admin["Administration and insights"]
  node_admin_dashboard["Admin dashboard<br/>[AdminDashboard.tsx]"]
  node_chemist_admin["Chemist management"]
  node_reports["Reports and insights"]
  node_analytics_service["Analytics requests<br/>[analytics.ts]"]
end

subgraph group_state["Client data layer"]
  node_auth_state["Session state<br/>[authReducer.ts]"]
  node_invoice_state["Invoice state<br/>[invoiceReducer.ts]"]
  node_api["API client<br/>[api.ts]"]
  node_store["Redux store<br/>[store.ts]"]
end

node_chemist(("Chemist"))
node_admin_actor(("Administrator"))
node_backend{{"Pharmacy backend"}}

node_chemist -->|"opens"| node_app
node_admin_actor -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_login -->|"dispatches"| node_auth_service
node_app -->|"fetches session"| node_auth_service
node_auth_service -->|"sends requests"| node_api
node_api -->|"HTTP requests"| node_backend
node_auth_service -->|"updates"| node_auth_state
node_app -->|"routes to"| node_inventory_page
node_app -->|"routes to"| node_orders_page
node_app -->|"routes to"| node_upload_page
node_app -->|"routes to"| node_admin_dashboard
node_inventory_page -->|"presents"| node_inventory_ui
node_stock_modal -->|"dispatches stock actions"| node_api
node_stock_modal -->|"creates stock-in order"| node_order_create
node_products -->|"requests product data"| node_api
node_orders_page -->|"offers creation"| node_order_create
node_order_create -->|"submits order"| node_api
node_inventory_ui -->|"links to"| node_timeline
node_upload_page -->|"presents review"| node_invoice_editor
node_invoice_editor -->|"reads invoice"| node_invoice_state
node_admin_dashboard -->|"offers management"| node_chemist_admin
node_admin_dashboard -->|"presents reports"| node_reports
node_reports -->|"requests analytics"| node_analytics_service
node_analytics_service -->|"sends requests"| node_api
node_store -->|"combines reducer"| node_auth_state
node_store -->|"combines reducer"| node_invoice_state

click node_app "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/App.tsx"
click node_login "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/auth/components/LoginForm.tsx"
click node_auth_service "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/services/auth.ts"
click node_auth_state "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/store/reducers/authReducer.ts"
click node_inventory_page "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/pages/Inventory.tsx"
click node_inventory_ui "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/inventory/warehouse.tsx"
click node_stock_modal "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/common/WareHouseSideModal.tsx"
click node_products "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/products/createProduct.tsx"
click node_orders_page "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/pages/Order.tsx"
click node_order_create "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/order/createOrder.tsx"
click node_timeline "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/inventory/timeline.tsx"
click node_upload_page "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/pages/UploadDocuments.tsx"
click node_invoice_editor "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/upload-documents/InvoiceEditor.tsx"
click node_invoice_state "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/store/reducers/invoiceReducer.ts"
click node_admin_dashboard "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/pages/AdminDashboard.tsx"
click node_chemist_admin "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/dashboard/admin/PharmacyManagement.tsx"
click node_reports "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/dashboard/admin/ReportsAndInsights.tsx"
click node_analytics_service "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/services/analytics.ts"
click node_api "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/api/api.ts"
click node_store "https://github.com/jineshprajapat/dristidocs-client/blob/main/src/store/store.ts"

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_login,node_auth_service toneBlue
class node_inventory_page,node_inventory_ui,node_stock_modal,node_products,node_orders_page,node_order_create,node_timeline toneAmber
class node_upload_page,node_invoice_editor toneMint
class node_admin_dashboard,node_chemist_admin,node_reports,node_analytics_service toneRose
class node_auth_state,node_invoice_state,node_api,node_store,node_chemist,node_admin_actor,node_backend toneIndigo
```

## Components

### Access and routing

- [App routes](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/App.tsx): `src/App.tsx`
- [Login and signup](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/auth/components/LoginForm.tsx): `src/features/auth/components/LoginForm.tsx`
- [Authentication requests](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/services/auth.ts): `src/services/auth.ts`

### Pharmacy operations

- [Inventory view](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/pages/Inventory.tsx): `src/pages/Inventory.tsx`
- [Stock management](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/inventory/warehouse.tsx): `src/features/inventory/warehouse.tsx`
- [Stock actions](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/common/WareHouseSideModal.tsx): `src/common/WareHouseSideModal.tsx`
- [Product management](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/products/createProduct.tsx): `src/features/products/createProduct.tsx`
- [Orders view](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/pages/Order.tsx): `src/pages/Order.tsx`
- [Order creation](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/order/createOrder.tsx): `src/features/order/createOrder.tsx`
- [Operations timeline](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/inventory/timeline.tsx): `src/features/inventory/timeline.tsx`

### Invoice workflow

- [Invoice upload](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/pages/UploadDocuments.tsx): `src/pages/UploadDocuments.tsx`
- [Invoice review](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/upload-documents/InvoiceEditor.tsx): `src/features/upload-documents/InvoiceEditor.tsx`

### Administration and insights

- [Admin dashboard](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/pages/AdminDashboard.tsx): `src/pages/AdminDashboard.tsx`
- [Chemist management](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/dashboard/admin/PharmacyManagement.tsx): `src/features/dashboard/admin/PharmacyManagement.tsx`
- [Reports and insights](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/features/dashboard/admin/ReportsAndInsights.tsx): `src/features/dashboard/admin/ReportsAndInsights.tsx`
- [Analytics requests](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/services/analytics.ts): `src/services/analytics.ts`

### Client data layer

- [Session state](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/store/reducers/authReducer.ts): `src/store/reducers/authReducer.ts`
- [Invoice state](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/store/reducers/invoiceReducer.ts): `src/store/reducers/invoiceReducer.ts`
- [API client](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/api/api.ts): `src/api/api.ts`
- [Redux store](https://github.com/jineshprajapat/dristidocs-client/blob/main/src/store/store.ts): `src/store/store.ts`

### Other components

- **Chemist**
- **Administrator**
- **Pharmacy backend**

## Connections

- Chemist → App routes: opens
- Administrator → App routes: opens
- App routes → Login and signup: routes to
- Login and signup → Authentication requests: dispatches
- App routes → Authentication requests: fetches session
- Authentication requests → API client: sends requests
- API client → Pharmacy backend: HTTP requests
- Authentication requests → Session state: updates
- App routes → Inventory view: routes to
- App routes → Orders view: routes to
- App routes → Invoice upload: routes to
- App routes → Admin dashboard: routes to
- Inventory view → Stock management: presents
- Stock actions → API client: dispatches stock actions
- Stock actions → Order creation: creates stock-in order
- Product management → API client: requests product data
- Orders view → Order creation: offers creation
- Order creation → API client: submits order
- Stock management → Operations timeline: links to
- Invoice upload → Invoice review: presents review
- Invoice review → Invoice state: reads invoice
- Admin dashboard → Chemist management: offers management
- Admin dashboard → Reports and insights: presents reports
- Reports and insights → Analytics requests: requests analytics
- Analytics requests → API client: sends requests
- Redux store → Session state: combines reducer
- Redux store → Invoice state: combines reducer
