# shriprocraft/mithren-agro-customer-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/shriprocraft/mithren-agro-customer-frontend
- Repository: https://github.com/shriprocraft/mithren-agro-customer-frontend

## Overview

Mithren Agro is a customer-facing farm-to-home marketplace frontend; the README says products, orders, sign-in, and tracking use mock data during this foundation phase, with no real payments or authentication. The principal customer journey is browsing the catalog, managing a cart and delivery address, reviewing an order, then viewing order details or tracking. Separate branches cover account management, product reviews, investor opportunities, and informational/support content. Source excerpts support only selected component relationships; unverified route wiring is omitted or shown as dashed.

Main entry points: [`src/components/checkout/ReviewStep.tsx`](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/checkout/ReviewStep.tsx) (Order Review), [`src/app/products/page.tsx`](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/products/page.tsx) (Product Catalog), [`src/components/marketplace/Marketplace.tsx`](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/marketplace/Marketplace.tsx) (Marketplace Browser), [`src/app/investors/page.tsx`](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/investors/page.tsx) (Investor Opportunities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shopping["Shopping"]
  node_catalog["Product Catalog<br/>[page.tsx]"]
  node_product["Product Detail<br/>[page.tsx]"]
  node_marketplace["Marketplace Browser<br/>[Marketplace.tsx]"]
  node_search["Catalog Search"]
  node_cart["Cart State<br/>[CartContext.tsx]"]
  node_wishlist["Wishlist"]
  node_reviews["Product Reviews<br/>[ProductReviews.tsx]"]
  node_home["Storefront Home<br/>[page.tsx]"]
end

subgraph group_checkout["Checkout and Orders"]
  node_checkout["Checkout Address<br/>[AddressStep.tsx]"]
  node_reviewstep["Order Review<br/>[ReviewStep.tsx]"]
  node_quote["Checkout Quote"]
  node_orders["Orders<br/>[OrdersContext.tsx]"]
  node_confirmation["Order Confirmation"]
  node_tracking["Order Tracking<br/>[TrackingView.tsx]"]
end

subgraph group_account["Customer Account"]
  node_addressbook["Address Book"]
  node_auth["Sign-in and Registration<br/>[AuthContext.tsx]"]
  node_accountpages["Account Pages<br/>[page.tsx]"]
end

subgraph group_opportunities["Growth Opportunities"]
  node_investor["Investor Opportunities<br/>[page.tsx]"]
  node_journey["Investor Journey<br/>[page.tsx]"]
end

subgraph group_information["Information and Support"]
  node_policies["Policies and Support<br/>[PolicyPage.tsx]"]
end

node_customer(("Customer"))

node_customer -.->|"browses"| node_catalog
node_customer -.->|"visits"| node_home
node_catalog -.->|"renders"| node_marketplace
node_marketplace -->|"searches"| node_search
node_product -->|"shows"| node_reviews
node_customer -.->|"manages"| node_cart
node_customer -.->|"manages"| node_wishlist
node_checkout -.->|"selects address"| node_addressbook
node_reviewstep -->|"reads"| node_cart
node_reviewstep -->|"reads"| node_addressbook
node_reviewstep -->|"reads"| node_auth
node_reviewstep -->|"uses"| node_orders
node_reviewstep -->|"requests quote"| node_quote
node_customer -.->|"reviews order"| node_reviewstep
node_customer -.->|"views result"| node_confirmation
node_customer -.->|"tracks order"| node_tracking
node_customer -.->|"signs in"| node_auth
node_customer -.->|"manages account"| node_accountpages
node_customer -.->|"explores"| node_investor
node_investor -.->|"opens journey"| node_journey
node_customer -.->|"consults"| node_policies

click node_catalog "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/products/page.tsx"
click node_product "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/products/%5BproductId%5D/page.tsx"
click node_marketplace "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/marketplace/Marketplace.tsx"
click node_search "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/hooks/useCatalogSearch.ts"
click node_cart "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/context/CartContext.tsx"
click node_wishlist "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/context/WishlistContext.tsx"
click node_reviews "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/reviews/ProductReviews.tsx"
click node_checkout "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/checkout/AddressStep.tsx"
click node_addressbook "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/context/AddressBookContext.tsx"
click node_reviewstep "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/checkout/ReviewStep.tsx"
click node_quote "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/hooks/useCheckoutQuote.ts"
click node_orders "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/context/OrdersContext.tsx"
click node_confirmation "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/orders/ConfirmationView.tsx"
click node_tracking "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/orders/TrackingView.tsx"
click node_auth "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/context/AuthContext.tsx"
click node_accountpages "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/account/page.tsx"
click node_investor "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/investors/page.tsx"
click node_journey "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/_investor-journey/overview/page.tsx"
click node_policies "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/policies/PolicyPage.tsx"
click node_home "https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/page.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_catalog,node_product,node_marketplace,node_search,node_cart,node_wishlist,node_reviews,node_home toneBlue
class node_checkout,node_reviewstep,node_quote,node_orders,node_confirmation,node_tracking toneAmber
class node_addressbook,node_auth,node_accountpages toneMint
class node_investor,node_journey toneRose
class node_policies,node_customer toneIndigo
```

## Components

### Shopping

- [Product Catalog](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/products/page.tsx): `src/app/products/page.tsx`
- [Product Detail](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/products/%5BproductId%5D/page.tsx): `src/app/products/[productId]/page.tsx`
- [Marketplace Browser](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/marketplace/Marketplace.tsx): `src/components/marketplace/Marketplace.tsx`
- [Catalog Search](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/hooks/useCatalogSearch.ts): `src/hooks/useCatalogSearch.ts`
- [Cart State](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Wishlist](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/context/WishlistContext.tsx): `src/context/WishlistContext.tsx`
- [Product Reviews](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/reviews/ProductReviews.tsx): `src/components/reviews/ProductReviews.tsx`
- [Storefront Home](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/page.tsx): `src/app/page.tsx`

### Checkout and Orders

- [Checkout Address](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/checkout/AddressStep.tsx): `src/components/checkout/AddressStep.tsx`
- [Order Review](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/checkout/ReviewStep.tsx): `src/components/checkout/ReviewStep.tsx`
- [Checkout Quote](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/hooks/useCheckoutQuote.ts): `src/hooks/useCheckoutQuote.ts`
- [Orders](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/context/OrdersContext.tsx): `src/context/OrdersContext.tsx`
- [Order Confirmation](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/orders/ConfirmationView.tsx): `src/components/orders/ConfirmationView.tsx`
- [Order Tracking](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/orders/TrackingView.tsx): `src/components/orders/TrackingView.tsx`

### Customer Account

- [Address Book](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/context/AddressBookContext.tsx): `src/context/AddressBookContext.tsx`
- [Sign-in and Registration](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Account Pages](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/account/page.tsx): `src/app/account/page.tsx`

### Growth Opportunities

- [Investor Opportunities](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/investors/page.tsx): `src/app/investors/page.tsx`
- [Investor Journey](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/app/_investor-journey/overview/page.tsx): `src/app/_investor-journey/overview/page.tsx`

### Information and Support

- [Policies and Support](https://github.com/shriprocraft/mithren-agro-customer-frontend/blob/main/src/components/policies/PolicyPage.tsx): `src/components/policies/PolicyPage.tsx`

### Other components

- **Customer**

## Connections

- Customer → Product Catalog: browses
- Customer → Storefront Home: visits
- Product Catalog → Marketplace Browser: renders
- Marketplace Browser → Catalog Search: searches (evidence: `src/hooks/useCatalogSearch.ts`)
- Product Detail → Product Reviews: shows (evidence: `src/components/reviews/ProductReviews.tsx`)
- Customer → Cart State: manages
- Customer → Wishlist: manages
- Checkout Address → Address Book: selects address
- Order Review → Cart State: reads (evidence: `src/components/checkout/ReviewStep.tsx`)
- Order Review → Address Book: reads (evidence: `src/components/checkout/ReviewStep.tsx`)
- Order Review → Sign-in and Registration: reads (evidence: `src/components/checkout/ReviewStep.tsx`)
- Order Review → Orders: uses (evidence: `src/components/checkout/ReviewStep.tsx`)
- Order Review → Checkout Quote: requests quote (evidence: `src/components/checkout/ReviewStep.tsx`)
- Customer → Order Review: reviews order
- Customer → Order Confirmation: views result
- Customer → Order Tracking: tracks order
- Customer → Sign-in and Registration: signs in
- Customer → Account Pages: manages account
- Customer → Investor Opportunities: explores
- Investor Opportunities → Investor Journey: opens journey
- Customer → Policies and Support: consults
