# valrazi/jeda-coffee-client architecture

> Architecture diagram of the GitHub repository valrazi/jeda-coffee-client, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/valrazi/jeda-coffee-client
- Repository: https://github.com/valrazi/jeda-coffee-client

## Overview

This is a Next.js ticketing/commerce application: customers browse products, manage favorites and a cart, place orders, and then review or complete order-related actions. The tree also shows sign-up, sign-in, profile management, and receipt functionality. Sampled API handlers directly support product, favorite, order, customer, and subcategory operations; UI-to-API wiring and several route implementations were not sampled, so those links are omitted.

Main entry points: [`app/api/order/route.js`](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/order/route.js) (Order history API), [`app/api/product/route.js`](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/product/route.js) (Product listing), [`app/api/product/[id]/route.js`](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/product/%5Bid%5D/route.js) (Product detail API), [`models/product.js`](https://github.com/valrazi/jeda-coffee-client/blob/main/models/product.js) (Products)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer UI"]
  node_catalog_ui["Catalog pages<br/>[page.js]"]
  node_product_ui["Product detail<br/>[page.jsx]"]
  node_cart_ui["Cart and checkout<br/>[page.js]"]
  node_orders_ui["Order history<br/>[page.js]"]
  node_profile_ui["Profile<br/>[page.js]"]
  node_auth_ui["Sign-in and sign-up<br/>[page.js]"]
  node_receipt_ui["Receipt action<br/>[button.receipt.jsx]"]
end

subgraph group_api["API routes"]
  node_product_list["Product listing<br/>[route.js]"]
  node_product_detail["Product detail API<br/>[route.js]"]
  node_subcategory_api["Subcategories<br/>[route.js]"]
  node_favorite_api["Favorites<br/>[route.js]"]
  node_cart_routes["Cart operations<br/>[route.js]"]
  node_cart_customer["Customer cart<br/>[route.js]"]
  node_cart_logic["Cart lookup<br/>[function.js]"]
  node_order_list["Order history API<br/>[route.js]"]
  node_order_actions["Order actions<br/>[route.js]"]
  node_order_cancel["Order cancellation<br/>[route.js]"]
  node_order_review["Order reviews<br/>[route.js]"]
  node_order_receipt["Receipt API<br/>[route.js]"]
  node_profile_api["Profile operations<br/>[route.js]"]
end

subgraph group_data["Domain data"]
  node_products[("Products<br/>[product.js]")]
  node_subcategories[("Subcategories<br/>[subcategory.js]")]
  node_favorites[("Favorites<br/>[favorites.js]")]
  node_orders[("Orders<br/>[order.js]")]
  node_order_items[("Order items<br/>[order_item.js]")]
  node_reviews[("Reviews<br/>[reviews.js]")]
  node_customers[("Customers<br/>[customer.js]")]
end

subgraph group_identity["Identity"]
  node_signup_api["Registration<br/>[route.js]"]
  node_auth_api["Authentication<br/>[route.js]"]
  node_auth_config["Auth configuration<br/>[auth.js]"]
end

node_customer(("Customer"))

node_customer -->|"browses"| node_catalog_ui
node_customer -->|"views"| node_product_ui
node_customer -->|"manages cart"| node_cart_ui
node_customer -->|"manages orders"| node_orders_ui
node_customer -->|"manages profile"| node_profile_ui
node_customer -->|"signs in"| node_auth_ui
node_customer -->|"requests receipt"| node_receipt_ui
node_customer -->|"requests products"| node_product_list
node_customer -->|"requests product"| node_product_detail
node_customer -->|"requests categories"| node_subcategory_api
node_customer -->|"updates favorites"| node_favorite_api
node_customer -->|"updates cart"| node_cart_routes
node_customer -->|"loads cart"| node_cart_customer
node_customer -->|"loads orders"| node_order_list
node_customer -->|"completes order"| node_order_actions
node_customer -->|"cancels order"| node_order_cancel
node_customer -->|"submits review"| node_order_review
node_customer -->|"requests receipt"| node_order_receipt
node_customer -->|"loads profile"| node_profile_api
node_customer -->|"registers"| node_signup_api
node_customer -->|"authenticates"| node_auth_api
node_product_list -->|"queries"| node_products
node_product_list -->|"includes"| node_subcategories
node_product_list -->|"counts"| node_favorites
node_product_detail -->|"queries"| node_products
node_product_detail -->|"includes"| node_favorites
node_subcategory_api -->|"queries"| node_subcategories
node_favorite_api -->|"reads or writes"| node_favorites
node_cart_customer -->|"calls"| node_cart_logic
node_order_list -->|"queries"| node_orders
node_order_list -->|"includes"| node_order_items
node_order_list -->|"includes"| node_products
node_order_list -->|"includes"| node_reviews
node_order_actions -->|"reads and updates"| node_orders
node_order_cancel -->|"reads and updates"| node_orders
node_profile_api -->|"queries"| node_customers
node_signup_api -->|"creates"| node_customers
node_auth_api -->|"uses"| node_auth_config

click node_catalog_ui "https://github.com/valrazi/jeda-coffee-client/blob/main/app/main/home/page.js"
click node_product_ui "https://github.com/valrazi/jeda-coffee-client/blob/main/app/main/product/%5Bid%5D/page.jsx"
click node_cart_ui "https://github.com/valrazi/jeda-coffee-client/blob/main/app/main/cart/page.js"
click node_orders_ui "https://github.com/valrazi/jeda-coffee-client/blob/main/app/main/order/page.js"
click node_profile_ui "https://github.com/valrazi/jeda-coffee-client/blob/main/app/main/profile/page.js"
click node_auth_ui "https://github.com/valrazi/jeda-coffee-client/blob/main/app/auth/sign-in/page.js"
click node_receipt_ui "https://github.com/valrazi/jeda-coffee-client/blob/main/app/components/Order/button.receipt.jsx"
click node_product_list "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/product/route.js"
click node_product_detail "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/product/%5Bid%5D/route.js"
click node_subcategory_api "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/subcategory/route.js"
click node_favorite_api "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/favorite/route.js"
click node_cart_routes "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/cart/add/%5Bid%5D/route.js"
click node_cart_customer "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/cart/customer/route.js"
click node_cart_logic "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/cart/function.js"
click node_order_list "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/order/route.js"
click node_order_actions "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/order/complete/%5Bid%5D/route.js"
click node_order_cancel "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/order/cancel/%5Bid%5D/route.js"
click node_order_review "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/order/review/%5Bid%5D/route.js"
click node_order_receipt "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/order/receipt/%5Bid%5D/route.js"
click node_profile_api "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/user/detail/route.js"
click node_signup_api "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/auth/sign-up/route.js"
click node_auth_api "https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/auth/%5B...nextauth%5D/route.js"
click node_auth_config "https://github.com/valrazi/jeda-coffee-client/blob/main/app/lib/auth.js"
click node_products "https://github.com/valrazi/jeda-coffee-client/blob/main/models/product.js"
click node_subcategories "https://github.com/valrazi/jeda-coffee-client/blob/main/models/subcategory.js"
click node_favorites "https://github.com/valrazi/jeda-coffee-client/blob/main/models/favorites.js"
click node_orders "https://github.com/valrazi/jeda-coffee-client/blob/main/models/order.js"
click node_order_items "https://github.com/valrazi/jeda-coffee-client/blob/main/models/order_item.js"
click node_reviews "https://github.com/valrazi/jeda-coffee-client/blob/main/models/reviews.js"
click node_customers "https://github.com/valrazi/jeda-coffee-client/blob/main/models/customer.js"

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_ui,node_product_ui,node_cart_ui,node_orders_ui,node_profile_ui,node_auth_ui,node_receipt_ui toneBlue
class node_product_list,node_product_detail,node_subcategory_api,node_favorite_api,node_cart_routes,node_cart_customer,node_cart_logic,node_order_list,node_order_actions,node_order_cancel,node_order_review,node_order_receipt,node_profile_api toneAmber
class node_products,node_subcategories,node_favorites,node_orders,node_order_items,node_reviews,node_customers toneMint
class node_signup_api,node_auth_api,node_auth_config toneRose
class node_customer toneIndigo
```

## Components

### Customer UI

- [Catalog pages](https://github.com/valrazi/jeda-coffee-client/blob/main/app/main/home/page.js): `app/main/home/page.js`
- [Product detail](https://github.com/valrazi/jeda-coffee-client/blob/main/app/main/product/%5Bid%5D/page.jsx): `app/main/product/[id]/page.jsx`
- [Cart and checkout](https://github.com/valrazi/jeda-coffee-client/blob/main/app/main/cart/page.js): `app/main/cart/page.js`
- [Order history](https://github.com/valrazi/jeda-coffee-client/blob/main/app/main/order/page.js): `app/main/order/page.js`
- [Profile](https://github.com/valrazi/jeda-coffee-client/blob/main/app/main/profile/page.js): `app/main/profile/page.js`
- [Sign-in and sign-up](https://github.com/valrazi/jeda-coffee-client/blob/main/app/auth/sign-in/page.js): `app/auth/sign-in/page.js`
- [Receipt action](https://github.com/valrazi/jeda-coffee-client/blob/main/app/components/Order/button.receipt.jsx): `app/components/Order/button.receipt.jsx`

### API routes

- [Product listing](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/product/route.js): `app/api/product/route.js`
- [Product detail API](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/product/%5Bid%5D/route.js): `app/api/product/[id]/route.js`
- [Subcategories](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/subcategory/route.js): `app/api/subcategory/route.js`
- [Favorites](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/favorite/route.js): `app/api/favorite/route.js`
- [Cart operations](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/cart/add/%5Bid%5D/route.js): `app/api/cart/add/[id]/route.js`
- [Customer cart](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/cart/customer/route.js): `app/api/cart/customer/route.js`
- [Cart lookup](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/cart/function.js): `app/api/cart/function.js`
- [Order history API](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/order/route.js): `app/api/order/route.js`
- [Order actions](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/order/complete/%5Bid%5D/route.js): `app/api/order/complete/[id]/route.js`
- [Order cancellation](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/order/cancel/%5Bid%5D/route.js): `app/api/order/cancel/[id]/route.js`
- [Order reviews](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/order/review/%5Bid%5D/route.js): `app/api/order/review/[id]/route.js`
- [Receipt API](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/order/receipt/%5Bid%5D/route.js): `app/api/order/receipt/[id]/route.js`
- [Profile operations](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/user/detail/route.js): `app/api/user/detail/route.js`

### Domain data

- [Products](https://github.com/valrazi/jeda-coffee-client/blob/main/models/product.js): `models/product.js`
- [Subcategories](https://github.com/valrazi/jeda-coffee-client/blob/main/models/subcategory.js): `models/subcategory.js`
- [Favorites](https://github.com/valrazi/jeda-coffee-client/blob/main/models/favorites.js): `models/favorites.js`
- [Orders](https://github.com/valrazi/jeda-coffee-client/blob/main/models/order.js): `models/order.js`
- [Order items](https://github.com/valrazi/jeda-coffee-client/blob/main/models/order_item.js): `models/order_item.js`
- [Reviews](https://github.com/valrazi/jeda-coffee-client/blob/main/models/reviews.js): `models/reviews.js`
- [Customers](https://github.com/valrazi/jeda-coffee-client/blob/main/models/customer.js): `models/customer.js`

### Identity

- [Registration](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/auth/sign-up/route.js): `app/api/auth/sign-up/route.js`
- [Authentication](https://github.com/valrazi/jeda-coffee-client/blob/main/app/api/auth/%5B...nextauth%5D/route.js): `app/api/auth/[...nextauth]/route.js`
- [Auth configuration](https://github.com/valrazi/jeda-coffee-client/blob/main/app/lib/auth.js): `app/lib/auth.js`

### Other components

- **Customer**

## Connections

- Customer → Catalog pages: browses
- Customer → Product detail: views
- Customer → Cart and checkout: manages cart
- Customer → Order history: manages orders
- Customer → Profile: manages profile
- Customer → Sign-in and sign-up: signs in
- Customer → Receipt action: requests receipt
- Customer → Product listing: requests products
- Customer → Product detail API: requests product
- Customer → Subcategories: requests categories
- Customer → Favorites: updates favorites
- Customer → Cart operations: updates cart
- Customer → Customer cart: loads cart
- Customer → Order history API: loads orders
- Customer → Order actions: completes order
- Customer → Order cancellation: cancels order
- Customer → Order reviews: submits review
- Customer → Receipt API: requests receipt
- Customer → Profile operations: loads profile
- Customer → Registration: registers
- Customer → Authentication: authenticates
- Product listing → Products: queries
- Product listing → Subcategories: includes
- Product listing → Favorites: counts
- Product detail API → Products: queries
- Product detail API → Favorites: includes
- Subcategories → Subcategories: queries
- Favorites → Favorites: reads or writes
- Customer cart → Cart lookup: calls
- Order history API → Orders: queries
- Order history API → Order items: includes
- Order history API → Products: includes
- Order history API → Reviews: includes
- Order actions → Orders: reads and updates
- Order cancellation → Orders: reads and updates
- Profile operations → Customers: queries
- Registration → Customers: creates
- Authentication → Auth configuration: uses
