# dev-adeshina/small-pudo architecture

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

- Interactive diagram: https://gitdiagram.com/dev-adeshina/small-pudo
- Repository: https://github.com/dev-adeshina/small-pudo

## Overview

Pudoless combines a product storefront and order/payment flow with customer shipment quoting, a PUDO partner network, and staff-managed commercial operations. The clearest evidenced workflows are product discovery through cart and checkout, and authenticated shipment quotation through readiness checks and pricing evaluation. Staff and PUDO capabilities are represented from the repository tree, but their runtime connections are not asserted where source excerpts do not show them.

Main entry points: [`app/api/account/shipment-quotes/route.ts`](https://github.com/dev-adeshina/small-pudo/blob/main/app/api/account/shipment-quotes/route.ts) (Shipment Quotes), [`app/page.tsx`](https://github.com/dev-adeshina/small-pudo/blob/main/app/page.tsx) (Storefront), [`lib/firebase.ts`](https://github.com/dev-adeshina/small-pudo/blob/main/lib/firebase.ts) (Firebase Client), [`lib/firebase-admin.ts`](https://github.com/dev-adeshina/small-pudo/blob/main/lib/firebase-admin.ts) (Firebase Admin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront &amp; Orders"]
  node_home["Storefront<br/>[page.tsx]"]
  node_catalog["Product Catalog<br/>[page.tsx]"]
  node_cart["Cart State<br/>[cart-context.tsx]"]
  node_checkout["Checkout<br/>[page.tsx]"]
  node_order_api["Order Creation<br/>[route.ts]"]
  node_payment_init["Payment Initialization<br/>[route.ts]"]
  node_payment_verify["Payment Verification<br/>[route.ts]"]
end

subgraph group_shipping["Shipping &amp; Quotes"]
  node_customer["Customer Account<br/>[page.tsx]"]
  node_quote_api["Shipment Quotes<br/>[route.ts]"]
  node_quote_store[("Quote Store")]
  node_parcel_inputs["Parcel Classification"]
  node_pudo_network["PUDO Locations<br/>[page.tsx]"]
  node_pudo_verification["PUDO Verification<br/>[page.tsx]"]
  node_partner_portal["Partner Portal<br/>[page.tsx]"]
end

subgraph group_operations["Commercial Operations"]
  node_readiness["Quotation Readiness"]
  node_pricing["Pricing Engine"]
  node_staff_pricing["Pricing Approval UI<br/>[page.tsx]"]
  node_route_distance["Route Evidence"]
  node_operational_costs["Operational Costs<br/>[page.tsx]"]
end

subgraph group_platform["Identity &amp; Data"]
  node_firebase["Firebase Client<br/>[firebase.ts]"]
  node_firebase_admin["Firebase Admin<br/>[firebase-admin.ts]"]
  node_customer_auth["Customer Authentication<br/>[customer-auth.ts]"]
end

node_shopper(("Shopper"))
node_paystack["Paystack"]

node_shopper -->|"browses"| node_home
node_home -->|"links to"| node_catalog
node_home -->|"loads categories"| node_firebase
node_catalog -->|"loads products"| node_firebase
node_shopper -->|"adds items"| node_cart
node_checkout -->|"reads cart"| node_cart
node_checkout -->|"uses client data"| node_firebase
node_order_api -->|"reads and writes"| node_firebase_admin
node_payment_init -->|"reads order"| node_firebase_admin
node_payment_init -->|"initializes payment"| node_paystack
node_payment_verify -->|"verifies transaction"| node_paystack
node_payment_verify -->|"updates order"| node_firebase_admin
node_quote_api -->|"authenticates customer"| node_customer_auth
node_quote_api -->|"lists quotes"| node_quote_store
node_quote_api -->|"checks eligibility"| node_readiness
node_quote_api -->|"evaluates pricing"| node_pricing
node_quote_api -->|"builds parcel inputs"| node_parcel_inputs
node_staff_pricing -.->|"configures pricing"| node_pricing
node_customer -.->|"requests quotes"| node_quote_api

click node_home "https://github.com/dev-adeshina/small-pudo/blob/main/app/page.tsx"
click node_catalog "https://github.com/dev-adeshina/small-pudo/blob/main/app/products/page.tsx"
click node_cart "https://github.com/dev-adeshina/small-pudo/blob/main/context/cart-context.tsx"
click node_checkout "https://github.com/dev-adeshina/small-pudo/blob/main/app/checkout/page.tsx"
click node_order_api "https://github.com/dev-adeshina/small-pudo/blob/main/app/api/orders/route.ts"
click node_payment_init "https://github.com/dev-adeshina/small-pudo/blob/main/app/api/payments/initialize/route.ts"
click node_payment_verify "https://github.com/dev-adeshina/small-pudo/blob/main/app/api/payments/verify/route.ts"
click node_customer "https://github.com/dev-adeshina/small-pudo/blob/main/app/account/shipments/page.tsx"
click node_quote_api "https://github.com/dev-adeshina/small-pudo/blob/main/app/api/account/shipment-quotes/route.ts"
click node_readiness "https://github.com/dev-adeshina/small-pudo/blob/main/lib/server/commercial-quotation-readiness-core.ts"
click node_quote_store "https://github.com/dev-adeshina/small-pudo/blob/main/lib/server/shipment-quote-store.ts"
click node_parcel_inputs "https://github.com/dev-adeshina/small-pudo/blob/main/lib/server/commercial-parcel-input-core.ts"
click node_pricing "https://github.com/dev-adeshina/small-pudo/blob/main/lib/server/commercial-pricing-engine-core.ts"
click node_staff_pricing "https://github.com/dev-adeshina/small-pudo/blob/main/app/staff/commercial-pricing-definitions/page.tsx"
click node_route_distance "https://github.com/dev-adeshina/small-pudo/blob/main/lib/server/commercial-route-distance-input-core.ts"
click node_operational_costs "https://github.com/dev-adeshina/small-pudo/blob/main/app/staff/operational-cost-definitions/page.tsx"
click node_pudo_network "https://github.com/dev-adeshina/small-pudo/blob/main/app/staff/pudo-locations/page.tsx"
click node_pudo_verification "https://github.com/dev-adeshina/small-pudo/blob/main/app/staff/pudo-verifications/page.tsx"
click node_partner_portal "https://github.com/dev-adeshina/small-pudo/blob/main/app/pudo-partner/page.tsx"
click node_firebase "https://github.com/dev-adeshina/small-pudo/blob/main/lib/firebase.ts"
click node_firebase_admin "https://github.com/dev-adeshina/small-pudo/blob/main/lib/firebase-admin.ts"
click node_customer_auth "https://github.com/dev-adeshina/small-pudo/blob/main/lib/server/customer-auth.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_home,node_catalog,node_cart,node_checkout,node_order_api,node_payment_init,node_payment_verify toneBlue
class node_customer,node_quote_api,node_quote_store,node_parcel_inputs,node_pudo_network,node_pudo_verification,node_partner_portal toneAmber
class node_readiness,node_pricing,node_staff_pricing,node_route_distance,node_operational_costs toneMint
class node_firebase,node_firebase_admin,node_customer_auth toneRose
class node_shopper,node_paystack toneIndigo
```

## Components

### Storefront & Orders

- [Storefront](https://github.com/dev-adeshina/small-pudo/blob/main/app/page.tsx): `app/page.tsx`
- [Product Catalog](https://github.com/dev-adeshina/small-pudo/blob/main/app/products/page.tsx): `app/products/page.tsx`
- [Cart State](https://github.com/dev-adeshina/small-pudo/blob/main/context/cart-context.tsx): `context/cart-context.tsx`
- [Checkout](https://github.com/dev-adeshina/small-pudo/blob/main/app/checkout/page.tsx): `app/checkout/page.tsx`
- [Order Creation](https://github.com/dev-adeshina/small-pudo/blob/main/app/api/orders/route.ts): `app/api/orders/route.ts`
- [Payment Initialization](https://github.com/dev-adeshina/small-pudo/blob/main/app/api/payments/initialize/route.ts): `app/api/payments/initialize/route.ts`
- [Payment Verification](https://github.com/dev-adeshina/small-pudo/blob/main/app/api/payments/verify/route.ts): `app/api/payments/verify/route.ts`

### Shipping & Quotes

- [Customer Account](https://github.com/dev-adeshina/small-pudo/blob/main/app/account/shipments/page.tsx): `app/account/shipments/page.tsx`
- [Shipment Quotes](https://github.com/dev-adeshina/small-pudo/blob/main/app/api/account/shipment-quotes/route.ts): `app/api/account/shipment-quotes/route.ts`
- [Quote Store](https://github.com/dev-adeshina/small-pudo/blob/main/lib/server/shipment-quote-store.ts): `lib/server/shipment-quote-store.ts`
- [Parcel Classification](https://github.com/dev-adeshina/small-pudo/blob/main/lib/server/commercial-parcel-input-core.ts): `lib/server/commercial-parcel-input-core.ts`
- [PUDO Locations](https://github.com/dev-adeshina/small-pudo/blob/main/app/staff/pudo-locations/page.tsx): `app/staff/pudo-locations/page.tsx`
- [PUDO Verification](https://github.com/dev-adeshina/small-pudo/blob/main/app/staff/pudo-verifications/page.tsx): `app/staff/pudo-verifications/page.tsx`
- [Partner Portal](https://github.com/dev-adeshina/small-pudo/blob/main/app/pudo-partner/page.tsx): `app/pudo-partner/page.tsx`

### Commercial Operations

- [Quotation Readiness](https://github.com/dev-adeshina/small-pudo/blob/main/lib/server/commercial-quotation-readiness-core.ts): `lib/server/commercial-quotation-readiness-core.ts`
- [Pricing Engine](https://github.com/dev-adeshina/small-pudo/blob/main/lib/server/commercial-pricing-engine-core.ts): `lib/server/commercial-pricing-engine-core.ts`
- [Pricing Approval UI](https://github.com/dev-adeshina/small-pudo/blob/main/app/staff/commercial-pricing-definitions/page.tsx): `app/staff/commercial-pricing-definitions/page.tsx`
- [Route Evidence](https://github.com/dev-adeshina/small-pudo/blob/main/lib/server/commercial-route-distance-input-core.ts): `lib/server/commercial-route-distance-input-core.ts`
- [Operational Costs](https://github.com/dev-adeshina/small-pudo/blob/main/app/staff/operational-cost-definitions/page.tsx): `app/staff/operational-cost-definitions/page.tsx`

### Identity & Data

- [Firebase Client](https://github.com/dev-adeshina/small-pudo/blob/main/lib/firebase.ts): `lib/firebase.ts`
- [Firebase Admin](https://github.com/dev-adeshina/small-pudo/blob/main/lib/firebase-admin.ts): `lib/firebase-admin.ts`
- [Customer Authentication](https://github.com/dev-adeshina/small-pudo/blob/main/lib/server/customer-auth.ts): `lib/server/customer-auth.ts`

### Other components

- **Shopper**
- **Paystack**

## Connections

- Shopper → Storefront: browses (evidence: `app/page.tsx`)
- Storefront → Product Catalog: links to (evidence: `app/page.tsx`)
- Storefront → Firebase Client: loads categories (evidence: `app/page.tsx`)
- Product Catalog → Firebase Client: loads products (evidence: `app/products/page.tsx`)
- Shopper → Cart State: adds items (evidence: `context/cart-context.tsx`)
- Checkout → Cart State: reads cart (evidence: `app/checkout/page.tsx`)
- Checkout → Firebase Client: uses client data (evidence: `app/checkout/page.tsx`)
- Order Creation → Firebase Admin: reads and writes (evidence: `app/api/orders/route.ts`)
- Payment Initialization → Firebase Admin: reads order (evidence: `app/api/payments/initialize/route.ts`)
- Payment Initialization → Paystack: initializes payment (evidence: `app/api/payments/initialize/route.ts`)
- Payment Verification → Paystack: verifies transaction (evidence: `app/api/payments/verify/route.ts`)
- Payment Verification → Firebase Admin: updates order (evidence: `app/api/payments/verify/route.ts`)
- Shipment Quotes → Customer Authentication: authenticates customer (evidence: `app/api/account/shipment-quotes/route.ts`)
- Shipment Quotes → Quote Store: lists quotes (evidence: `app/api/account/shipment-quotes/route.ts`)
- Shipment Quotes → Quotation Readiness: checks eligibility (evidence: `app/api/account/shipment-quotes/route.ts`)
- Shipment Quotes → Pricing Engine: evaluates pricing (evidence: `app/api/account/shipment-quotes/route.ts`)
- Shipment Quotes → Parcel Classification: builds parcel inputs (evidence: `app/api/account/shipment-quotes/route.ts`)
- Pricing Approval UI → Pricing Engine: configures pricing
- Customer Account → Shipment Quotes: requests quotes
