# nehagowda06/win-dia architecture

> Architecture diagram of the GitHub repository nehagowda06/win-dia, 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/nehagowda06/win-dia
- Repository: https://github.com/nehagowda06/win-dia

## Overview

This repository implements a food e-commerce storefront with customer accounts, product browsing, cart and checkout, order management, and administrative functions. The principal purchase flow is represented by the shown orders API invoking checkout; the cart API similarly delegates to cart service. Backend services, repositories, and Supabase provide the internal application and persistence layers. The tree shows additional payment, shipment, promotion, review, wishlist, CMS, and admin capabilities, but their implementation links were not sampled; those links are omitted rather than inferred.

Main entry points: [`app/api/orders/route.ts`](https://github.com/nehagowda06/win-dia/blob/main/app/api/orders/route.ts) (Orders API), [`src/backend/repositories`](https://github.com/nehagowda06/win-dia/tree/main/src/backend/repositories) (Data repositories), [`app/api/cart/route.ts`](https://github.com/nehagowda06/win-dia/blob/main/app/api/cart/route.ts) (Cart API), [`app/shop/page.tsx`](https://github.com/nehagowda06/win-dia/blob/main/app/shop/page.tsx) (Storefront pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_storefront["Storefront pages<br/>[page.tsx]"]
  node_product["Product detail<br/>[page.tsx]"]
  node_home["Home experience<br/>[Home.jsx]"]
  node_authui["Account pages<br/>[page.js]"]
  node_authhook["Auth state<br/>[useAuth.js]"]
  node_cartui["Cart screen<br/>[CartPage.jsx]"]
  node_checkoutui["Checkout screen<br/>[CheckoutPage.jsx]"]
  node_orderconfirm["Order confirmation"]
end

subgraph group_commerce["Commerce"]
  node_cartapi["Cart API<br/>[route.ts]"]
  node_ordersapi["Orders API<br/>[route.ts]"]
  node_cartservice["Cart service<br/>[cart.service.ts]"]
  node_checkoutservice["Checkout service"]
  node_orderservice["Order service<br/>[order.service.ts]"]
  node_paymentapi["Payment endpoints<br/>[route.ts]"]
  node_shipment["Shipment tracking"]
  node_catalog["Catalog services<br/>[product.service.ts]"]
  node_customerfeatures["Customer features"]
  node_reviews["Review service<br/>[review.service.ts]"]
end

subgraph group_platform["Backend platform"]
  node_provider["Dependency container"]
  node_repositories["Data repositories"]
  node_supabase[("Supabase database<br/>[supabase.config.ts]")]
  node_responses["API response handling"]
end

subgraph group_operations["Store operations"]
  node_admin["Admin console<br/>[page.jsx]"]
  node_adminapi["Admin endpoints<br/>[route.ts]"]
  node_cms["Content management<br/>[cms.service.ts]"]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_storefront
node_shopper -->|"manages account"| node_authui
node_shopper -->|"reviews cart"| node_cartui
node_shopper -->|"starts checkout"| node_checkoutui
node_storefront -->|"renders"| node_home
node_authui -.->|"uses auth state"| node_authhook
node_checkoutui -.->|"submits order"| node_ordersapi
node_cartui -.->|"requests cart"| node_cartapi
node_cartapi -->|"invokes"| node_cartservice
node_cartapi -->|"formats result"| node_responses
node_ordersapi -->|"processes checkout"| node_checkoutservice
node_ordersapi -->|"fetches orders"| node_orderservice
node_ordersapi -->|"formats result"| node_responses
node_ordersapi -.->|"returns order data"| node_orderconfirm
node_paymentapi -.->|"verifies payment"| node_checkoutservice
node_shipment -.->|"reads order state"| node_orderservice
node_catalog -.->|"serves products"| node_storefront
node_customerfeatures -.->|"supports wishlist"| node_shopper
node_reviews -->|"uses repository"| node_repositories
node_reviews -.->|"supports moderation"| node_admin
node_admin -.->|"manages catalog"| node_adminapi
node_adminapi -.->|"resolves services"| node_provider
node_cms -.->|"uses content storage"| node_repositories
node_provider -->|"constructs repositories"| node_repositories
node_repositories -.->|"persists data"| node_supabase

click node_storefront "https://github.com/nehagowda06/win-dia/blob/main/app/shop/page.tsx"
click node_product "https://github.com/nehagowda06/win-dia/blob/main/app/product/%5Bid%5D/page.tsx"
click node_home "https://github.com/nehagowda06/win-dia/blob/main/app/Home/Home/Home.jsx"
click node_authui "https://github.com/nehagowda06/win-dia/blob/main/app/login/page.js"
click node_authhook "https://github.com/nehagowda06/win-dia/blob/main/src/frontend/hooks/useAuth.js"
click node_cartui "https://github.com/nehagowda06/win-dia/blob/main/src/frontend/screens/Cart/CartPage.jsx"
click node_checkoutui "https://github.com/nehagowda06/win-dia/blob/main/src/frontend/screens/Checkout/CheckoutPage.jsx"
click node_orderconfirm "https://github.com/nehagowda06/win-dia/blob/main/src/frontend/screens/OrderConfirmation/OrderConfirmationPage.jsx"
click node_cartapi "https://github.com/nehagowda06/win-dia/blob/main/app/api/cart/route.ts"
click node_ordersapi "https://github.com/nehagowda06/win-dia/blob/main/app/api/orders/route.ts"
click node_cartservice "https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/cart.service.ts"
click node_checkoutservice "https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/checkout.service.ts"
click node_orderservice "https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/order.service.ts"
click node_paymentapi "https://github.com/nehagowda06/win-dia/blob/main/app/api/payment/verify/route.ts"
click node_shipment "https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/shipment.service.ts"
click node_catalog "https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/product.service.ts"
click node_customerfeatures "https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/wishlist.service.ts"
click node_reviews "https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/review.service.ts"
click node_admin "https://github.com/nehagowda06/win-dia/blob/main/app/admin/page.jsx"
click node_adminapi "https://github.com/nehagowda06/win-dia/blob/main/app/api/admin/products/route.ts"
click node_cms "https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/cms.service.ts"
click node_provider "https://github.com/nehagowda06/win-dia/blob/main/src/backend/providers/container.provider.ts"
click node_repositories "https://github.com/nehagowda06/win-dia/tree/main/src/backend/repositories"
click node_supabase "https://github.com/nehagowda06/win-dia/blob/main/src/backend/config/supabase.config.ts"
click node_responses "https://github.com/nehagowda06/win-dia/blob/main/src/backend/utils/route-helper.util.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,node_product,node_home,node_authui,node_authhook,node_cartui,node_checkoutui,node_orderconfirm toneBlue
class node_cartapi,node_ordersapi,node_cartservice,node_checkoutservice,node_orderservice,node_paymentapi,node_shipment,node_catalog,node_customerfeatures,node_reviews toneAmber
class node_provider,node_repositories,node_supabase,node_responses toneMint
class node_admin,node_adminapi,node_cms toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Storefront pages](https://github.com/nehagowda06/win-dia/blob/main/app/shop/page.tsx): `app/shop/page.tsx`
- [Product detail](https://github.com/nehagowda06/win-dia/blob/main/app/product/%5Bid%5D/page.tsx): `app/product/[id]/page.tsx`
- [Home experience](https://github.com/nehagowda06/win-dia/blob/main/app/Home/Home/Home.jsx): `app/Home/Home/Home.jsx`
- [Account pages](https://github.com/nehagowda06/win-dia/blob/main/app/login/page.js): `app/login/page.js`
- [Auth state](https://github.com/nehagowda06/win-dia/blob/main/src/frontend/hooks/useAuth.js): `src/frontend/hooks/useAuth.js`
- [Cart screen](https://github.com/nehagowda06/win-dia/blob/main/src/frontend/screens/Cart/CartPage.jsx): `src/frontend/screens/Cart/CartPage.jsx`
- [Checkout screen](https://github.com/nehagowda06/win-dia/blob/main/src/frontend/screens/Checkout/CheckoutPage.jsx): `src/frontend/screens/Checkout/CheckoutPage.jsx`
- [Order confirmation](https://github.com/nehagowda06/win-dia/blob/main/src/frontend/screens/OrderConfirmation/OrderConfirmationPage.jsx): `src/frontend/screens/OrderConfirmation/OrderConfirmationPage.jsx`

### Commerce

- [Cart API](https://github.com/nehagowda06/win-dia/blob/main/app/api/cart/route.ts): `app/api/cart/route.ts`
- [Orders API](https://github.com/nehagowda06/win-dia/blob/main/app/api/orders/route.ts): `app/api/orders/route.ts`
- [Cart service](https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/cart.service.ts): `src/backend/services/cart.service.ts`
- [Checkout service](https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/checkout.service.ts): `src/backend/services/checkout.service.ts`
- [Order service](https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/order.service.ts): `src/backend/services/order.service.ts`
- [Payment endpoints](https://github.com/nehagowda06/win-dia/blob/main/app/api/payment/verify/route.ts): `app/api/payment/verify/route.ts`
- [Shipment tracking](https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/shipment.service.ts): `src/backend/services/shipment.service.ts`
- [Catalog services](https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/product.service.ts): `src/backend/services/product.service.ts`
- [Customer features](https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/wishlist.service.ts): `src/backend/services/wishlist.service.ts`
- [Review service](https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/review.service.ts): `src/backend/services/review.service.ts`

### Backend platform

- [Dependency container](https://github.com/nehagowda06/win-dia/blob/main/src/backend/providers/container.provider.ts): `src/backend/providers/container.provider.ts`
- [Data repositories](https://github.com/nehagowda06/win-dia/tree/main/src/backend/repositories): `src/backend/repositories`
- [Supabase database](https://github.com/nehagowda06/win-dia/blob/main/src/backend/config/supabase.config.ts): `src/backend/config/supabase.config.ts`
- [API response handling](https://github.com/nehagowda06/win-dia/blob/main/src/backend/utils/route-helper.util.ts): `src/backend/utils/route-helper.util.ts`

### Store operations

- [Admin console](https://github.com/nehagowda06/win-dia/blob/main/app/admin/page.jsx): `app/admin/page.jsx`
- [Admin endpoints](https://github.com/nehagowda06/win-dia/blob/main/app/api/admin/products/route.ts): `app/api/admin/products/route.ts`
- [Content management](https://github.com/nehagowda06/win-dia/blob/main/src/backend/services/cms.service.ts): `src/backend/services/cms.service.ts`

### Other components

- **Shopper**

## Connections

- Shopper → Storefront pages: browses
- Shopper → Account pages: manages account
- Shopper → Cart screen: reviews cart
- Shopper → Checkout screen: starts checkout
- Storefront pages → Home experience: renders
- Account pages → Auth state: uses auth state
- Checkout screen → Orders API: submits order
- Cart screen → Cart API: requests cart
- Cart API → Cart service: invokes (evidence: `app/api/cart/route.ts`)
- Cart API → API response handling: formats result (evidence: `app/api/cart/route.ts`)
- Orders API → Checkout service: processes checkout (evidence: `app/api/orders/route.ts`)
- Orders API → Order service: fetches orders (evidence: `app/api/orders/route.ts`)
- Orders API → API response handling: formats result (evidence: `app/api/orders/route.ts`)
- Orders API → Order confirmation: returns order data
- Payment endpoints → Checkout service: verifies payment
- Shipment tracking → Order service: reads order state
- Catalog services → Storefront pages: serves products
- Customer features → Shopper: supports wishlist
- Review service → Data repositories: uses repository (evidence: `src/backend/services/review.service.ts`)
- Review service → Admin console: supports moderation
- Admin console → Admin endpoints: manages catalog
- Admin endpoints → Dependency container: resolves services
- Content management → Data repositories: uses content storage
- Dependency container → Data repositories: constructs repositories (evidence: `src/backend/providers/container.provider.ts`)
- Data repositories → Supabase database: persists data (evidence: `src/backend/repositories/review.repository.ts`)
