# anurag-shankar-maurya/medicos architecture

> Architecture diagram of the GitHub repository anurag-shankar-maurya/medicos, 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/anurag-shankar-maurya/medicos
- Repository: https://github.com/anurag-shankar-maurya/medicos

## Overview

This is a pharmacy-management application: staff sign in, manage medicine inventory, build a cart, complete billing and sales, then review dashboards, reports and notifications; administrators also manage staff. The React client routes these workflows through a shared API client to a Django API. The backend tree exposes medicine and user domains, but most backend request handlers and URL configuration were not sampled, so their internal dispatch relationships are not asserted. The README is empty; unsampled frontend capability branches are retained from the route map and source index.

Main entry points: [`reactFrontend/app/router.tsx`](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/app/router.tsx) (Protected routes), [`reactFrontend/services/apiClient.ts`](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/services/apiClient.ts) (API client), [`reactFrontend/features/billing/BillingPage.tsx`](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/billing/BillingPage.tsx) (Billing and checkout), [`reactFrontend/features/sales/SalesPage.tsx`](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/sales/SalesPage.tsx) (Sales history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React application"]
  node_router["Protected routes<br/>[router.tsx]"]
  node_auth["Authentication<br/>[LoginPage.tsx]"]
  node_providers["Auth and app state<br/>[providers.tsx]"]
  node_api["API client<br/>[apiClient.ts]"]
  node_staffmgmt["Staff management<br/>[StaffPage.tsx]"]
end

subgraph group_commerce["Inventory and sales"]
  node_inventory["Medicine inventory<br/>[MedicineList.tsx]"]
  node_cart["Shopping cart<br/>[CartContext.tsx]"]
  node_cartpage["Cart view<br/>[CartPage.tsx]"]
  node_billing["Billing and checkout<br/>[BillingPage.tsx]"]
  node_sales["Sales history<br/>[SalesPage.tsx]"]
  node_saledetail["Sale details<br/>[SaleDetailPage.tsx]"]
  node_receipt["Receipt display<br/>[ReceiptModal.tsx]"]
end

subgraph group_insights["Operations insights"]
  node_dashboard["Dashboard analytics<br/>[DashboardPage.tsx]"]
  node_reports["Reports<br/>[ReportsPage.tsx]"]
  node_notifications["Notifications"]
end

subgraph group_server["Django API"]
  node_django["Django API<br/>[urls.py]"]
  node_medicineviews["Medicine handlers<br/>[views.py]"]
  node_medicinemodels[("Medicine and sales data<br/>[models.py]")]
  node_dashboardviews["Dashboard data<br/>[dashboard_views.py]"]
  node_userviews["User handlers<br/>[views.py]"]
  node_usermodels[("User data<br/>[models.py]")]
end

node_staff(("Pharmacy staff"))

node_staff -->|"signs in"| node_auth
node_staff -.->|"manages stock"| node_inventory
node_staff -.->|"checks out"| node_billing
node_router -->|"routes to"| node_auth
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_inventory
node_router -->|"routes to"| node_cartpage
node_router -->|"routes to"| node_billing
node_router -->|"routes to"| node_sales
node_router -->|"routes to"| node_saledetail
node_router -->|"routes to"| node_notifications
node_router -->|"routes to"| node_reports
node_router -->|"routes to"| node_staffmgmt
node_router -->|"guards with"| node_providers
node_auth -->|"uses auth state"| node_providers
node_inventory -->|"fetches inventory"| node_api
node_cart -->|"updates cart"| node_api
node_cartpage -->|"uses cart state"| node_cart
node_billing -->|"submits checkout"| node_api
node_billing -->|"uses cart state"| node_cart
node_sales -->|"loads sales"| node_api
node_saledetail -->|"loads sale"| node_api
node_sales -->|"displays receipt"| node_receipt
node_saledetail -->|"displays receipt"| node_receipt
node_dashboard -->|"loads metrics"| node_api
node_reports -->|"requests reports"| node_api
node_notifications -->|"loads alerts"| node_api
node_staffmgmt -->|"manages users"| node_api
node_api -->|"HTTP requests"| node_django
node_django -.->|"dispatches requests"| node_medicineviews
node_django -.->|"dispatches requests"| node_userviews
node_medicineviews -.->|"uses domain data"| node_medicinemodels
node_dashboardviews -->|"queries data"| node_medicinemodels
node_userviews -.->|"uses user data"| node_usermodels

click node_router "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/app/router.tsx"
click node_auth "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/auth/LoginPage.tsx"
click node_providers "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/app/providers.tsx"
click node_api "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/services/apiClient.ts"
click node_inventory "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/inventory/MedicineList.tsx"
click node_cart "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/app/CartContext.tsx"
click node_cartpage "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/cart/CartPage.tsx"
click node_billing "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/billing/BillingPage.tsx"
click node_sales "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/sales/SalesPage.tsx"
click node_saledetail "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/sales/SaleDetailPage.tsx"
click node_dashboard "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/dashboard/DashboardPage.tsx"
click node_reports "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/reports/ReportsPage.tsx"
click node_notifications "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/notifications/NotificationsPage.tsx"
click node_staffmgmt "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/staff/StaffPage.tsx"
click node_receipt "https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/components/common/ReceiptModal.tsx"
click node_django "https://github.com/anurag-shankar-maurya/medicos/blob/main/djangoBackend/project/urls.py"
click node_medicineviews "https://github.com/anurag-shankar-maurya/medicos/blob/main/djangoBackend/apps/medicines/views.py"
click node_medicinemodels "https://github.com/anurag-shankar-maurya/medicos/blob/main/djangoBackend/apps/medicines/models.py"
click node_dashboardviews "https://github.com/anurag-shankar-maurya/medicos/blob/main/djangoBackend/apps/medicines/dashboard_views.py"
click node_userviews "https://github.com/anurag-shankar-maurya/medicos/blob/main/djangoBackend/apps/users/views.py"
click node_usermodels "https://github.com/anurag-shankar-maurya/medicos/blob/main/djangoBackend/apps/users/models.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_router,node_auth,node_providers,node_api,node_staffmgmt toneBlue
class node_inventory,node_cart,node_cartpage,node_billing,node_sales,node_saledetail,node_receipt toneAmber
class node_dashboard,node_reports,node_notifications toneMint
class node_django,node_medicineviews,node_medicinemodels,node_dashboardviews,node_userviews,node_usermodels toneRose
class node_staff toneIndigo
```

## Components

### React application

- [Protected routes](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/app/router.tsx): `reactFrontend/app/router.tsx`
- [Authentication](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/auth/LoginPage.tsx): `reactFrontend/features/auth/LoginPage.tsx`
- [Auth and app state](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/app/providers.tsx): `reactFrontend/app/providers.tsx`
- [API client](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/services/apiClient.ts): `reactFrontend/services/apiClient.ts`
- [Staff management](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/staff/StaffPage.tsx): `reactFrontend/features/staff/StaffPage.tsx`

### Inventory and sales

- [Medicine inventory](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/inventory/MedicineList.tsx): `reactFrontend/features/inventory/MedicineList.tsx`
- [Shopping cart](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/app/CartContext.tsx): `reactFrontend/app/CartContext.tsx`
- [Cart view](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/cart/CartPage.tsx): `reactFrontend/features/cart/CartPage.tsx`
- [Billing and checkout](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/billing/BillingPage.tsx): `reactFrontend/features/billing/BillingPage.tsx`
- [Sales history](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/sales/SalesPage.tsx): `reactFrontend/features/sales/SalesPage.tsx`
- [Sale details](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/sales/SaleDetailPage.tsx): `reactFrontend/features/sales/SaleDetailPage.tsx`
- [Receipt display](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/components/common/ReceiptModal.tsx): `reactFrontend/components/common/ReceiptModal.tsx`

### Operations insights

- [Dashboard analytics](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/dashboard/DashboardPage.tsx): `reactFrontend/features/dashboard/DashboardPage.tsx`
- [Reports](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/reports/ReportsPage.tsx): `reactFrontend/features/reports/ReportsPage.tsx`
- [Notifications](https://github.com/anurag-shankar-maurya/medicos/blob/main/reactFrontend/features/notifications/NotificationsPage.tsx): `reactFrontend/features/notifications/NotificationsPage.tsx`

### Django API

- [Django API](https://github.com/anurag-shankar-maurya/medicos/blob/main/djangoBackend/project/urls.py): `djangoBackend/project/urls.py`
- [Medicine handlers](https://github.com/anurag-shankar-maurya/medicos/blob/main/djangoBackend/apps/medicines/views.py): `djangoBackend/apps/medicines/views.py`
- [Medicine and sales data](https://github.com/anurag-shankar-maurya/medicos/blob/main/djangoBackend/apps/medicines/models.py): `djangoBackend/apps/medicines/models.py`
- [Dashboard data](https://github.com/anurag-shankar-maurya/medicos/blob/main/djangoBackend/apps/medicines/dashboard_views.py): `djangoBackend/apps/medicines/dashboard_views.py`
- [User handlers](https://github.com/anurag-shankar-maurya/medicos/blob/main/djangoBackend/apps/users/views.py): `djangoBackend/apps/users/views.py`
- [User data](https://github.com/anurag-shankar-maurya/medicos/blob/main/djangoBackend/apps/users/models.py): `djangoBackend/apps/users/models.py`

### Other components

- **Pharmacy staff**

## Connections

- Pharmacy staff → Authentication: signs in
- Pharmacy staff → Medicine inventory: manages stock
- Pharmacy staff → Billing and checkout: checks out
- Protected routes → Authentication: routes to (evidence: `reactFrontend/app/router.tsx`)
- Protected routes → Dashboard analytics: routes to (evidence: `reactFrontend/app/router.tsx`)
- Protected routes → Medicine inventory: routes to (evidence: `reactFrontend/app/router.tsx`)
- Protected routes → Cart view: routes to (evidence: `reactFrontend/app/router.tsx`)
- Protected routes → Billing and checkout: routes to (evidence: `reactFrontend/app/router.tsx`)
- Protected routes → Sales history: routes to (evidence: `reactFrontend/app/router.tsx`)
- Protected routes → Sale details: routes to (evidence: `reactFrontend/app/router.tsx`)
- Protected routes → Notifications: routes to (evidence: `reactFrontend/app/router.tsx`)
- Protected routes → Reports: routes to (evidence: `reactFrontend/app/router.tsx`)
- Protected routes → Staff management: routes to (evidence: `reactFrontend/app/router.tsx`)
- Protected routes → Auth and app state: guards with (evidence: `reactFrontend/app/router.tsx`)
- Authentication → Auth and app state: uses auth state (evidence: `reactFrontend/features/auth/LoginPage.tsx`)
- Medicine inventory → API client: fetches inventory (evidence: `reactFrontend/features/inventory/MedicineList.tsx`)
- Shopping cart → API client: updates cart (evidence: `reactFrontend/app/CartContext.tsx`)
- Cart view → Shopping cart: uses cart state (evidence: `reactFrontend/features/cart/CartPage.tsx`)
- Billing and checkout → API client: submits checkout (evidence: `reactFrontend/features/billing/BillingPage.tsx`)
- Billing and checkout → Shopping cart: uses cart state (evidence: `reactFrontend/features/billing/BillingPage.tsx`)
- Sales history → API client: loads sales (evidence: `reactFrontend/features/sales/SalesPage.tsx`)
- Sale details → API client: loads sale (evidence: `reactFrontend/features/sales/SaleDetailPage.tsx`)
- Sales history → Receipt display: displays receipt (evidence: `reactFrontend/features/sales/SalesPage.tsx`)
- Sale details → Receipt display: displays receipt (evidence: `reactFrontend/features/sales/SaleDetailPage.tsx`)
- Dashboard analytics → API client: loads metrics (evidence: `reactFrontend/features/dashboard/DashboardPage.tsx`)
- Reports → API client: requests reports (evidence: `reactFrontend/features/reports/ReportsPage.tsx`)
- Notifications → API client: loads alerts (evidence: `reactFrontend/features/notifications/NotificationsPage.tsx`)
- Staff management → API client: manages users (evidence: `reactFrontend/features/staff/StaffPage.tsx`)
- API client → Django API: HTTP requests (evidence: `reactFrontend/services/apiClient.ts`)
- Django API → Medicine handlers: dispatches requests
- Django API → User handlers: dispatches requests
- Medicine handlers → Medicine and sales data: uses domain data
- Dashboard data → Medicine and sales data: queries data (evidence: `djangoBackend/apps/medicines/dashboard_views.py`)
- User handlers → User data: uses user data
