# abdo2000-1/cp-pro-max architecture

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

- Interactive diagram: https://gitdiagram.com/abdo2000-1/cp-pro-max
- Repository: https://github.com/abdo2000-1/cp-pro-max

## Overview

This is a dental-laboratory ERP/CRM interface: staff enter through the routed React application, work orders and cases, and access related clinical, operational, and business records. The principal workflow is order-flow review, case entry, and order detail, with DICOM viewing as a clinical capability. Supporting branches cover CRM records, billing and reporting, workflow/document operations, and application configuration. The README is only a Vite template; product capabilities are inferred from routes, filenames, types, and the sampled source index. Several page implementations were not sampled, so their internal links are omitted.

Main entry points: [`src/App.tsx`](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/App.tsx) (Route application), [`src/pages/Flow.tsx`](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Flow.tsx) (Order flow), [`src/services/store.ts`](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/services/store.ts) (Domain state store), [`src/services/api.ts`](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/services/api.ts) (API adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application shell"]
  node_app["Route application<br/>[App.tsx]"]
  node_layout["Navigation shell<br/>[Layout.tsx]"]
end

subgraph group_clinical["Clinical work"]
  node_flow["Order flow<br/>[Flow.tsx]"]
  node_addcase["Case intake<br/>[AddCase.tsx]"]
  node_orderdetail["Order details"]
  node_dicom["DICOM viewer<br/>[DicomMprViewer.tsx]"]
  node_cases["Case management<br/>[Cases.tsx]"]
  node_caseinfo["Case record<br/>[CaseDetails.tsx]"]
  node_patients["Patient records<br/>[Patients.tsx]"]
end

subgraph group_operations["ERP operations"]
  node_orders["Order operations<br/>[OrderWorkflow.tsx]"]
  node_crm["Clinic and doctor CRM<br/>[Clinics.tsx]"]
  node_billing["Billing<br/>[Billing.tsx]"]
  node_reports["Reports and targets<br/>[Reports.tsx]"]
  node_files["Documents and scans<br/>[OrderFiles.tsx]"]
end

subgraph group_platform["Shared services"]
  node_config["Configuration manager<br/>[ConfigManager.tsx]"]
  node_contexts["App contexts<br/>[ConfigContext.tsx]"]
  node_storehook["Reactive store hook<br/>[useStore.ts]"]
  node_store[("Domain state store<br/>[store.ts]")]
  node_api["API adapter<br/>[api.ts]"]
  node_flowdata["Flow sample data<br/>[flowMockData.ts]"]
end

node_staff(("Staff user"))

node_staff -->|"opens"| node_app
node_app -->|"wraps routes"| node_contexts
node_app -.->|"renders shell"| node_layout
node_app -->|"routes to"| node_flow
node_app -->|"routes to"| node_addcase
node_app -->|"routes to"| node_orderdetail
node_app -->|"routes to"| node_cases
node_app -->|"routes to"| node_caseinfo
node_app -->|"routes to"| node_patients
node_app -->|"routes to"| node_orders
node_app -.->|"routes to"| node_crm
node_app -.->|"routes to"| node_billing
node_app -.->|"routes to"| node_reports
node_app -->|"routes to"| node_files
node_app -->|"routes to"| node_config
node_flow -->|"reads state"| node_storehook
node_flow -->|"uses data"| node_flowdata
node_addcase -->|"updates records"| node_store
node_orderdetail -->|"renders viewer"| node_dicom
node_cases -->|"fetches cases"| node_api
node_caseinfo -->|"fetches case"| node_api
node_storehook -->|"subscribes"| node_store
node_store -->|"uses adapter"| node_api
node_config -->|"reads config"| node_contexts

click node_app "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/App.tsx"
click node_layout "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/components/layout/Layout.tsx"
click node_flow "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Flow.tsx"
click node_addcase "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/AddCase.tsx"
click node_orderdetail "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/OrderDetailsPage.tsx"
click node_dicom "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/components/dicom/DicomMprViewer.tsx"
click node_cases "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Cases.tsx"
click node_caseinfo "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/CaseDetails.tsx"
click node_patients "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Patients.tsx"
click node_orders "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/OrderWorkflow.tsx"
click node_crm "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Clinics.tsx"
click node_billing "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Billing.tsx"
click node_reports "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Reports.tsx"
click node_files "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/OrderFiles.tsx"
click node_config "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/ConfigManager.tsx"
click node_contexts "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/contexts/ConfigContext.tsx"
click node_storehook "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/hooks/useStore.ts"
click node_store "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/services/store.ts"
click node_api "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/services/api.ts"
click node_flowdata "https://github.com/abdo2000-1/cp-pro-max/blob/main/src/data/flowMockData.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_layout,node_staff toneBlue
class node_flow,node_addcase,node_orderdetail,node_dicom,node_cases,node_caseinfo,node_patients toneAmber
class node_orders,node_crm,node_billing,node_reports,node_files toneMint
class node_config,node_contexts,node_storehook,node_store,node_api,node_flowdata toneRose
```

## Components

### Application shell

- [Route application](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/App.tsx): `src/App.tsx`
- [Navigation shell](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/components/layout/Layout.tsx): `src/components/layout/Layout.tsx`

### Clinical work

- [Order flow](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Flow.tsx): `src/pages/Flow.tsx`
- [Case intake](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/AddCase.tsx): `src/pages/AddCase.tsx`
- [Order details](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/OrderDetailsPage.tsx): `src/pages/OrderDetailsPage.tsx`
- [DICOM viewer](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/components/dicom/DicomMprViewer.tsx): `src/components/dicom/DicomMprViewer.tsx`
- [Case management](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Cases.tsx): `src/pages/Cases.tsx`
- [Case record](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/CaseDetails.tsx): `src/pages/CaseDetails.tsx`
- [Patient records](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Patients.tsx): `src/pages/Patients.tsx`

### ERP operations

- [Order operations](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/OrderWorkflow.tsx): `src/pages/OrderWorkflow.tsx`
- [Clinic and doctor CRM](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Clinics.tsx): `src/pages/Clinics.tsx`
- [Billing](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Billing.tsx): `src/pages/Billing.tsx`
- [Reports and targets](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/Reports.tsx): `src/pages/Reports.tsx`
- [Documents and scans](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/OrderFiles.tsx): `src/pages/OrderFiles.tsx`

### Shared services

- [Configuration manager](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/pages/ConfigManager.tsx): `src/pages/ConfigManager.tsx`
- [App contexts](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/contexts/ConfigContext.tsx): `src/contexts/ConfigContext.tsx`
- [Reactive store hook](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/hooks/useStore.ts): `src/hooks/useStore.ts`
- [Domain state store](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/services/store.ts): `src/services/store.ts`
- [API adapter](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/services/api.ts): `src/services/api.ts`
- [Flow sample data](https://github.com/abdo2000-1/cp-pro-max/blob/main/src/data/flowMockData.ts): `src/data/flowMockData.ts`

### Other components

- **Staff user**

## Connections

- Staff user → Route application: opens (evidence: `src/App.tsx`)
- Route application → App contexts: wraps routes (evidence: `src/App.tsx`)
- Route application → Navigation shell: renders shell (evidence: `src/App.tsx`)
- Route application → Order flow: routes to (evidence: `src/App.tsx`)
- Route application → Case intake: routes to (evidence: `src/App.tsx`)
- Route application → Order details: routes to (evidence: `src/App.tsx`)
- Route application → Case management: routes to (evidence: `src/App.tsx`)
- Route application → Case record: routes to (evidence: `src/App.tsx`)
- Route application → Patient records: routes to (evidence: `src/App.tsx`)
- Route application → Order operations: routes to (evidence: `src/App.tsx`)
- Route application → Clinic and doctor CRM: routes to (evidence: `src/App.tsx`)
- Route application → Billing: routes to (evidence: `src/App.tsx`)
- Route application → Reports and targets: routes to (evidence: `src/App.tsx`)
- Route application → Documents and scans: routes to (evidence: `src/App.tsx`)
- Route application → Configuration manager: routes to (evidence: `src/App.tsx`)
- Order flow → Reactive store hook: reads state (evidence: `src/pages/Flow.tsx`)
- Order flow → Flow sample data: uses data (evidence: `src/pages/Flow.tsx`)
- Case intake → Domain state store: updates records (evidence: `src/pages/AddCase.tsx`)
- Order details → DICOM viewer: renders viewer (evidence: `src/pages/OrderDetailsPage.tsx`)
- Case management → API adapter: fetches cases (evidence: `src/pages/Cases.tsx`)
- Case record → API adapter: fetches case (evidence: `src/pages/CaseDetails.tsx`)
- Reactive store hook → Domain state store: subscribes (evidence: `src/hooks/useStore.ts`)
- Domain state store → API adapter: uses adapter (evidence: `src/services/store.ts`)
- Configuration manager → App contexts: reads config (evidence: `src/pages/ConfigManager.tsx`)
