# jeevaramesh555-cpu/haaply-new architecture

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

- Interactive diagram: https://gitdiagram.com/jeevaramesh555-cpu/haaply-new
- Repository: https://github.com/jeevaramesh555-cpu/haaply-new

## Overview

This is a multi-channel commerce and local-delivery application: customers browse products, build a cart and place orders; administrators manage catalog, locations, delivery coverage, stock and drivers; drivers handle routes and inventory; and POS users review sales. The route table is directly evidenced in `src/App.tsx`. Service connections below use sampled calls/imports where available; other major feature nodes are retained from the tree, but their internal wiring is not inferred. Firestore is the evident backing store; payment processing is not established by the excerpts.

Main entry points: [`src/App.tsx`](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/App.tsx) (Route application), [`src/driver/services/driverRouteService.ts`](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/driver/services/driverRouteService.ts) (Route management), [`src/driver/services/driverInventoryService.ts`](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/driver/services/driverInventoryService.ts) (Driver inventory), [`src/admin/services/adminDriverAssignmentService.ts`](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/services/adminDriverAssignmentService.ts) (Driver assignment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer shopping"]
  node_catalog["Catalog browsing<br/>[CustomerHome.tsx]"]
  node_product["Product details"]
  node_cart["Cart state<br/>[CartContext.tsx]"]
  node_checkout["Checkout<br/>[CheckoutPage.tsx]"]
  node_customerorders["Order history<br/>[OrdersPage.tsx]"]
  node_orderconfirm["Order confirmation"]
end

subgraph group_operations["Store operations"]
  node_adminorders["Order administration"]
  node_adminproducts["Product administration"]
  node_locations["Location settings"]
  node_admincoverage["Coverage testing"]
  node_assignment["Driver assignment"]
end

subgraph group_delivery["Driver delivery"]
  node_routes["Route management"]
  node_optimization["Route optimization"]
  node_driverinventory["Driver inventory"]
end

subgraph group_pos["Point of sale"]
  node_possales["Sales view<br/>[POSSalesPage.tsx]"]
  node_posorders["POS sales query<br/>[posOrderService.ts]"]
end

subgraph group_data["Shared data"]
  node_orderdata["Order services<br/>[orderService.ts]"]
  node_fulfillment["Fulfillment selection"]
  node_serviceability["Delivery coverage"]
  node_inventory["Inventory services"]
  node_firestore[("Firestore")]
  node_firebaseconfig["Firebase setup<br/>[config.ts]"]
end

node_shopper(("Shopper"))
node_admin(("Administrator"))
node_driver(("Driver"))
node_posuser(("POS user"))
node_app["Route application<br/>[App.tsx]"]
node_googlemaps["Google Maps"]

node_shopper -->|"opens shop"| node_app
node_admin -->|"opens console"| node_app
node_driver -->|"opens driver"| node_app
node_posuser -->|"opens POS"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_product
node_app -->|"provides context"| node_cart
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_customerorders
node_app -->|"routes to"| node_orderconfirm
node_app -->|"routes to"| node_adminorders
node_app -->|"routes to"| node_adminproducts
node_app -->|"routes to"| node_locations
node_app -->|"routes to"| node_admincoverage
node_app -->|"routes to"| node_routes
node_app -->|"routes to"| node_driverinventory
node_app -->|"routes to"| node_possales
node_fulfillment -->|"gets locations"| node_serviceability
node_fulfillment -->|"checks stock"| node_inventory
node_admincoverage -->|"checks coverage"| node_serviceability
node_assignment -->|"assigns order"| node_routes
node_assignment -->|"checks stock"| node_driverinventory
node_optimization -.->|"requests directions"| node_googlemaps
node_possales -->|"loads sales"| node_posorders
node_posorders -->|"reads orders"| node_firestore
node_firebaseconfig -->|"configures access"| node_firestore
node_orderdata -->|"reads/writes"| node_firestore
node_inventory -->|"reads/writes"| node_firestore
node_routes -->|"reads/writes"| node_firestore
node_optimization -->|"reads/writes"| node_firestore
node_driverinventory -->|"reads/writes"| node_firestore

click node_app "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/App.tsx"
click node_catalog "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/customer/pages/CustomerHome.tsx"
click node_product "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/customer/pages/ProductDetailsPage.tsx"
click node_cart "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/customer/components/CartContext.tsx"
click node_checkout "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/customer/pages/CheckoutPage.tsx"
click node_customerorders "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/customer/pages/OrdersPage.tsx"
click node_orderconfirm "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/customer/pages/OrderConfirmationPage.tsx"
click node_orderdata "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/services/orderService.ts"
click node_fulfillment "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/services/fulfillmentService.ts"
click node_serviceability "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/services/serviceabilityService.ts"
click node_inventory "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/services/inventoryService.ts"
click node_adminorders "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/pages/AdminOrdersPage.tsx"
click node_adminproducts "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/pages/AdminProductsPage.tsx"
click node_locations "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/pages/AdminLocationsPage.tsx"
click node_admincoverage "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/pages/AdminServiceabilityPage.tsx"
click node_assignment "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/services/adminDriverAssignmentService.ts"
click node_routes "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/driver/services/driverRouteService.ts"
click node_optimization "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/services/adminRouteOptimizationService.ts"
click node_driverinventory "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/driver/services/driverInventoryService.ts"
click node_possales "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/pos/pages/POSSalesPage.tsx"
click node_posorders "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/pos/services/posOrderService.ts"
click node_firebaseconfig "https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/firebase/config.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_catalog,node_product,node_cart,node_checkout,node_customerorders,node_orderconfirm,node_posuser toneBlue
class node_adminorders,node_adminproducts,node_locations,node_admincoverage,node_assignment toneAmber
class node_routes,node_optimization,node_driverinventory,node_app toneMint
class node_possales,node_posorders toneRose
class node_orderdata,node_fulfillment,node_serviceability,node_inventory,node_firestore,node_firebaseconfig,node_shopper,node_admin,node_driver,node_googlemaps toneIndigo
```

## Components

### Customer shopping

- [Catalog browsing](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/customer/pages/CustomerHome.tsx): `src/customer/pages/CustomerHome.tsx`
- [Product details](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/customer/pages/ProductDetailsPage.tsx): `src/customer/pages/ProductDetailsPage.tsx`
- [Cart state](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/customer/components/CartContext.tsx): `src/customer/components/CartContext.tsx`
- [Checkout](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/customer/pages/CheckoutPage.tsx): `src/customer/pages/CheckoutPage.tsx`
- [Order history](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/customer/pages/OrdersPage.tsx): `src/customer/pages/OrdersPage.tsx`
- [Order confirmation](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/customer/pages/OrderConfirmationPage.tsx): `src/customer/pages/OrderConfirmationPage.tsx`

### Store operations

- [Order administration](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/pages/AdminOrdersPage.tsx): `src/admin/pages/AdminOrdersPage.tsx`
- [Product administration](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/pages/AdminProductsPage.tsx): `src/admin/pages/AdminProductsPage.tsx`
- [Location settings](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/pages/AdminLocationsPage.tsx): `src/admin/pages/AdminLocationsPage.tsx`
- [Coverage testing](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/pages/AdminServiceabilityPage.tsx): `src/admin/pages/AdminServiceabilityPage.tsx`
- [Driver assignment](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/services/adminDriverAssignmentService.ts): `src/admin/services/adminDriverAssignmentService.ts`

### Driver delivery

- [Route management](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/driver/services/driverRouteService.ts): `src/driver/services/driverRouteService.ts`
- [Route optimization](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/admin/services/adminRouteOptimizationService.ts): `src/admin/services/adminRouteOptimizationService.ts`
- [Driver inventory](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/driver/services/driverInventoryService.ts): `src/driver/services/driverInventoryService.ts`

### Point of sale

- [Sales view](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/pos/pages/POSSalesPage.tsx): `src/pos/pages/POSSalesPage.tsx`
- [POS sales query](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/pos/services/posOrderService.ts): `src/pos/services/posOrderService.ts`

### Shared data

- [Order services](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/services/orderService.ts): `src/services/orderService.ts`
- [Fulfillment selection](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/services/fulfillmentService.ts): `src/services/fulfillmentService.ts`
- [Delivery coverage](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/services/serviceabilityService.ts): `src/services/serviceabilityService.ts`
- [Inventory services](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/services/inventoryService.ts): `src/services/inventoryService.ts`
- **Firestore**
- [Firebase setup](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/firebase/config.ts): `src/firebase/config.ts`

### Other components

- **Shopper**
- **Administrator**
- **Driver**
- **POS user**
- [Route application](https://github.com/jeevaramesh555-cpu/haaply-new/blob/main/src/App.tsx): `src/App.tsx`
- **Google Maps**

## Connections

- Shopper → Route application: opens shop
- Administrator → Route application: opens console
- Driver → Route application: opens driver
- POS user → Route application: opens POS
- Route application → Catalog browsing: routes to
- Route application → Product details: routes to
- Route application → Cart state: provides context
- Route application → Checkout: routes to
- Route application → Order history: routes to
- Route application → Order confirmation: routes to
- Route application → Order administration: routes to
- Route application → Product administration: routes to
- Route application → Location settings: routes to
- Route application → Coverage testing: routes to
- Route application → Route management: routes to
- Route application → Driver inventory: routes to
- Route application → Sales view: routes to
- Fulfillment selection → Delivery coverage: gets locations
- Fulfillment selection → Inventory services: checks stock
- Coverage testing → Delivery coverage: checks coverage
- Driver assignment → Route management: assigns order
- Driver assignment → Driver inventory: checks stock
- Route optimization → Google Maps: requests directions
- Sales view → POS sales query: loads sales
- POS sales query → Firestore: reads orders
- Firebase setup → Firestore: configures access
- Order services → Firestore: reads/writes
- Inventory services → Firestore: reads/writes
- Route management → Firestore: reads/writes
- Route optimization → Firestore: reads/writes
- Driver inventory → Firestore: reads/writes
