# stratonflorentin-dot/kariakoo-in-ur-pockect architecture

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

- Interactive diagram: https://gitdiagram.com/stratonflorentin-dot/kariakoo-in-ur-pockect
- Repository: https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect

## Overview

KARIAKOO is a multi-vendor marketplace: customers browse a live-or-demo catalog, build a cart, and submit a server-priced order; the platform coordinates shop fulfilment, one-rider delivery, and post-delivery seller settlement. Seller and admin workspaces manage products, orders, commissions, and marketplace operations, while the rider app handles offers and delivery steps including PIN verification. The README says orders, riders, and dashboards remain demo-backed and real payments are not live. Arrows use the README and shown source-index relationships; unsampled implementation details are not inferred.

Main entry points: [`src/app/customer/checkout/actions.ts`](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/customer/checkout/actions.ts) (Checkout action), [`src/lib/catalog-source.ts`](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/catalog-source.ts) (Catalog source), [`src/app/rider/page.tsx`](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/rider/page.tsx) (Rider jobs), [`src/app/seller/page.tsx`](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/seller/page.tsx) (Seller workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer storefront"]
  node_customer_store["Store browsing<br/>[page.tsx]"]
  node_catalog_source["Catalog source<br/>[catalog-source.ts]"]
  node_catalog["Catalog search<br/>[catalog.ts]"]
  node_supabase[("Supabase catalog<br/>[server.ts]")]
end

subgraph group_commerce["Order lifecycle"]
  node_cart["Cart<br/>[page.tsx]"]
  node_checkout["Checkout action<br/>[actions.ts]"]
  node_customer_orders["Customer orders<br/>[page.tsx]"]
  node_payments["Payment providers<br/>[providers.ts]"]
end

subgraph group_fulfillment["Marketplace operations"]
  node_dispatch["Delivery dispatch<br/>[dispatch.ts]"]
  node_seller_workspace["Seller workspace<br/>[page.tsx]"]
  node_seller_products["Product management"]
  node_admin_workspace["Admin controls<br/>[page.tsx]"]
  node_rider_app["Rider jobs<br/>[page.tsx]"]
  node_delivery_flow["Delivery steps<br/>[DeliveryFlow.tsx]"]
  node_maps["Marketplace maps<br/>[MarketMap.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_role_access["Role-scoped access<br/>[access.ts]"]
  node_session["Server session<br/>[session.ts]"]
end

subgraph group_domain["Shared domain services"]
  node_pricing["Server pricing<br/>[pricing.ts]"]
  node_order_state["Order status rules<br/>[status.ts]"]
  node_money["Money and commission<br/>[money.ts]"]
end

node_customer(("Customer"))

node_customer -->|"browses"| node_customer_store
node_customer_store -->|"loads catalog"| node_catalog_source
node_catalog_source -->|"builds view"| node_catalog
node_catalog_source -->|"reads live data"| node_supabase
node_catalog_source -->|"falls back"| node_catalog
node_customer -->|"adds products"| node_cart
node_customer -->|"submits order"| node_checkout
node_checkout -->|"re-prices"| node_pricing
node_checkout -.->|"creates order"| node_customer_orders
node_customer_orders -.->|"shows status"| node_order_state
node_checkout -.->|"calculates totals"| node_money
node_checkout -.->|"selects payment"| node_payments
node_seller_workspace -->|"loads scoped data"| node_role_access
node_seller_products -.->|"manages products"| node_seller_workspace
node_admin_workspace -->|"loads admin data"| node_role_access
node_rider_app -->|"loads rider jobs"| node_role_access
node_rider_app -.->|"opens job steps"| node_delivery_flow
node_delivery_flow -->|"advances delivery"| node_order_state
node_dispatch -.->|"offers jobs"| node_rider_app
node_session -->|"authorizes records"| node_role_access
node_seller_workspace -->|"shows shop location"| node_maps
node_rider_app -->|"shows delivery route"| node_maps
node_customer_orders -->|"shows delivery route"| node_maps
node_money -->|"supports settlements"| node_seller_workspace
node_order_state -.->|"coordinates fulfilment"| node_dispatch

click node_customer_store "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/customer/page.tsx"
click node_catalog_source "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/catalog-source.ts"
click node_catalog "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/catalog.ts"
click node_supabase "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/supabase/server.ts"
click node_cart "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/customer/cart/page.tsx"
click node_checkout "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/customer/checkout/actions.ts"
click node_pricing "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/pricing.ts"
click node_customer_orders "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/customer/orders/%5Bid%5D/page.tsx"
click node_order_state "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/status.ts"
click node_dispatch "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/data/dispatch.ts"
click node_seller_workspace "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/seller/page.tsx"
click node_seller_products "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/components/dashboard/SellerProductsManager.tsx"
click node_admin_workspace "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/admin/page.tsx"
click node_rider_app "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/rider/page.tsx"
click node_delivery_flow "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/components/rider/DeliveryFlow.tsx"
click node_role_access "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/data/access.ts"
click node_session "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/auth/session.ts"
click node_money "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/money.ts"
click node_payments "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/payments/providers.ts"
click node_maps "https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/components/map/MarketMap.tsx"

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_customer_store,node_catalog_source,node_catalog,node_supabase toneBlue
class node_cart,node_checkout,node_customer_orders,node_payments toneAmber
class node_dispatch,node_seller_workspace,node_seller_products,node_admin_workspace,node_rider_app,node_delivery_flow,node_maps toneMint
class node_role_access,node_session toneRose
class node_pricing,node_order_state,node_money,node_customer toneIndigo
```

## Components

### Customer storefront

- [Store browsing](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/customer/page.tsx): `src/app/customer/page.tsx`
- [Catalog source](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/catalog-source.ts): `src/lib/catalog-source.ts`
- [Catalog search](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/catalog.ts): `src/lib/catalog.ts`
- [Supabase catalog](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`

### Order lifecycle

- [Cart](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/customer/cart/page.tsx): `src/app/customer/cart/page.tsx`
- [Checkout action](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/customer/checkout/actions.ts): `src/app/customer/checkout/actions.ts`
- [Customer orders](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/customer/orders/%5Bid%5D/page.tsx): `src/app/customer/orders/[id]/page.tsx`
- [Payment providers](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/payments/providers.ts): `src/lib/payments/providers.ts`

### Marketplace operations

- [Delivery dispatch](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/data/dispatch.ts): `src/lib/data/dispatch.ts`
- [Seller workspace](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/seller/page.tsx): `src/app/seller/page.tsx`
- [Product management](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/components/dashboard/SellerProductsManager.tsx): `src/components/dashboard/SellerProductsManager.tsx`
- [Admin controls](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`
- [Rider jobs](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/app/rider/page.tsx): `src/app/rider/page.tsx`
- [Delivery steps](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/components/rider/DeliveryFlow.tsx): `src/components/rider/DeliveryFlow.tsx`
- [Marketplace maps](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/components/map/MarketMap.tsx): `src/components/map/MarketMap.tsx`

### Identity and access

- [Role-scoped access](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/data/access.ts): `src/lib/data/access.ts`
- [Server session](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/auth/session.ts): `src/lib/auth/session.ts`

### Shared domain services

- [Server pricing](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/pricing.ts): `src/lib/pricing.ts`
- [Order status rules](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/status.ts): `src/lib/status.ts`
- [Money and commission](https://github.com/stratonflorentin-dot/kariakoo-in-ur-pockect/blob/main/src/lib/money.ts): `src/lib/money.ts`

### Other components

- **Customer**

## Connections

- Customer → Store browsing: browses
- Store browsing → Catalog source: loads catalog (evidence: `src/app/customer/page.tsx`)
- Catalog source → Catalog search: builds view (evidence: `src/lib/catalog-source.ts`)
- Catalog source → Supabase catalog: reads live data
- Catalog source → Catalog search: falls back (evidence: `src/lib/catalog-source.ts`)
- Customer → Cart: adds products
- Customer → Checkout action: submits order
- Checkout action → Server pricing: re-prices
- Checkout action → Customer orders: creates order
- Customer orders → Order status rules: shows status
- Checkout action → Money and commission: calculates totals
- Checkout action → Payment providers: selects payment
- Seller workspace → Role-scoped access: loads scoped data (evidence: `src/app/seller/page.tsx`)
- Product management → Seller workspace: manages products
- Admin controls → Role-scoped access: loads admin data (evidence: `src/app/admin/page.tsx`)
- Rider jobs → Role-scoped access: loads rider jobs (evidence: `src/app/rider/page.tsx`)
- Rider jobs → Delivery steps: opens job steps
- Delivery steps → Order status rules: advances delivery (evidence: `src/components/rider/DeliveryFlow.tsx`)
- Delivery dispatch → Rider jobs: offers jobs
- Server session → Role-scoped access: authorizes records (evidence: `src/lib/data/access.ts`)
- Seller workspace → Marketplace maps: shows shop location
- Rider jobs → Marketplace maps: shows delivery route
- Customer orders → Marketplace maps: shows delivery route
- Money and commission → Seller workspace: supports settlements (evidence: `src/app/seller/page.tsx`)
- Order status rules → Delivery dispatch: coordinates fulfilment
