# mhd-muzammil/opencall architecture

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

- Interactive diagram: https://gitdiagram.com/mhd-muzammil/opencall
- Repository: https://github.com/mhd-muzammil/opencall

## Overview

OpenCall is an operational service-call reporting frontend with desktop administration and mobile reporting views. The main workflow is users reviewing and filtering daily call reports, uploading source reports, previewing matches, and generating or editing reports; adjacent capabilities include closed-call reconciliation, live tracking, productivity, quotations, renewals, warranty, and engineer/status administration. The graph follows relationships stated by the SOURCE INDEX and excerpts; several feature pages are unsampled, so their connections are omitted rather than inferred.

Main entry points: [`opencall-frontend/frontend/src/lib/apiClient.ts`](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/apiClient.ts) (API Facade), [`opencall-frontend/frontend/src/app/page.tsx`](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/app/page.tsx) (Report Dashboard), [`opencall-frontend/frontend/src/lib/api/openCallApiClient.ts`](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/api/openCallApiClient.ts) (OpenCall Client), [`opencall-frontend/frontend/src/lib/api/webApiClient.ts`](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/api/webApiClient.ts) (Web API Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reporting["Call Reporting"]
  node_dashboard["Report Dashboard<br/>[page.tsx]"]
  node_mobile_report["Mobile Reports<br/>[useMobileReport.ts]"]
  node_report_history["Report History"]
end

subgraph group_features["Operational Features"]
  node_live_tracking["Live Tracking"]
  node_quotations["Quotations<br/>[page.tsx]"]
  node_renewals["Renewal Pipeline"]
  node_warranty_manager["Warranty Manager"]
  node_closed_warranty["Closed-Call Warranty"]
  node_engineer_target["Engineer Targets"]
  node_target_math["Target Analysis"]
end

subgraph group_admin["Administration"]
  node_admin_engineers["Engineer Administration<br/>[page.tsx]"]
  node_region_counts["Region Counts"]
  node_admin_statuses["RTPL Status Admin"]
end

subgraph group_api["API Access"]
  node_session[("Session Store<br/>[session.ts]")]
  node_api_facade["API Facade<br/>[apiClient.ts]"]
  node_open_call_client["OpenCall Client"]
  node_http_client["HTTP Client<br/>[http.ts]"]
  node_web_api["Web API Client<br/>[webApiClient.ts]"]
  node_renewal_client["Renewal API Client"]
  node_warranty_client["Warranty API Client"]
  node_target_client["Engineer Target Client"]
end

subgraph group_shared["Shared Analytics"]
  node_productivity["Engineer Productivity"]
  node_scheduling["Scheduling Rules<br/>[scheduling.ts]"]
  node_status_buckets["Status Buckets<br/>[statusBuckets.ts]"]
end

node_operator(("Operator"))
node_backend{{"OpenCall API"}}

node_operator -.->|"reviews reports"| node_dashboard
node_dashboard -->|"requests report data"| node_api_facade
node_dashboard -->|"renders"| node_live_tracking
node_mobile_report -->|"requests reports"| node_api_facade
node_mobile_report -->|"selects history"| node_report_history
node_renewals -->|"requests renewals"| node_renewal_client
node_warranty_manager -->|"manages jobs"| node_warranty_client
node_warranty_manager -->|"renders panel"| node_closed_warranty
node_engineer_target -->|"loads targets"| node_target_client
node_engineer_target -->|"analyses results"| node_target_math
node_admin_engineers -->|"manages engineers"| node_api_facade
node_admin_engineers -->|"counts regions"| node_region_counts
node_admin_statuses -->|"manages statuses"| node_api_facade
node_api_facade -->|"delegates calls"| node_open_call_client
node_api_facade -->|"delegates calls"| node_web_api
node_open_call_client -->|"parses responses"| node_http_client
node_web_api -.->|"parses responses"| node_http_client
node_open_call_client -->|"calls endpoints"| node_backend
node_web_api -.->|"calls endpoints"| node_backend
node_productivity -->|"checks statuses"| node_scheduling
node_productivity -->|"maps statuses"| node_status_buckets
node_renewal_client -.->|"requests pipeline data"| node_backend
node_warranty_client -.->|"requests warranty data"| node_backend
node_target_client -->|"requests target data"| node_backend

click node_dashboard "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/app/page.tsx"
click node_mobile_report "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/app/m/useMobileReport.ts"
click node_report_history "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/reportHistorySelection.ts"
click node_live_tracking "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/features/dashboard/components/LiveTrackingPanel.tsx"
click node_quotations "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/app/m/quotations/page.tsx"
click node_renewals "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/features/dashboard/components/RenewalPipelinePage.tsx"
click node_warranty_manager "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/components/WarrantyLookupManager.tsx"
click node_closed_warranty "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/features/dashboard/components/ClosedCallWarrantyPanel.tsx"
click node_engineer_target "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/features/dashboard/components/EngineerTargetTab.tsx"
click node_target_math "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/features/dashboard/components/engineerTargetMath.ts"
click node_admin_engineers "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/app/admin/engineers/page.tsx"
click node_region_counts "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/engineerRegionCounts.ts"
click node_admin_statuses "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/components/AdminRtplStatusesManager.tsx"
click node_session "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/session.ts"
click node_api_facade "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/apiClient.ts"
click node_open_call_client "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/api/openCallApiClient.ts"
click node_http_client "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/api/http.ts"
click node_web_api "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/api/webApiClient.ts"
click node_productivity "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/shared/src/analytics/engineerProductivity.ts"
click node_scheduling "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/shared/src/constants/scheduling.ts"
click node_status_buckets "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/shared/src/constants/statusBuckets.ts"
click node_renewal_client "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/renewalApiClient.ts"
click node_warranty_client "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/warrantyApiClient.ts"
click node_target_client "https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/engineerTargetApiClient.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_dashboard,node_mobile_report,node_report_history toneBlue
class node_live_tracking,node_quotations,node_renewals,node_warranty_manager,node_closed_warranty,node_engineer_target,node_target_math toneAmber
class node_admin_engineers,node_region_counts,node_admin_statuses,node_backend toneMint
class node_session,node_api_facade,node_open_call_client,node_http_client,node_web_api,node_renewal_client,node_warranty_client,node_target_client toneRose
class node_productivity,node_scheduling,node_status_buckets,node_operator toneIndigo
```

## Components

### Call Reporting

- [Report Dashboard](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/app/page.tsx): `opencall-frontend/frontend/src/app/page.tsx`
- [Mobile Reports](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/app/m/useMobileReport.ts): `opencall-frontend/frontend/src/app/m/useMobileReport.ts`
- [Report History](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/reportHistorySelection.ts): `opencall-frontend/frontend/src/lib/reportHistorySelection.ts`

### Operational Features

- [Live Tracking](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/features/dashboard/components/LiveTrackingPanel.tsx): `opencall-frontend/frontend/src/features/dashboard/components/LiveTrackingPanel.tsx`
- [Quotations](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/app/m/quotations/page.tsx): `opencall-frontend/frontend/src/app/m/quotations/page.tsx`
- [Renewal Pipeline](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/features/dashboard/components/RenewalPipelinePage.tsx): `opencall-frontend/frontend/src/features/dashboard/components/RenewalPipelinePage.tsx`
- [Warranty Manager](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/components/WarrantyLookupManager.tsx): `opencall-frontend/frontend/src/components/WarrantyLookupManager.tsx`
- [Closed-Call Warranty](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/features/dashboard/components/ClosedCallWarrantyPanel.tsx): `opencall-frontend/frontend/src/features/dashboard/components/ClosedCallWarrantyPanel.tsx`
- [Engineer Targets](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/features/dashboard/components/EngineerTargetTab.tsx): `opencall-frontend/frontend/src/features/dashboard/components/EngineerTargetTab.tsx`
- [Target Analysis](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/features/dashboard/components/engineerTargetMath.ts): `opencall-frontend/frontend/src/features/dashboard/components/engineerTargetMath.ts`

### Administration

- [Engineer Administration](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/app/admin/engineers/page.tsx): `opencall-frontend/frontend/src/app/admin/engineers/page.tsx`
- [Region Counts](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/engineerRegionCounts.ts): `opencall-frontend/frontend/src/lib/engineerRegionCounts.ts`
- [RTPL Status Admin](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/components/AdminRtplStatusesManager.tsx): `opencall-frontend/frontend/src/components/AdminRtplStatusesManager.tsx`

### API Access

- [Session Store](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/session.ts): `opencall-frontend/frontend/src/lib/session.ts`
- [API Facade](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/apiClient.ts): `opencall-frontend/frontend/src/lib/apiClient.ts`
- [OpenCall Client](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/api/openCallApiClient.ts): `opencall-frontend/frontend/src/lib/api/openCallApiClient.ts`
- [HTTP Client](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/api/http.ts): `opencall-frontend/frontend/src/lib/api/http.ts`
- [Web API Client](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/api/webApiClient.ts): `opencall-frontend/frontend/src/lib/api/webApiClient.ts`
- [Renewal API Client](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/renewalApiClient.ts): `opencall-frontend/frontend/src/lib/renewalApiClient.ts`
- [Warranty API Client](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/warrantyApiClient.ts): `opencall-frontend/frontend/src/lib/warrantyApiClient.ts`
- [Engineer Target Client](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/frontend/src/lib/engineerTargetApiClient.ts): `opencall-frontend/frontend/src/lib/engineerTargetApiClient.ts`

### Shared Analytics

- [Engineer Productivity](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/shared/src/analytics/engineerProductivity.ts): `opencall-frontend/shared/src/analytics/engineerProductivity.ts`
- [Scheduling Rules](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/shared/src/constants/scheduling.ts): `opencall-frontend/shared/src/constants/scheduling.ts`
- [Status Buckets](https://github.com/mhd-muzammil/opencall/blob/main/opencall-frontend/shared/src/constants/statusBuckets.ts): `opencall-frontend/shared/src/constants/statusBuckets.ts`

### Other components

- **Operator**
- **OpenCall API**

## Connections

- Operator → Report Dashboard: reviews reports
- Report Dashboard → API Facade: requests report data (evidence: `opencall-frontend/frontend/src/app/page.tsx`)
- Report Dashboard → Live Tracking: renders (evidence: `opencall-frontend/frontend/src/app/page.tsx`)
- Mobile Reports → API Facade: requests reports (evidence: `opencall-frontend/frontend/src/app/m/useMobileReport.ts`)
- Mobile Reports → Report History: selects history (evidence: `opencall-frontend/frontend/src/app/m/useMobileReport.ts`)
- Renewal Pipeline → Renewal API Client: requests renewals (evidence: `opencall-frontend/frontend/src/features/dashboard/components/RenewalPipelinePage.tsx`)
- Warranty Manager → Warranty API Client: manages jobs (evidence: `opencall-frontend/frontend/src/components/WarrantyLookupManager.tsx`)
- Warranty Manager → Closed-Call Warranty: renders panel (evidence: `opencall-frontend/frontend/src/components/WarrantyLookupManager.tsx`)
- Engineer Targets → Engineer Target Client: loads targets (evidence: `opencall-frontend/frontend/src/features/dashboard/components/EngineerTargetTab.tsx`)
- Engineer Targets → Target Analysis: analyses results (evidence: `opencall-frontend/frontend/src/features/dashboard/components/EngineerTargetTab.tsx`)
- Engineer Administration → API Facade: manages engineers (evidence: `opencall-frontend/frontend/src/app/admin/engineers/page.tsx`)
- Engineer Administration → Region Counts: counts regions (evidence: `opencall-frontend/frontend/src/app/admin/engineers/page.tsx`)
- RTPL Status Admin → API Facade: manages statuses (evidence: `opencall-frontend/frontend/src/components/AdminRtplStatusesManager.tsx`)
- API Facade → OpenCall Client: delegates calls (evidence: `opencall-frontend/frontend/src/lib/apiClient.ts`)
- API Facade → Web API Client: delegates calls (evidence: `opencall-frontend/frontend/src/lib/apiClient.ts`)
- OpenCall Client → HTTP Client: parses responses (evidence: `opencall-frontend/frontend/src/lib/api/openCallApiClient.ts`)
- Web API Client → HTTP Client: parses responses
- OpenCall Client → OpenCall API: calls endpoints (evidence: `opencall-frontend/frontend/src/lib/api/openCallApiClient.ts`)
- Web API Client → OpenCall API: calls endpoints
- Engineer Productivity → Scheduling Rules: checks statuses (evidence: `opencall-frontend/shared/src/analytics/engineerProductivity.ts`)
- Engineer Productivity → Status Buckets: maps statuses (evidence: `opencall-frontend/shared/src/analytics/engineerProductivity.ts`)
- Renewal API Client → OpenCall API: requests pipeline data
- Warranty API Client → OpenCall API: requests warranty data
- Engineer Target Client → OpenCall API: requests target data (evidence: `opencall-frontend/frontend/src/lib/engineerTargetApiClient.ts`)
