# muhammadsaadahmad1/project-1 architecture

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

- Interactive diagram: https://gitdiagram.com/muhammadsaadahmad1/project-1
- Repository: https://github.com/muhammadsaadahmad1/project-1

## Overview

AURA PARFUMS is a fragrance storefront with customer browsing, cart and checkout, plus authenticated administration for catalog, inventory, orders, and reviews. The primary flow is storefront browsing → cart → checkout → order confirmation; shared store state coordinates catalog and order data, using Supabase when configured and local seed data otherwise. The tree and source index also show review, WhatsApp messaging, and admin-request capabilities. Some subsystem details are unsampled, so the graph omits unverified connections.

Main entry points: [`src/context/StoreContext.jsx`](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/context/StoreContext.jsx) (Store State), [`src/components/admin/AdminLayout.jsx`](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/AdminLayout.jsx) (Admin Console), [`src/App.jsx`](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/App.jsx) (Application Routes), [`src/lib/supabase.ts`](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/lib/supabase.ts) (Supabase Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["Application Routes<br/>[App.jsx]"]
  node_catalog["Catalog Browsing<br/>[App.jsx]"]
  node_product_detail["Product Details"]
  node_product_card["Product Cards<br/>[ProductCard.jsx]"]
  node_hero["Hero Banner<br/>[HeroBanner.jsx]"]
  node_reviews["Customer Reviews<br/>[ReviewsSection.jsx]"]
end

subgraph group_commerce["Commerce"]
  node_cart["Shopping Cart<br/>[CartContext.jsx]"]
  node_cart_drawer["Cart Drawer<br/>[CartDrawer.jsx]"]
  node_checkout["Checkout<br/>[CheckoutModal.jsx]"]
  node_order_success["Order Confirmation"]
  node_whatsapp_service["WhatsApp Messaging<br/>[whatsappService.js]"]
end

subgraph group_administration["Administration"]
  node_auth["Admin Authentication<br/>[AuthContext.jsx]"]
  node_auth_api["Authentication API<br/>[authApi.ts]"]
  node_admin_layout["Admin Console<br/>[AdminLayout.jsx]"]
  node_product_admin["Product Management<br/>[ProductManager.jsx]"]
  node_inventory_admin["Inventory Management"]
  node_order_admin["Order Management<br/>[OrderManager.jsx]"]
  node_review_admin["Review Moderation"]
  node_requests_admin["Admin Requests<br/>[AdminRequests.jsx]"]
  node_requests_api["Admin Requests API"]
end

subgraph group_platform["Shared Platform"]
  node_store_state["Store State<br/>[StoreContext.jsx]"]
  node_seed_data["Seed Catalog Data<br/>[initialProducts.js]"]
  node_inventory_logic["Inventory Logic"]
  node_review_logic["Review Metrics<br/>[reviewService.js]"]
  node_supabase_client["Supabase Client<br/>[supabase.ts]"]
  node_store_api["Store Data API<br/>[storeApi.ts]"]
end

node_shopper(("Shopper"))
node_admin(("Administrator"))
node_supabase[("Supabase")]
node_whatsapp(("WhatsApp"))

node_shopper -->|"opens"| node_app
node_admin -->|"opens"| node_app
node_app -->|"provides state"| node_store_state
node_app -->|"renders"| node_catalog
node_app -->|"renders"| node_cart_drawer
node_app -->|"renders"| node_checkout
node_catalog -->|"renders"| node_hero
node_catalog -->|"renders"| node_product_card
node_product_card -->|"adds items"| node_cart
node_product_detail -->|"adds items"| node_cart
node_product_detail -->|"renders"| node_reviews
node_reviews -->|"uses metrics"| node_review_logic
node_cart_drawer -->|"reads and updates"| node_cart
node_checkout -->|"reads cart"| node_cart
node_checkout -->|"places order"| node_store_state
node_order_success -->|"formats message"| node_whatsapp_service
node_order_admin -->|"formats message"| node_whatsapp_service
node_whatsapp_service -->|"creates links"| node_whatsapp
node_store_state -->|"loads fallback"| node_seed_data
node_store_state -->|"updates stock"| node_inventory_logic
node_store_state -->|"calculates ratings"| node_review_logic
node_store_state -->|"fetches and saves"| node_store_api
node_store_api -->|"uses client"| node_supabase_client
node_supabase_client -->|"connects"| node_supabase
node_product_admin -->|"manages products"| node_store_state
node_inventory_admin -->|"updates stock"| node_store_state
node_inventory_admin -->|"checks stock"| node_inventory_logic
node_order_admin -->|"manages orders"| node_store_state
node_review_admin -->|"moderates reviews"| node_store_state
node_admin_layout -->|"renders"| node_product_admin
node_admin_layout -->|"renders"| node_inventory_admin
node_admin_layout -->|"renders"| node_order_admin
node_admin_layout -->|"renders"| node_review_admin
node_admin_layout -->|"renders"| node_requests_admin
node_requests_admin -->|"calls"| node_requests_api
node_requests_api -->|"uses client"| node_supabase_client
node_admin_layout -->|"checks access"| node_auth
node_auth -->|"authenticates"| node_auth_api
node_auth_api -->|"uses client"| node_supabase_client
node_auth -->|"observes session"| node_supabase_client

click node_app "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/App.jsx"
click node_catalog "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/App.jsx"
click node_product_detail "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/ProductDetailModal.jsx"
click node_product_card "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/ProductCard.jsx"
click node_hero "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/HeroBanner.jsx"
click node_reviews "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/ReviewsSection.jsx"
click node_cart "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/context/CartContext.jsx"
click node_cart_drawer "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/CartDrawer.jsx"
click node_checkout "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/CheckoutModal.jsx"
click node_order_success "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/OrderSuccessModal.jsx"
click node_store_state "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/context/StoreContext.jsx"
click node_seed_data "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/data/initialProducts.js"
click node_inventory_logic "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/services/inventoryService.js"
click node_review_logic "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/services/reviewService.js"
click node_supabase_client "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/lib/supabase.ts"
click node_store_api "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/services/storeApi.ts"
click node_auth "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/context/AuthContext.jsx"
click node_auth_api "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/services/authApi.ts"
click node_admin_layout "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/AdminLayout.jsx"
click node_product_admin "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/ProductManager.jsx"
click node_inventory_admin "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/InventoryManager.jsx"
click node_order_admin "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/OrderManager.jsx"
click node_review_admin "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/ReviewModerator.jsx"
click node_requests_admin "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/AdminRequests.jsx"
click node_requests_api "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/services/adminRequestsApi.ts"
click node_whatsapp_service "https://github.com/muhammadsaadahmad1/project-1/blob/main/src/services/whatsappService.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_app,node_catalog,node_product_detail,node_product_card,node_hero,node_reviews toneBlue
class node_cart,node_cart_drawer,node_checkout,node_order_success,node_whatsapp_service,node_supabase toneAmber
class node_auth,node_auth_api,node_admin_layout,node_product_admin,node_inventory_admin,node_order_admin,node_review_admin,node_requests_admin,node_requests_api toneMint
class node_store_state,node_seed_data,node_inventory_logic,node_review_logic,node_supabase_client,node_store_api toneRose
class node_shopper,node_admin,node_whatsapp toneIndigo
```

## Components

### Storefront

- [Application Routes](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/App.jsx): `src/App.jsx`
- [Catalog Browsing](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/App.jsx): `src/App.jsx`
- [Product Details](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/ProductDetailModal.jsx): `src/components/ProductDetailModal.jsx`
- [Product Cards](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/ProductCard.jsx): `src/components/ProductCard.jsx`
- [Hero Banner](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/HeroBanner.jsx): `src/components/HeroBanner.jsx`
- [Customer Reviews](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/ReviewsSection.jsx): `src/components/ReviewsSection.jsx`

### Commerce

- [Shopping Cart](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/context/CartContext.jsx): `src/context/CartContext.jsx`
- [Cart Drawer](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/CartDrawer.jsx): `src/components/CartDrawer.jsx`
- [Checkout](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/CheckoutModal.jsx): `src/components/CheckoutModal.jsx`
- [Order Confirmation](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/OrderSuccessModal.jsx): `src/components/OrderSuccessModal.jsx`
- [WhatsApp Messaging](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/services/whatsappService.js): `src/services/whatsappService.js`

### Administration

- [Admin Authentication](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Authentication API](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/services/authApi.ts): `src/services/authApi.ts`
- [Admin Console](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/AdminLayout.jsx): `src/components/admin/AdminLayout.jsx`
- [Product Management](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/ProductManager.jsx): `src/components/admin/ProductManager.jsx`
- [Inventory Management](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/InventoryManager.jsx): `src/components/admin/InventoryManager.jsx`
- [Order Management](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/OrderManager.jsx): `src/components/admin/OrderManager.jsx`
- [Review Moderation](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/ReviewModerator.jsx): `src/components/admin/ReviewModerator.jsx`
- [Admin Requests](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/components/admin/AdminRequests.jsx): `src/components/admin/AdminRequests.jsx`
- [Admin Requests API](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/services/adminRequestsApi.ts): `src/services/adminRequestsApi.ts`

### Shared Platform

- [Store State](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/context/StoreContext.jsx): `src/context/StoreContext.jsx`
- [Seed Catalog Data](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/data/initialProducts.js): `src/data/initialProducts.js`
- [Inventory Logic](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/services/inventoryService.js): `src/services/inventoryService.js`
- [Review Metrics](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/services/reviewService.js): `src/services/reviewService.js`
- [Supabase Client](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Store Data API](https://github.com/muhammadsaadahmad1/project-1/blob/main/src/services/storeApi.ts): `src/services/storeApi.ts`

### Other components

- **Shopper**
- **Administrator**
- **Supabase**
- **WhatsApp**

## Connections

- Shopper → Application Routes: opens (evidence: `src/App.jsx`)
- Administrator → Application Routes: opens (evidence: `src/App.jsx`)
- Application Routes → Store State: provides state (evidence: `src/App.jsx`)
- Application Routes → Catalog Browsing: renders (evidence: `src/App.jsx`)
- Application Routes → Cart Drawer: renders (evidence: `src/App.jsx`)
- Application Routes → Checkout: renders (evidence: `src/App.jsx`)
- Catalog Browsing → Hero Banner: renders (evidence: `src/App.jsx`)
- Catalog Browsing → Product Cards: renders (evidence: `src/App.jsx`)
- Product Cards → Shopping Cart: adds items (evidence: `src/components/ProductCard.jsx`)
- Product Details → Shopping Cart: adds items (evidence: `src/components/ProductDetailModal.jsx`)
- Product Details → Customer Reviews: renders (evidence: `src/components/ProductDetailModal.jsx`)
- Customer Reviews → Review Metrics: uses metrics (evidence: `src/components/ReviewsSection.jsx`)
- Cart Drawer → Shopping Cart: reads and updates (evidence: `src/components/CartDrawer.jsx`)
- Checkout → Shopping Cart: reads cart (evidence: `src/components/CheckoutModal.jsx`)
- Checkout → Store State: places order (evidence: `src/components/CheckoutModal.jsx`)
- Order Confirmation → WhatsApp Messaging: formats message (evidence: `src/components/OrderSuccessModal.jsx`)
- Order Management → WhatsApp Messaging: formats message (evidence: `src/components/admin/OrderManager.jsx`)
- WhatsApp Messaging → WhatsApp: creates links (evidence: `src/services/whatsappService.js`)
- Store State → Seed Catalog Data: loads fallback (evidence: `src/context/StoreContext.jsx`)
- Store State → Inventory Logic: updates stock (evidence: `src/context/StoreContext.jsx`)
- Store State → Review Metrics: calculates ratings (evidence: `src/context/StoreContext.jsx`)
- Store State → Store Data API: fetches and saves (evidence: `src/context/StoreContext.jsx`)
- Store Data API → Supabase Client: uses client (evidence: `src/services/storeApi.ts`)
- Supabase Client → Supabase: connects (evidence: `src/lib/supabase.ts`)
- Product Management → Store State: manages products (evidence: `src/components/admin/ProductManager.jsx`)
- Inventory Management → Store State: updates stock (evidence: `src/components/admin/InventoryManager.jsx`)
- Inventory Management → Inventory Logic: checks stock (evidence: `src/components/admin/InventoryManager.jsx`)
- Order Management → Store State: manages orders (evidence: `src/components/admin/OrderManager.jsx`)
- Review Moderation → Store State: moderates reviews (evidence: `src/components/admin/ReviewModerator.jsx`)
- Admin Console → Product Management: renders (evidence: `src/components/admin/AdminLayout.jsx`)
- Admin Console → Inventory Management: renders (evidence: `src/components/admin/AdminLayout.jsx`)
- Admin Console → Order Management: renders (evidence: `src/components/admin/AdminLayout.jsx`)
- Admin Console → Review Moderation: renders (evidence: `src/components/admin/AdminLayout.jsx`)
- Admin Console → Admin Requests: renders (evidence: `src/components/admin/AdminLayout.jsx`)
- Admin Requests → Admin Requests API: calls (evidence: `src/components/admin/AdminRequests.jsx`)
- Admin Requests API → Supabase Client: uses client (evidence: `src/services/adminRequestsApi.ts`)
- Admin Console → Admin Authentication: checks access (evidence: `src/components/admin/AdminLayout.jsx`)
- Admin Authentication → Authentication API: authenticates (evidence: `src/context/AuthContext.jsx`)
- Authentication API → Supabase Client: uses client (evidence: `src/services/authApi.ts`)
- Admin Authentication → Supabase Client: observes session (evidence: `src/context/AuthContext.jsx`)
