# juliolimaal/project_pw2 architecture

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

- Interactive diagram: https://gitdiagram.com/juliolimaal/project_pw2
- Repository: https://github.com/juliolimaal/project_pw2

## Overview

World Wines Web is a wine e-commerce storefront. Shoppers browse the home and wine-category pages, add products to a persistent cart, and proceed to an interactive payment form; the payment page records payment data in Supabase and clears the cart on success. The application also provides a newsletter signup and documented product/user database integration. The graph reflects shown imports, calls, and README statements; several API route implementations were not excerpted, so their behavior and connections are omitted.

Main entry points: [`src/app/contexts/CartContext.jsx`](https://github.com/juliolimaal/project_pw2/blob/main/src/app/contexts/CartContext.jsx) (Cart State), [`src/app/page.jsx`](https://github.com/juliolimaal/project_pw2/blob/main/src/app/page.jsx) (Home Page), [`src/app/red/page.jsx`](https://github.com/juliolimaal/project_pw2/blob/main/src/app/red/page.jsx) (Red Wines Page), [`src/app/layout.jsx`](https://github.com/juliolimaal/project_pw2/blob/main/src/app/layout.jsx) (Site Layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home Page<br/>[page.jsx]"]
  node_hero["Hero<br/>[Hero.jsx]"]
  node_carousel["Wine Carousel<br/>[Winecarrossel.jsx]"]
  node_quality["Quality Grid<br/>[QualityGrid.jsx]"]
  node_sections["Story Sections<br/>[Sections.jsx]"]
  node_header["Site Layout<br/>[layout.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_footer["Footer Signup<br/>[Footer.jsx]"]
end

subgraph group_catalog["Wine Catalog"]
  node_red["Red Wines Page<br/>[page.jsx]"]
  node_redheader["Red Header<br/>[RedHeader.jsx]"]
  node_winesection["Wine Display<br/>[WineSection.jsx]"]
  node_white["White Wines Page<br/>[page.jsx]"]
  node_rose["Rosé Wines Page<br/>[page.jsx]"]
end

subgraph group_cart["Cart"]
  node_cartstate["Cart State<br/>[CartContext.jsx]"]
  node_sidebar["Cart Sidebar<br/>[CartSidebar.jsx]"]
  node_cartpage["Cart Page<br/>[page.jsx]"]
  node_payment["Payment Page<br/>[page.jsx]"]
end

subgraph group_services["Data and Signup"]
  node_supabaseclient["Supabase Client<br/>[supabaseClient.js]"]
  node_supabase[("Supabase")]
  node_emailapi["Email API Route<br/>[route.js]"]
  node_browserstorage[("Browser LocalStorage")]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_home
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_carousel
node_home -->|"renders"| node_quality
node_home -->|"renders"| node_sections
node_header -->|"renders"| node_navbar
node_header -->|"renders"| node_footer
node_header -->|"renders"| node_sidebar
node_header -->|"provides state"| node_cartstate
node_shopper -->|"browses"| node_red
node_red -->|"renders"| node_redheader
node_red -->|"renders"| node_winesection
node_red -->|"fetches prices"| node_supabaseclient
node_shopper -->|"browses"| node_white
node_shopper -->|"browses"| node_rose
node_winesection -->|"adds products"| node_cartstate
node_navbar -->|"reads cart count"| node_cartstate
node_sidebar -->|"reads and updates"| node_cartstate
node_sidebar -->|"links to"| node_payment
node_cartpage -.->|"uses cart"| node_cartstate
node_payment -->|"reads total and clears"| node_cartstate
node_cartstate -->|"persists cart"| node_browserstorage
node_payment -->|"inserts payment"| node_supabaseclient
node_red -->|"reads products"| node_supabase
node_payment -->|"stores payment"| node_supabase
node_supabaseclient -->|"connects to"| node_supabase
node_footer -->|"registers email"| node_supabaseclient
node_footer -->|"requests email"| node_emailapi

click node_home "https://github.com/juliolimaal/project_pw2/blob/main/src/app/page.jsx"
click node_hero "https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/Hero.jsx"
click node_carousel "https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/Winecarrossel.jsx"
click node_quality "https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/QualityGrid.jsx"
click node_sections "https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/Sections.jsx"
click node_header "https://github.com/juliolimaal/project_pw2/blob/main/src/app/layout.jsx"
click node_navbar "https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/Navbar.jsx"
click node_footer "https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/Footer.jsx"
click node_red "https://github.com/juliolimaal/project_pw2/blob/main/src/app/red/page.jsx"
click node_redheader "https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/RedHeader.jsx"
click node_winesection "https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/WineSection.jsx"
click node_white "https://github.com/juliolimaal/project_pw2/blob/main/src/app/white/page.jsx"
click node_rose "https://github.com/juliolimaal/project_pw2/blob/main/src/app/rose/page.jsx"
click node_cartstate "https://github.com/juliolimaal/project_pw2/blob/main/src/app/contexts/CartContext.jsx"
click node_sidebar "https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/CartSidebar.jsx"
click node_cartpage "https://github.com/juliolimaal/project_pw2/blob/main/src/app/cart/page.jsx"
click node_payment "https://github.com/juliolimaal/project_pw2/blob/main/src/app/pagamento/page.jsx"
click node_supabaseclient "https://github.com/juliolimaal/project_pw2/blob/main/src/app/lib/supabaseClient.js"
click node_emailapi "https://github.com/juliolimaal/project_pw2/blob/main/src/app/api/send-email/route.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_hero,node_carousel,node_quality,node_sections,node_header,node_navbar,node_footer toneBlue
class node_red,node_redheader,node_winesection,node_white,node_rose toneAmber
class node_cartstate,node_sidebar,node_cartpage,node_payment toneMint
class node_supabaseclient,node_supabase,node_emailapi,node_browserstorage toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Home Page](https://github.com/juliolimaal/project_pw2/blob/main/src/app/page.jsx): `src/app/page.jsx`
- [Hero](https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/Hero.jsx): `src/app/components/Hero.jsx`
- [Wine Carousel](https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/Winecarrossel.jsx): `src/app/components/Winecarrossel.jsx`
- [Quality Grid](https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/QualityGrid.jsx): `src/app/components/QualityGrid.jsx`
- [Story Sections](https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/Sections.jsx): `src/app/components/Sections.jsx`
- [Site Layout](https://github.com/juliolimaal/project_pw2/blob/main/src/app/layout.jsx): `src/app/layout.jsx`
- [Navigation](https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/Navbar.jsx): `src/app/components/Navbar.jsx`
- [Footer Signup](https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/Footer.jsx): `src/app/components/Footer.jsx`

### Wine Catalog

- [Red Wines Page](https://github.com/juliolimaal/project_pw2/blob/main/src/app/red/page.jsx): `src/app/red/page.jsx`
- [Red Header](https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/RedHeader.jsx): `src/app/components/RedHeader.jsx`
- [Wine Display](https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/WineSection.jsx): `src/app/components/WineSection.jsx`
- [White Wines Page](https://github.com/juliolimaal/project_pw2/blob/main/src/app/white/page.jsx): `src/app/white/page.jsx`
- [Rosé Wines Page](https://github.com/juliolimaal/project_pw2/blob/main/src/app/rose/page.jsx): `src/app/rose/page.jsx`

### Cart

- [Cart State](https://github.com/juliolimaal/project_pw2/blob/main/src/app/contexts/CartContext.jsx): `src/app/contexts/CartContext.jsx`
- [Cart Sidebar](https://github.com/juliolimaal/project_pw2/blob/main/src/app/components/CartSidebar.jsx): `src/app/components/CartSidebar.jsx`
- [Cart Page](https://github.com/juliolimaal/project_pw2/blob/main/src/app/cart/page.jsx): `src/app/cart/page.jsx`
- [Payment Page](https://github.com/juliolimaal/project_pw2/blob/main/src/app/pagamento/page.jsx): `src/app/pagamento/page.jsx`

### Data and Signup

- [Supabase Client](https://github.com/juliolimaal/project_pw2/blob/main/src/app/lib/supabaseClient.js): `src/app/lib/supabaseClient.js`
- **Supabase**
- [Email API Route](https://github.com/juliolimaal/project_pw2/blob/main/src/app/api/send-email/route.js): `src/app/api/send-email/route.js`
- **Browser LocalStorage**

### Other components

- **Shopper**

## Connections

- Shopper → Home Page: browses (evidence: `README.md`)
- Home Page → Hero: renders (evidence: `src/app/page.jsx`)
- Home Page → Wine Carousel: renders (evidence: `src/app/page.jsx`)
- Home Page → Quality Grid: renders (evidence: `src/app/page.jsx`)
- Home Page → Story Sections: renders (evidence: `src/app/page.jsx`)
- Site Layout → Navigation: renders (evidence: `src/app/layout.jsx`)
- Site Layout → Footer Signup: renders (evidence: `src/app/layout.jsx`)
- Site Layout → Cart Sidebar: renders (evidence: `src/app/layout.jsx`)
- Site Layout → Cart State: provides state (evidence: `src/app/layout.jsx`)
- Shopper → Red Wines Page: browses (evidence: `README.md`)
- Red Wines Page → Red Header: renders (evidence: `src/app/red/page.jsx`)
- Red Wines Page → Wine Display: renders (evidence: `src/app/red/page.jsx`)
- Red Wines Page → Supabase Client: fetches prices (evidence: `src/app/red/page.jsx`)
- Shopper → White Wines Page: browses (evidence: `README.md`)
- Shopper → Rosé Wines Page: browses (evidence: `README.md`)
- Wine Display → Cart State: adds products (evidence: `src/app/components/WineSection.jsx`)
- Navigation → Cart State: reads cart count (evidence: `src/app/components/Navbar.jsx`)
- Cart Sidebar → Cart State: reads and updates (evidence: `src/app/components/CartSidebar.jsx`)
- Cart Sidebar → Payment Page: links to (evidence: `src/app/components/CartSidebar.jsx`)
- Cart Page → Cart State: uses cart
- Payment Page → Cart State: reads total and clears (evidence: `src/app/pagamento/page.jsx`)
- Cart State → Browser LocalStorage: persists cart (evidence: `src/app/contexts/CartContext.jsx`)
- Payment Page → Supabase Client: inserts payment (evidence: `src/app/pagamento/page.jsx`)
- Red Wines Page → Supabase: reads products (evidence: `src/app/red/page.jsx`)
- Payment Page → Supabase: stores payment (evidence: `src/app/pagamento/page.jsx`)
- Supabase Client → Supabase: connects to (evidence: `README.md`)
- Footer Signup → Supabase Client: registers email (evidence: `src/app/components/Footer.jsx`)
- Footer Signup → Email API Route: requests email (evidence: `src/app/components/Footer.jsx`)
