# bighadj22/wocart architecture

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

- Interactive diagram: https://gitdiagram.com/bighadj22/wocart
- Repository: https://github.com/bighadj22/wocart

## Overview

Wocart is a cash-on-delivery commerce platform for Algeria. Shoppers browse the storefront and submit orders; merchants manage orders and store operations in the dashboard; the API persists shared commerce data and coordinates delivery and growth integrations. The graph preserves the documented storefront, merchant, delivery, and integration capabilities. Some subsystems are represented by their existing directories because their implementation files were not sampled; edges are limited to README statements or source-index references.

Main entry points: [`cod-client-astro/src/features`](https://github.com/bighadj22/wocart/tree/main/cod-client-astro/src/features) (Merchant dashboard), [`cod-server/src/endpoints/store/routes.ts`](https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/store/routes.ts) (Store API), [`cod-server/src/endpoints/orders/routes.ts`](https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/orders/routes.ts) (Order operations), [`cod-server/src/endpoints/delivery-companies/routes.ts`](https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/delivery-companies/routes.ts) (Carrier management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shopper["Storefront"]
  node_storefront["Theme storefront"]
end

subgraph group_merchant["Merchant Dashboard"]
  node_dashboard["Merchant dashboard"]
  node_apps["App settings<br/>[apps.ts]"]
end

subgraph group_backend["API and Commerce"]
  node_storeapi["Store API<br/>[routes.ts]"]
  node_checkout["Order validation<br/>[validation.ts]"]
  node_orders["Order operations<br/>[routes.ts]"]
  node_products["Product operations<br/>[routes.ts]"]
  node_rbac["Permissions<br/>[scopes.ts]"]
  node_dbclient["Database access<br/>[client.ts]"]
  node_schema[("Commerce schema<br/>[schema.ts]")]
  node_lifecycle["Order lifecycle<br/>[lifecycle.ts]"]
  node_places["Algerian places<br/>[index.ts]"]
  node_offers["Offer pricing<br/>[engine.ts]"]
  node_coupons["Coupon pricing<br/>[engine.ts]"]
  node_commerce[("Commerce data<br/>[schema.ts]")]
end

subgraph group_integrations["Delivery and Growth"]
  node_deliveryapi["Carrier management<br/>[routes.ts]"]
  node_drivers["Driver operations<br/>[routes.ts]"]
  node_shipments["Shipment operations<br/>[routes.ts]"]
  node_carriers["Carrier platforms<br/>[providers.ts]"]
  node_webhooks["Event webhooks<br/>[webhooks.ts]"]
  node_meta["Meta conversion"]
end

node_shopper(("Shopper"))

node_shopper -->|"browses and orders"| node_storefront
node_storefront -->|"requests store data"| node_storeapi
node_storeapi -->|"reads and writes"| node_commerce
node_storeapi -.->|"creates orders"| node_checkout
node_storeapi -.->|"serves catalog"| node_products
node_dashboard -->|"manages orders"| node_orders
node_dashboard -->|"manages products"| node_products
node_dashboard -->|"configures delivery"| node_deliveryapi
node_dashboard -.->|"configures apps"| node_apps
node_orders -->|"moves status"| node_lifecycle
node_orders -.->|"validates orders"| node_checkout
node_orders -->|"hands off"| node_shipments
node_deliveryapi -->|"uses providers"| node_carriers
node_deliveryapi -.->|"receives events"| node_webhooks
node_drivers -->|"uses place data"| node_places
node_shipments -.->|"syncs deliveries"| node_carriers
node_dbclient -->|"configures schema"| node_schema
node_offers -.->|"prices basket offers"| node_commerce
node_coupons -.->|"prices coupons"| node_commerce
node_meta -.->|"reports conversions"| node_webhooks
node_dashboard -.->|"applies permissions"| node_rbac

click node_storefront "https://github.com/bighadj22/wocart/tree/main/cod-astro/theme-00/src/theme"
click node_storeapi "https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/store/routes.ts"
click node_checkout "https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/orders/validation.ts"
click node_orders "https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/orders/routes.ts"
click node_products "https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/products/routes.ts"
click node_deliveryapi "https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/delivery-companies/routes.ts"
click node_drivers "https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/drivers/routes.ts"
click node_shipments "https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/shipments/routes.ts"
click node_dashboard "https://github.com/bighadj22/wocart/tree/main/cod-client-astro/src/features"
click node_apps "https://github.com/bighadj22/wocart/blob/main/cod-shared/queries/apps.ts"
click node_rbac "https://github.com/bighadj22/wocart/blob/main/cod-shared/rbac/scopes.ts"
click node_dbclient "https://github.com/bighadj22/wocart/blob/main/cod-shared/db/client.ts"
click node_schema "https://github.com/bighadj22/wocart/blob/main/cod-shared/db/schema.ts"
click node_lifecycle "https://github.com/bighadj22/wocart/blob/main/cod-shared/orders/lifecycle.ts"
click node_places "https://github.com/bighadj22/wocart/blob/main/cod-shared/places/index.ts"
click node_offers "https://github.com/bighadj22/wocart/blob/main/cod-shared/offers/engine.ts"
click node_coupons "https://github.com/bighadj22/wocart/blob/main/cod-shared/coupons/engine.ts"
click node_carriers "https://github.com/bighadj22/wocart/blob/main/cod-shared/carriers/providers.ts"
click node_webhooks "https://github.com/bighadj22/wocart/blob/main/cod-shared/events/webhooks.ts"
click node_meta "https://github.com/bighadj22/wocart/tree/main/cod-client-astro/src/features/apps/meta"
click node_commerce "https://github.com/bighadj22/wocart/blob/main/cod-shared/db/schema.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_storefront toneBlue
class node_dashboard,node_apps toneAmber
class node_storeapi,node_checkout,node_orders,node_products,node_rbac,node_dbclient,node_schema,node_lifecycle,node_places,node_offers,node_coupons,node_commerce toneMint
class node_deliveryapi,node_drivers,node_shipments,node_carriers,node_webhooks,node_meta toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Theme storefront](https://github.com/bighadj22/wocart/tree/main/cod-astro/theme-00/src/theme): `cod-astro/theme-00/src/theme`

### Merchant Dashboard

- [Merchant dashboard](https://github.com/bighadj22/wocart/tree/main/cod-client-astro/src/features): `cod-client-astro/src/features`
- [App settings](https://github.com/bighadj22/wocart/blob/main/cod-shared/queries/apps.ts): `cod-shared/queries/apps.ts`

### API and Commerce

- [Store API](https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/store/routes.ts): `cod-server/src/endpoints/store/routes.ts`
- [Order validation](https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/orders/validation.ts): `cod-server/src/endpoints/orders/validation.ts`
- [Order operations](https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/orders/routes.ts): `cod-server/src/endpoints/orders/routes.ts`
- [Product operations](https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/products/routes.ts): `cod-server/src/endpoints/products/routes.ts`
- [Permissions](https://github.com/bighadj22/wocart/blob/main/cod-shared/rbac/scopes.ts): `cod-shared/rbac/scopes.ts`
- [Database access](https://github.com/bighadj22/wocart/blob/main/cod-shared/db/client.ts): `cod-shared/db/client.ts`
- [Commerce schema](https://github.com/bighadj22/wocart/blob/main/cod-shared/db/schema.ts): `cod-shared/db/schema.ts`
- [Order lifecycle](https://github.com/bighadj22/wocart/blob/main/cod-shared/orders/lifecycle.ts): `cod-shared/orders/lifecycle.ts`
- [Algerian places](https://github.com/bighadj22/wocart/blob/main/cod-shared/places/index.ts): `cod-shared/places/index.ts`
- [Offer pricing](https://github.com/bighadj22/wocart/blob/main/cod-shared/offers/engine.ts): `cod-shared/offers/engine.ts`
- [Coupon pricing](https://github.com/bighadj22/wocart/blob/main/cod-shared/coupons/engine.ts): `cod-shared/coupons/engine.ts`
- [Commerce data](https://github.com/bighadj22/wocart/blob/main/cod-shared/db/schema.ts): `cod-shared/db/schema.ts`

### Delivery and Growth

- [Carrier management](https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/delivery-companies/routes.ts): `cod-server/src/endpoints/delivery-companies/routes.ts`
- [Driver operations](https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/drivers/routes.ts): `cod-server/src/endpoints/drivers/routes.ts`
- [Shipment operations](https://github.com/bighadj22/wocart/blob/main/cod-server/src/endpoints/shipments/routes.ts): `cod-server/src/endpoints/shipments/routes.ts`
- [Carrier platforms](https://github.com/bighadj22/wocart/blob/main/cod-shared/carriers/providers.ts): `cod-shared/carriers/providers.ts`
- [Event webhooks](https://github.com/bighadj22/wocart/blob/main/cod-shared/events/webhooks.ts): `cod-shared/events/webhooks.ts`
- [Meta conversion](https://github.com/bighadj22/wocart/tree/main/cod-client-astro/src/features/apps/meta): `cod-client-astro/src/features/apps/meta`

### Other components

- **Shopper**

## Connections

- Shopper → Theme storefront: browses and orders (evidence: `README.md`)
- Theme storefront → Store API: requests store data (evidence: `README.md`)
- Store API → Commerce data: reads and writes (evidence: `README.md`)
- Store API → Order validation: creates orders
- Store API → Product operations: serves catalog
- Merchant dashboard → Order operations: manages orders (evidence: `README.md`)
- Merchant dashboard → Product operations: manages products (evidence: `README.md`)
- Merchant dashboard → Carrier management: configures delivery (evidence: `README.md`)
- Merchant dashboard → App settings: configures apps
- Order operations → Order lifecycle: moves status
- Order operations → Order validation: validates orders (evidence: `cod-server/src/endpoints/orders/routes.ts`)
- Order operations → Shipment operations: hands off (evidence: `cod-server/src/endpoints/orders/routes.ts`)
- Carrier management → Carrier platforms: uses providers (evidence: `cod-server/src/endpoints/delivery-companies/routes.ts`)
- Carrier management → Event webhooks: receives events
- Driver operations → Algerian places: uses place data (evidence: `cod-server/src/endpoints/drivers/routes.ts`)
- Shipment operations → Carrier platforms: syncs deliveries
- Database access → Commerce schema: configures schema (evidence: `cod-shared/db/client.ts`)
- Offer pricing → Commerce data: prices basket offers
- Coupon pricing → Commerce data: prices coupons
- Meta conversion → Event webhooks: reports conversions
- Merchant dashboard → Permissions: applies permissions
