# krudcoding/camdelivery architecture

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

- Interactive diagram: https://gitdiagram.com/krudcoding/camdelivery
- Repository: https://github.com/krudcoding/camdelivery

## Overview

This is a Cambodia-focused delivery app for comparing courier options, managing shipments, and tracking deliveries, with supporting account, payment, and convenience features. The main user workflow enters through the app shell, uses the home hub to discover delivery tools, compares carrier quotes, and follows a shipment in live tracking. Account and banking capabilities form a parallel branch. Local persistence, delivery estimates, route optimization, and loyalty logic provide internal support. Relationships involving unsampled components are included only where the source index lists the relevant imports; the README is empty.

Main entry points: [`src/components/HomeHubView.tsx`](https://github.com/krudcoding/camdelivery/blob/main/src/components/HomeHubView.tsx) (Home hub), [`src/App.tsx`](https://github.com/krudcoding/camdelivery/blob/main/src/App.tsx) (App shell), [`src/components/LiveTrackingView.tsx`](https://github.com/krudcoding/camdelivery/blob/main/src/components/LiveTrackingView.tsx) (Live tracking), [`src/components/CourierCompareView.tsx`](https://github.com/krudcoding/camdelivery/blob/main/src/components/CourierCompareView.tsx) (Courier comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_application["App shell<br/>[App.tsx]"]
  node_home["Home hub<br/>[HomeHubView.tsx]"]
end

subgraph group_delivery["Shipping and tracking"]
  node_tracking["Live tracking"]
  node_compare["Courier comparison"]
  node_courier_verify["Courier verification"]
  node_driver_map["Driver live map<br/>[DriverLiveMap.tsx]"]
end

subgraph group_convenience["Discovery and mobility"]
  node_map_dashboard["Map dashboard<br/>[MapDashboard.tsx]"]
  node_quick_estimator["Quick cost estimator"]
  node_route_engine["Route optimization"]
  node_voice_search["Voice search"]
  node_support["Support hub<br/>[SupportHub.tsx]"]
end

subgraph group_account["Accounts and engagement"]
  node_account["Account and banking"]
  node_khqr["Bakong KHQR"]
end

subgraph group_foundation["Data and services"]
  node_carriers["Carrier data and quotes<br/>[carriers.ts]"]
  node_delivery_history["Delivery history<br/>[deliveryHistory.ts]"]
  node_delivery_calc["Delivery calculator"]
  node_route_optimizer["Route optimizer utility<br/>[routeOptimizer.ts]"]
  node_route_locations["Route locations"]
  node_loyalty["Loyalty service<br/>[loyaltyService.ts]"]
  node_offline[("Offline storage<br/>[offlineStorage.ts]")]
  node_notifications["Notification service"]
  node_saved_addresses["Saved address service"]
end

node_user(("Customer"))

node_user -.->|"opens"| node_application
node_application -->|"renders"| node_home
node_application -->|"renders"| node_tracking
node_application -->|"renders"| node_compare
node_application -->|"renders"| node_account
node_application -->|"reads and saves"| node_offline
node_home -->|"renders"| node_quick_estimator
node_home -->|"renders"| node_route_engine
node_home -->|"renders"| node_map_dashboard
node_home -->|"renders"| node_voice_search
node_home -->|"renders"| node_support
node_home -->|"reads"| node_carriers
node_tracking -->|"requests permission"| node_notifications
node_tracking -->|"renders"| node_courier_verify
node_tracking -->|"renders"| node_driver_map
node_tracking -->|"reads and saves"| node_offline
node_compare -->|"gets quotes"| node_carriers
node_compare -->|"renders"| node_khqr
node_carriers -->|"calculates schedules"| node_delivery_calc
node_route_engine -->|"optimizes routes"| node_route_optimizer
node_route_engine -->|"uses locations"| node_route_locations
node_account -->|"uses"| node_loyalty
node_account -->|"reads"| node_delivery_history
node_loyalty -->|"reads history"| node_delivery_history

click node_application "https://github.com/krudcoding/camdelivery/blob/main/src/App.tsx"
click node_home "https://github.com/krudcoding/camdelivery/blob/main/src/components/HomeHubView.tsx"
click node_tracking "https://github.com/krudcoding/camdelivery/blob/main/src/components/LiveTrackingView.tsx"
click node_compare "https://github.com/krudcoding/camdelivery/blob/main/src/components/CourierCompareView.tsx"
click node_courier_verify "https://github.com/krudcoding/camdelivery/blob/main/src/components/CourierVerificationModal.tsx"
click node_driver_map "https://github.com/krudcoding/camdelivery/blob/main/src/components/DriverLiveMap.tsx"
click node_map_dashboard "https://github.com/krudcoding/camdelivery/blob/main/src/components/MapDashboard.tsx"
click node_quick_estimator "https://github.com/krudcoding/camdelivery/blob/main/src/components/QuickCostEstimator.tsx"
click node_route_engine "https://github.com/krudcoding/camdelivery/blob/main/src/components/RouteOptimizationEngine.tsx"
click node_voice_search "https://github.com/krudcoding/camdelivery/blob/main/src/components/VoiceSearchButton.tsx"
click node_support "https://github.com/krudcoding/camdelivery/blob/main/src/components/SupportHub.tsx"
click node_account "https://github.com/krudcoding/camdelivery/blob/main/src/components/AccountAndBankingView.tsx"
click node_khqr "https://github.com/krudcoding/camdelivery/blob/main/src/components/BakongKHQRModal.tsx"
click node_carriers "https://github.com/krudcoding/camdelivery/blob/main/src/data/carriers.ts"
click node_delivery_history "https://github.com/krudcoding/camdelivery/blob/main/src/data/deliveryHistory.ts"
click node_delivery_calc "https://github.com/krudcoding/camdelivery/blob/main/src/utils/deliveryCalculator.ts"
click node_route_optimizer "https://github.com/krudcoding/camdelivery/blob/main/src/utils/routeOptimizer.ts"
click node_route_locations "https://github.com/krudcoding/camdelivery/blob/main/src/data/cambodiaRouteLocations.ts"
click node_loyalty "https://github.com/krudcoding/camdelivery/blob/main/src/utils/loyaltyService.ts"
click node_offline "https://github.com/krudcoding/camdelivery/blob/main/src/utils/offlineStorage.ts"
click node_notifications "https://github.com/krudcoding/camdelivery/blob/main/src/services/notificationService.ts"
click node_saved_addresses "https://github.com/krudcoding/camdelivery/blob/main/src/utils/savedAddressService.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_application,node_home toneBlue
class node_tracking,node_compare,node_courier_verify,node_driver_map toneAmber
class node_map_dashboard,node_quick_estimator,node_route_engine,node_voice_search,node_support toneMint
class node_account,node_khqr toneRose
class node_carriers,node_delivery_history,node_delivery_calc,node_route_optimizer,node_route_locations,node_loyalty,node_offline,node_notifications,node_saved_addresses,node_user toneIndigo
```

## Components

### App shell

- [App shell](https://github.com/krudcoding/camdelivery/blob/main/src/App.tsx): `src/App.tsx`
- [Home hub](https://github.com/krudcoding/camdelivery/blob/main/src/components/HomeHubView.tsx): `src/components/HomeHubView.tsx`

### Shipping and tracking

- [Live tracking](https://github.com/krudcoding/camdelivery/blob/main/src/components/LiveTrackingView.tsx): `src/components/LiveTrackingView.tsx`
- [Courier comparison](https://github.com/krudcoding/camdelivery/blob/main/src/components/CourierCompareView.tsx): `src/components/CourierCompareView.tsx`
- [Courier verification](https://github.com/krudcoding/camdelivery/blob/main/src/components/CourierVerificationModal.tsx): `src/components/CourierVerificationModal.tsx`
- [Driver live map](https://github.com/krudcoding/camdelivery/blob/main/src/components/DriverLiveMap.tsx): `src/components/DriverLiveMap.tsx`

### Discovery and mobility

- [Map dashboard](https://github.com/krudcoding/camdelivery/blob/main/src/components/MapDashboard.tsx): `src/components/MapDashboard.tsx`
- [Quick cost estimator](https://github.com/krudcoding/camdelivery/blob/main/src/components/QuickCostEstimator.tsx): `src/components/QuickCostEstimator.tsx`
- [Route optimization](https://github.com/krudcoding/camdelivery/blob/main/src/components/RouteOptimizationEngine.tsx): `src/components/RouteOptimizationEngine.tsx`
- [Voice search](https://github.com/krudcoding/camdelivery/blob/main/src/components/VoiceSearchButton.tsx): `src/components/VoiceSearchButton.tsx`
- [Support hub](https://github.com/krudcoding/camdelivery/blob/main/src/components/SupportHub.tsx): `src/components/SupportHub.tsx`

### Accounts and engagement

- [Account and banking](https://github.com/krudcoding/camdelivery/blob/main/src/components/AccountAndBankingView.tsx): `src/components/AccountAndBankingView.tsx`
- [Bakong KHQR](https://github.com/krudcoding/camdelivery/blob/main/src/components/BakongKHQRModal.tsx): `src/components/BakongKHQRModal.tsx`

### Data and services

- [Carrier data and quotes](https://github.com/krudcoding/camdelivery/blob/main/src/data/carriers.ts): `src/data/carriers.ts`
- [Delivery history](https://github.com/krudcoding/camdelivery/blob/main/src/data/deliveryHistory.ts): `src/data/deliveryHistory.ts`
- [Delivery calculator](https://github.com/krudcoding/camdelivery/blob/main/src/utils/deliveryCalculator.ts): `src/utils/deliveryCalculator.ts`
- [Route optimizer utility](https://github.com/krudcoding/camdelivery/blob/main/src/utils/routeOptimizer.ts): `src/utils/routeOptimizer.ts`
- [Route locations](https://github.com/krudcoding/camdelivery/blob/main/src/data/cambodiaRouteLocations.ts): `src/data/cambodiaRouteLocations.ts`
- [Loyalty service](https://github.com/krudcoding/camdelivery/blob/main/src/utils/loyaltyService.ts): `src/utils/loyaltyService.ts`
- [Offline storage](https://github.com/krudcoding/camdelivery/blob/main/src/utils/offlineStorage.ts): `src/utils/offlineStorage.ts`
- [Notification service](https://github.com/krudcoding/camdelivery/blob/main/src/services/notificationService.ts): `src/services/notificationService.ts`
- [Saved address service](https://github.com/krudcoding/camdelivery/blob/main/src/utils/savedAddressService.ts): `src/utils/savedAddressService.ts`

### Other components

- **Customer**

## Connections

- Customer → App shell: opens
- App shell → Home hub: renders (evidence: `src/App.tsx`)
- App shell → Live tracking: renders (evidence: `src/App.tsx`)
- App shell → Courier comparison: renders (evidence: `src/App.tsx`)
- App shell → Account and banking: renders (evidence: `src/App.tsx`)
- App shell → Offline storage: reads and saves (evidence: `src/App.tsx`)
- Home hub → Quick cost estimator: renders (evidence: `src/components/HomeHubView.tsx`)
- Home hub → Route optimization: renders (evidence: `src/components/HomeHubView.tsx`)
- Home hub → Map dashboard: renders (evidence: `src/components/HomeHubView.tsx`)
- Home hub → Voice search: renders (evidence: `src/components/HomeHubView.tsx`)
- Home hub → Support hub: renders (evidence: `src/components/HomeHubView.tsx`)
- Home hub → Carrier data and quotes: reads (evidence: `src/components/HomeHubView.tsx`)
- Live tracking → Notification service: requests permission (evidence: `src/components/LiveTrackingView.tsx`)
- Live tracking → Courier verification: renders (evidence: `src/components/LiveTrackingView.tsx`)
- Live tracking → Driver live map: renders (evidence: `src/components/LiveTrackingView.tsx`)
- Live tracking → Offline storage: reads and saves (evidence: `src/components/LiveTrackingView.tsx`)
- Courier comparison → Carrier data and quotes: gets quotes (evidence: `src/components/CourierCompareView.tsx`)
- Courier comparison → Bakong KHQR: renders (evidence: `src/components/CourierCompareView.tsx`)
- Carrier data and quotes → Delivery calculator: calculates schedules (evidence: `src/data/carriers.ts`)
- Route optimization → Route optimizer utility: optimizes routes (evidence: `src/components/RouteOptimizationEngine.tsx`)
- Route optimization → Route locations: uses locations (evidence: `src/components/RouteOptimizationEngine.tsx`)
- Account and banking → Loyalty service: uses (evidence: `src/components/AccountAndBankingView.tsx`)
- Account and banking → Delivery history: reads (evidence: `src/components/AccountAndBankingView.tsx`)
- Loyalty service → Delivery history: reads history (evidence: `src/utils/loyaltyService.ts`)
