# m-saad-saif/aurade architecture

> Architecture diagram of the GitHub repository m-saad-saif/aurade, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/m-saad-saif/aurade
- Repository: https://github.com/m-saad-saif/aurade

## Overview

AURADE is a Next.js watch storefront with editorial and support content, an illustrative catalog, browser-local shopping state, demo checkout, and a separate admin path for database-backed watch listings. The main shopper flow runs from catalog browsing to product detail, cart, checkout, and a tab-local receipt; wishlist and content routes are parallel capabilities. Admin watch creation/deletion uses authenticated API routes, MongoDB, and Cloudinary media. Evidence is limited to the README and indexed source references plus supplied excerpts; unsampled route and state wiring is not expanded beyond documented capabilities.

Main entry points: [`lib/watches.js`](https://github.com/m-saad-saif/aurade/blob/main/lib/watches.js) (Store watch catalog), [`components/ProductCard.js`](https://github.com/m-saad-saif/aurade/blob/main/components/ProductCard.js) (Product cards), [`lib/catalog.js`](https://github.com/m-saad-saif/aurade/blob/main/lib/catalog.js) (Product and collection data), [`app/api/admin/watches/route.js`](https://github.com/m-saad-saif/aurade/blob/main/app/api/admin/watches/route.js) (Watch create and delete API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront discovery"]
  node_home["Home and featured catalog<br/>[page.js]"]
  node_shop["Search and filters<br/>[ShopCatalog.js]"]
  node_collections["Collection browsing<br/>[page.js]"]
  node_watch_detail["Watch details<br/>[ProductDetails.js]"]
  node_product_card["Product cards<br/>[ProductCard.js]"]
end

subgraph group_shopping["Shopping experience"]
  node_store_state["Cart and wishlist state<br/>[StoreProvider.js]"]
  node_cart["Cart editing and summary<br/>[CartView.js]"]
  node_checkout["Demo checkout<br/>[CheckoutForm.js]"]
  node_receipt["Tab-local receipt<br/>[OrderReceipt.js]"]
  node_wishlist["Wishlist view<br/>[WishlistView.js]"]
  node_cart_rules["Cart validation and reducer<br/>[cart.js]"]
end

subgraph group_content["Editorial content"]
  node_editorial["About and journal<br/>[page.js]"]
  node_support["Support information<br/>[page.js]"]
  node_inquiry["Contact and trade inquiry<br/>[InquiryForm.js]"]
end

subgraph group_admin["Catalog administration"]
  node_admin_ui["Watch management UI"]
  node_admin_login["Admin login route<br/>[route.js]"]
  node_watch_api["Watch create and delete API<br/>[route.js]"]
  node_delete_api["Watch deletion route<br/>[route.js]"]
end

subgraph group_services["Data and media"]
  node_catalog["Product and collection data<br/>[catalog.js]"]
  node_watch_loader["Store watch catalog<br/>[watches.js]"]
  node_admin_auth["Admin session checks<br/>[adminAuth.js]"]
  node_watch_model[("Watch records<br/>[Watch.js]")]
  node_mongodb[("MongoDB connection<br/>[mongodb.js]")]
  node_cloudinary["Media uploads and deletion<br/>[cloudinary.js]"]
end

node_shopper(("Shopper"))
node_media_service["Cloudinary"]

node_shopper -->|"opens storefront"| node_home
node_home -->|"loads watches"| node_watch_loader
node_home -->|"reads collections"| node_catalog
node_home -->|"renders products"| node_product_card
node_shopper -->|"browses catalog"| node_shop
node_shop -->|"renders results"| node_product_card
node_shop -->|"reads catalog"| node_catalog
node_shop -->|"loads watches"| node_watch_loader
node_shopper -->|"opens collection"| node_collections
node_collections -->|"reads collection data"| node_catalog
node_collections -->|"loads watches"| node_watch_loader
node_collections -->|"renders products"| node_product_card
node_shopper -->|"opens watch"| node_watch_detail
node_watch_detail -->|"reads product data"| node_catalog
node_watch_detail -->|"loads watches"| node_watch_loader
node_watch_detail -->|"renders related items"| node_product_card
node_product_card -->|"updates wishlist"| node_store_state
node_product_card -->|"links to detail"| node_watch_detail
node_shopper -->|"edits bag"| node_cart
node_cart -.->|"reads shopping state"| node_store_state
node_cart -.->|"uses cart rules"| node_cart_rules
node_shopper -->|"starts checkout"| node_checkout
node_checkout -.->|"reads shopping state"| node_store_state
node_checkout -->|"creates demo receipt"| node_receipt
node_receipt -->|"formats totals"| node_catalog
node_shopper -->|"views wishlist"| node_wishlist
node_wishlist -.->|"reads wishlist"| node_store_state
node_shopper -->|"reads brand stories"| node_editorial
node_shopper -->|"opens support pages"| node_support
node_shopper -->|"submits inquiry"| node_inquiry
node_shopper -.->|"manages catalog"| node_admin_ui
node_admin_ui -->|"posts watch data"| node_watch_api
node_admin_ui -.->|"requests deletion"| node_delete_api
node_admin_login -->|"checks session"| node_admin_auth
node_watch_api -->|"checks admin"| node_admin_auth
node_watch_api -->|"connects database"| node_mongodb
node_watch_api -->|"creates watch"| node_watch_model
node_watch_api -->|"uploads media"| node_cloudinary
node_delete_api -->|"checks admin"| node_admin_auth
node_delete_api -->|"connects database"| node_mongodb
node_delete_api -->|"deletes watch"| node_watch_model
node_delete_api -->|"deletes media"| node_cloudinary
node_cloudinary -.->|"uses media host"| node_media_service
node_watch_loader -->|"connects database"| node_mongodb
node_watch_loader -->|"queries watches"| node_watch_model
node_watch_loader -->|"adds demo products"| node_catalog

click node_home "https://github.com/m-saad-saif/aurade/blob/main/app/page.js"
click node_shop "https://github.com/m-saad-saif/aurade/blob/main/components/ShopCatalog.js"
click node_collections "https://github.com/m-saad-saif/aurade/blob/main/app/collections/%5Bslug%5D/page.js"
click node_catalog "https://github.com/m-saad-saif/aurade/blob/main/lib/catalog.js"
click node_watch_loader "https://github.com/m-saad-saif/aurade/blob/main/lib/watches.js"
click node_watch_detail "https://github.com/m-saad-saif/aurade/blob/main/components/ProductDetails.js"
click node_product_card "https://github.com/m-saad-saif/aurade/blob/main/components/ProductCard.js"
click node_store_state "https://github.com/m-saad-saif/aurade/blob/main/components/StoreProvider.js"
click node_cart "https://github.com/m-saad-saif/aurade/blob/main/components/CartView.js"
click node_checkout "https://github.com/m-saad-saif/aurade/blob/main/components/CheckoutForm.js"
click node_receipt "https://github.com/m-saad-saif/aurade/blob/main/components/OrderReceipt.js"
click node_wishlist "https://github.com/m-saad-saif/aurade/blob/main/components/WishlistView.js"
click node_cart_rules "https://github.com/m-saad-saif/aurade/blob/main/lib/cart.js"
click node_editorial "https://github.com/m-saad-saif/aurade/blob/main/app/about/page.js"
click node_support "https://github.com/m-saad-saif/aurade/blob/main/app/support/%5Bslug%5D/page.js"
click node_inquiry "https://github.com/m-saad-saif/aurade/blob/main/components/InquiryForm.js"
click node_admin_ui "https://github.com/m-saad-saif/aurade/blob/main/components/AdminWatchManager.js"
click node_admin_login "https://github.com/m-saad-saif/aurade/blob/main/app/api/admin/login/route.js"
click node_admin_auth "https://github.com/m-saad-saif/aurade/blob/main/lib/adminAuth.js"
click node_watch_api "https://github.com/m-saad-saif/aurade/blob/main/app/api/admin/watches/route.js"
click node_delete_api "https://github.com/m-saad-saif/aurade/blob/main/app/api/admin/watches/%5Bid%5D/route.js"
click node_watch_model "https://github.com/m-saad-saif/aurade/blob/main/models/Watch.js"
click node_mongodb "https://github.com/m-saad-saif/aurade/blob/main/lib/mongodb.js"
click node_cloudinary "https://github.com/m-saad-saif/aurade/blob/main/lib/cloudinary.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_home,node_shop,node_collections,node_watch_detail,node_product_card toneBlue
class node_store_state,node_cart,node_checkout,node_receipt,node_wishlist,node_cart_rules toneAmber
class node_editorial,node_support,node_inquiry toneMint
class node_admin_ui,node_admin_login,node_watch_api,node_delete_api toneRose
class node_catalog,node_watch_loader,node_admin_auth,node_watch_model,node_mongodb,node_cloudinary,node_shopper,node_media_service toneIndigo
```

## Components

### Storefront discovery

- [Home and featured catalog](https://github.com/m-saad-saif/aurade/blob/main/app/page.js): `app/page.js`
- [Search and filters](https://github.com/m-saad-saif/aurade/blob/main/components/ShopCatalog.js): `components/ShopCatalog.js`
- [Collection browsing](https://github.com/m-saad-saif/aurade/blob/main/app/collections/%5Bslug%5D/page.js): `app/collections/[slug]/page.js`
- [Watch details](https://github.com/m-saad-saif/aurade/blob/main/components/ProductDetails.js): `components/ProductDetails.js`
- [Product cards](https://github.com/m-saad-saif/aurade/blob/main/components/ProductCard.js): `components/ProductCard.js`

### Shopping experience

- [Cart and wishlist state](https://github.com/m-saad-saif/aurade/blob/main/components/StoreProvider.js): `components/StoreProvider.js`
- [Cart editing and summary](https://github.com/m-saad-saif/aurade/blob/main/components/CartView.js): `components/CartView.js`
- [Demo checkout](https://github.com/m-saad-saif/aurade/blob/main/components/CheckoutForm.js): `components/CheckoutForm.js`
- [Tab-local receipt](https://github.com/m-saad-saif/aurade/blob/main/components/OrderReceipt.js): `components/OrderReceipt.js`
- [Wishlist view](https://github.com/m-saad-saif/aurade/blob/main/components/WishlistView.js): `components/WishlistView.js`
- [Cart validation and reducer](https://github.com/m-saad-saif/aurade/blob/main/lib/cart.js): `lib/cart.js`

### Editorial content

- [About and journal](https://github.com/m-saad-saif/aurade/blob/main/app/about/page.js): `app/about/page.js`
- [Support information](https://github.com/m-saad-saif/aurade/blob/main/app/support/%5Bslug%5D/page.js): `app/support/[slug]/page.js`
- [Contact and trade inquiry](https://github.com/m-saad-saif/aurade/blob/main/components/InquiryForm.js): `components/InquiryForm.js`

### Catalog administration

- [Watch management UI](https://github.com/m-saad-saif/aurade/blob/main/components/AdminWatchManager.js): `components/AdminWatchManager.js`
- [Admin login route](https://github.com/m-saad-saif/aurade/blob/main/app/api/admin/login/route.js): `app/api/admin/login/route.js`
- [Watch create and delete API](https://github.com/m-saad-saif/aurade/blob/main/app/api/admin/watches/route.js): `app/api/admin/watches/route.js`
- [Watch deletion route](https://github.com/m-saad-saif/aurade/blob/main/app/api/admin/watches/%5Bid%5D/route.js): `app/api/admin/watches/[id]/route.js`

### Data and media

- [Product and collection data](https://github.com/m-saad-saif/aurade/blob/main/lib/catalog.js): `lib/catalog.js`
- [Store watch catalog](https://github.com/m-saad-saif/aurade/blob/main/lib/watches.js): `lib/watches.js`
- [Admin session checks](https://github.com/m-saad-saif/aurade/blob/main/lib/adminAuth.js): `lib/adminAuth.js`
- [Watch records](https://github.com/m-saad-saif/aurade/blob/main/models/Watch.js): `models/Watch.js`
- [MongoDB connection](https://github.com/m-saad-saif/aurade/blob/main/lib/mongodb.js): `lib/mongodb.js`
- [Media uploads and deletion](https://github.com/m-saad-saif/aurade/blob/main/lib/cloudinary.js): `lib/cloudinary.js`

### Other components

- **Shopper**
- **Cloudinary**

## Connections

- Shopper → Home and featured catalog: opens storefront (evidence: `README.md`)
- Home and featured catalog → Store watch catalog: loads watches (evidence: `app/page.js`)
- Home and featured catalog → Product and collection data: reads collections (evidence: `app/page.js`)
- Home and featured catalog → Product cards: renders products (evidence: `app/page.js`)
- Shopper → Search and filters: browses catalog (evidence: `README.md`)
- Search and filters → Product cards: renders results (evidence: `components/ShopCatalog.js`)
- Search and filters → Product and collection data: reads catalog (evidence: `app/shop/page.js`)
- Search and filters → Store watch catalog: loads watches (evidence: `app/shop/page.js`)
- Shopper → Collection browsing: opens collection (evidence: `README.md`)
- Collection browsing → Product and collection data: reads collection data (evidence: `app/collections/[slug]/page.js`)
- Collection browsing → Store watch catalog: loads watches (evidence: `app/collections/[slug]/page.js`)
- Collection browsing → Product cards: renders products (evidence: `app/collections/[slug]/page.js`)
- Shopper → Watch details: opens watch (evidence: `README.md`)
- Watch details → Product and collection data: reads product data (evidence: `app/watches/[id]/page.js`)
- Watch details → Store watch catalog: loads watches (evidence: `app/watches/[id]/page.js`)
- Watch details → Product cards: renders related items (evidence: `app/watches/[id]/page.js`)
- Product cards → Cart and wishlist state: updates wishlist (evidence: `components/ProductCard.js`)
- Product cards → Watch details: links to detail (evidence: `components/ProductCard.js`)
- Shopper → Cart editing and summary: edits bag (evidence: `README.md`)
- Cart editing and summary → Cart and wishlist state: reads shopping state
- Cart editing and summary → Cart validation and reducer: uses cart rules
- Shopper → Demo checkout: starts checkout (evidence: `README.md`)
- Demo checkout → Cart and wishlist state: reads shopping state
- Demo checkout → Tab-local receipt: creates demo receipt (evidence: `README.md`)
- Tab-local receipt → Product and collection data: formats totals (evidence: `components/OrderReceipt.js`)
- Shopper → Wishlist view: views wishlist (evidence: `README.md`)
- Wishlist view → Cart and wishlist state: reads wishlist
- Shopper → About and journal: reads brand stories (evidence: `README.md`)
- Shopper → Support information: opens support pages (evidence: `README.md`)
- Shopper → Contact and trade inquiry: submits inquiry (evidence: `README.md`)
- Shopper → Watch management UI: manages catalog
- Watch management UI → Watch create and delete API: posts watch data (evidence: `components/AdminWatchManager.js`)
- Watch management UI → Watch deletion route: requests deletion
- Admin login route → Admin session checks: checks session (evidence: `app/api/admin/login/route.js`)
- Watch create and delete API → Admin session checks: checks admin (evidence: `app/api/admin/watches/route.js`)
- Watch create and delete API → MongoDB connection: connects database (evidence: `app/api/admin/watches/route.js`)
- Watch create and delete API → Watch records: creates watch (evidence: `app/api/admin/watches/route.js`)
- Watch create and delete API → Media uploads and deletion: uploads media (evidence: `app/api/admin/watches/route.js`)
- Watch deletion route → Admin session checks: checks admin (evidence: `app/api/admin/watches/[id]/route.js`)
- Watch deletion route → MongoDB connection: connects database (evidence: `app/api/admin/watches/[id]/route.js`)
- Watch deletion route → Watch records: deletes watch (evidence: `app/api/admin/watches/[id]/route.js`)
- Watch deletion route → Media uploads and deletion: deletes media (evidence: `app/api/admin/watches/[id]/route.js`)
- Media uploads and deletion → Cloudinary: uses media host
- Store watch catalog → MongoDB connection: connects database (evidence: `lib/watches.js`)
- Store watch catalog → Watch records: queries watches (evidence: `lib/watches.js`)
- Store watch catalog → Product and collection data: adds demo products (evidence: `lib/watches.js`)
