# eduardolsoares/e_commerce_dbii architecture

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

- Interactive diagram: https://gitdiagram.com/eduardolsoares/e_commerce_dbii
- Repository: https://github.com/eduardolsoares/e_commerce_dbii

## Overview

This repository is a Next.js fashion-commerce storefront. Shoppers browse a product catalog, open product details, manage a locally persisted cart, and reach checkout; signed-in users can view orders. Google sign-in is configured through NextAuth and Prisma. The graph follows relationships shown in excerpts or the source index; several route and component implementations were not sampled, so uncertain links are omitted.

Main entry points: [`src/app/page.js`](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/page.js) (Home catalog), [`src/app/context/CartContext.jsx`](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/context/CartContext.jsx) (Cart state), [`src/lib/prisma.js`](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/lib/prisma.js) (Prisma client), [`src/app/component/layout/Navbar.jsx`](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/Navbar.jsx) (Navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront browsing"]
  node_home["Home catalog<br/>[page.js]"]
  node_productrow["Product rows<br/>[ProductRow.jsx]"]
  node_productroute["Product route<br/>[page.js]"]
  node_productdetails["Product details<br/>[ProductDetails.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_search["Search bar"]
  node_hero["Hero section<br/>[HeroSection.jsx]"]
  node_footer["Store footer"]
end

subgraph group_shopping["Cart and orders"]
  node_cartroute["Cart route<br/>[page.js]"]
  node_cartview["Cart view<br/>[YourCart.jsx]"]
  node_cartstate["Cart state<br/>[CartContext.jsx]"]
  node_checkoutroute["Checkout route<br/>[page.js]"]
  node_checkoutview["Checkout view<br/>[CheckoutPage.jsx]"]
  node_ordersroute["Orders route<br/>[page.js]"]
  node_ordersview["Orders view<br/>[OrdersPage.jsx]"]
end

subgraph group_identity["Authentication"]
  node_signin["Sign-in controls<br/>[auth.jsx]"]
  node_accountmenu["Account menu"]
  node_authroute["Auth endpoint<br/>[route.js]"]
  node_authconfig["Auth configuration<br/>[auth.js]"]
  node_sessionwrapper["Session wrapper<br/>[SessionWrapper.js]"]
end

subgraph group_platform["Persistence and runtime"]
  node_prisma["Prisma client<br/>[prisma.js]"]
  node_database[("Commerce database<br/>[schema.prisma]")]
  node_applayout["Application layout<br/>[layout.js]"]
end

node_shopper(("Shopper"))
node_google(("Google identity"))

node_shopper -->|"browses"| node_home
node_home -->|"renders"| node_productrow
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_navbar
node_home -->|"renders"| node_footer
node_home -->|"loads products"| node_prisma
node_shopper -->|"opens product"| node_productroute
node_productroute -->|"renders"| node_productdetails
node_productroute -->|"renders"| node_navbar
node_productroute -->|"renders"| node_footer
node_productdetails -->|"reads product"| node_prisma
node_productdetails -->|"updates cart"| node_cartstate
node_navbar -->|"renders"| node_search
node_navbar -->|"renders"| node_signin
node_navbar -->|"reads cart"| node_cartstate
node_shopper -->|"opens cart"| node_cartroute
node_cartroute -->|"renders"| node_cartview
node_cartview -->|"reads and updates"| node_cartstate
node_cartview -->|"reads product"| node_prisma
node_cartstate -->|"persists cart locally"| node_shopper
node_shopper -->|"starts checkout"| node_checkoutroute
node_checkoutroute -->|"renders"| node_checkoutview
node_checkoutview -->|"reads cart"| node_cartstate
node_shopper -->|"views orders"| node_ordersroute
node_ordersroute -->|"renders"| node_ordersview
node_ordersroute -->|"gets session"| node_authconfig
node_ordersroute -->|"loads orders"| node_prisma
node_signin -->|"signs in"| node_google
node_signin -->|"renders"| node_accountmenu
node_authroute -->|"configures handler"| node_authconfig
node_authconfig -->|"uses provider"| node_google
node_authconfig -->|"configures adapter"| node_prisma
node_prisma -.->|"accesses schema"| node_database
node_applayout -->|"wraps app"| node_sessionwrapper
node_applayout -->|"provides cart"| node_cartstate

click node_home "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/page.js"
click node_productrow "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/ProductRow.jsx"
click node_productroute "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/product/%5Bid%5D/page.js"
click node_productdetails "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/ProductDetails.jsx"
click node_navbar "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/Navbar.jsx"
click node_search "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/ExpandingSearchBar.jsx"
click node_hero "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/HeroSection.jsx"
click node_footer "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/LandingPageFooter.jsx"
click node_cartroute "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/Cart/page.js"
click node_cartview "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/YourCart.jsx"
click node_cartstate "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/context/CartContext.jsx"
click node_checkoutroute "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/Checkout/page.js"
click node_checkoutview "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/CheckoutPage.jsx"
click node_ordersroute "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/Orders/page.js"
click node_ordersview "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/OrdersPage.jsx"
click node_signin "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/auth.jsx"
click node_accountmenu "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/AccountDropdown.jsx"
click node_authroute "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/api/auth/%5B...nextauth%5D/route.js"
click node_authconfig "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/auth.js"
click node_sessionwrapper "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/SessionWrapper.js"
click node_prisma "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/lib/prisma.js"
click node_database "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/prisma/schema.prisma"
click node_applayout "https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/layout.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_productrow,node_productroute,node_productdetails,node_navbar,node_search,node_hero,node_footer toneBlue
class node_cartroute,node_cartview,node_cartstate,node_checkoutroute,node_checkoutview,node_ordersroute,node_ordersview toneAmber
class node_signin,node_accountmenu,node_authroute,node_authconfig,node_sessionwrapper toneMint
class node_prisma,node_database,node_applayout toneRose
class node_shopper,node_google toneIndigo
```

## Components

### Storefront browsing

- [Home catalog](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/page.js): `src/app/page.js`
- [Product rows](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/ProductRow.jsx): `src/app/component/layout/ProductRow.jsx`
- [Product route](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/product/%5Bid%5D/page.js): `src/app/product/[id]/page.js`
- [Product details](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/ProductDetails.jsx): `src/app/component/layout/ProductDetails.jsx`
- [Navigation](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/Navbar.jsx): `src/app/component/layout/Navbar.jsx`
- [Search bar](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/ExpandingSearchBar.jsx): `src/app/component/layout/ExpandingSearchBar.jsx`
- [Hero section](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/HeroSection.jsx): `src/app/component/layout/HeroSection.jsx`
- [Store footer](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/LandingPageFooter.jsx): `src/app/component/layout/LandingPageFooter.jsx`

### Cart and orders

- [Cart route](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/Cart/page.js): `src/app/Cart/page.js`
- [Cart view](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/YourCart.jsx): `src/app/component/layout/YourCart.jsx`
- [Cart state](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/context/CartContext.jsx): `src/app/context/CartContext.jsx`
- [Checkout route](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/Checkout/page.js): `src/app/Checkout/page.js`
- [Checkout view](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/CheckoutPage.jsx): `src/app/component/layout/CheckoutPage.jsx`
- [Orders route](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/Orders/page.js): `src/app/Orders/page.js`
- [Orders view](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/OrdersPage.jsx): `src/app/component/layout/OrdersPage.jsx`

### Authentication

- [Sign-in controls](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/auth.jsx): `src/app/component/auth.jsx`
- [Account menu](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/layout/AccountDropdown.jsx): `src/app/component/layout/AccountDropdown.jsx`
- [Auth endpoint](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/api/auth/%5B...nextauth%5D/route.js): `src/app/api/auth/[...nextauth]/route.js`
- [Auth configuration](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/auth.js): `auth.js`
- [Session wrapper](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/component/SessionWrapper.js): `src/app/component/SessionWrapper.js`

### Persistence and runtime

- [Prisma client](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/lib/prisma.js): `src/lib/prisma.js`
- [Commerce database](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/prisma/schema.prisma): `prisma/schema.prisma`
- [Application layout](https://github.com/eduardolsoares/e_commerce_dbii/blob/main/src/app/layout.js): `src/app/layout.js`

### Other components

- **Shopper**
- **Google identity**

## Connections

- Shopper → Home catalog: browses
- Home catalog → Product rows: renders (evidence: `src/app/page.js`)
- Home catalog → Hero section: renders (evidence: `src/app/page.js`)
- Home catalog → Navigation: renders (evidence: `src/app/page.js`)
- Home catalog → Store footer: renders (evidence: `src/app/page.js`)
- Home catalog → Prisma client: loads products (evidence: `src/app/page.js`)
- Shopper → Product route: opens product
- Product route → Product details: renders (evidence: `src/app/product/[id]/page.js`)
- Product route → Navigation: renders (evidence: `src/app/product/[id]/page.js`)
- Product route → Store footer: renders (evidence: `src/app/product/[id]/page.js`)
- Product details → Prisma client: reads product (evidence: `src/app/component/layout/ProductDetails.jsx`)
- Product details → Cart state: updates cart (evidence: `src/app/component/layout/ProductDetails.jsx`)
- Navigation → Search bar: renders (evidence: `src/app/component/layout/Navbar.jsx`)
- Navigation → Sign-in controls: renders (evidence: `src/app/component/layout/Navbar.jsx`)
- Navigation → Cart state: reads cart (evidence: `src/app/component/layout/Navbar.jsx`)
- Shopper → Cart route: opens cart
- Cart route → Cart view: renders (evidence: `src/app/Cart/page.js`)
- Cart view → Cart state: reads and updates (evidence: `src/app/component/layout/YourCart.jsx`)
- Cart view → Prisma client: reads product (evidence: `src/app/component/layout/YourCart.jsx`)
- Cart state → Shopper: persists cart locally (evidence: `src/app/context/CartContext.jsx`)
- Shopper → Checkout route: starts checkout
- Checkout route → Checkout view: renders (evidence: `src/app/Checkout/page.js`)
- Checkout view → Cart state: reads cart (evidence: `src/app/component/layout/CheckoutPage.jsx`)
- Shopper → Orders route: views orders
- Orders route → Orders view: renders (evidence: `src/app/Orders/page.js`)
- Orders route → Auth configuration: gets session (evidence: `src/app/Orders/page.js`)
- Orders route → Prisma client: loads orders (evidence: `src/app/Orders/page.js`)
- Sign-in controls → Google identity: signs in (evidence: `src/app/component/auth.jsx`)
- Sign-in controls → Account menu: renders (evidence: `src/app/component/auth.jsx`)
- Auth endpoint → Auth configuration: configures handler (evidence: `src/app/api/auth/[...nextauth]/route.js`)
- Auth configuration → Google identity: uses provider (evidence: `auth.js`)
- Auth configuration → Prisma client: configures adapter (evidence: `auth.js`)
- Prisma client → Commerce database: accesses schema
- Application layout → Session wrapper: wraps app (evidence: `src/app/layout.js`)
- Application layout → Cart state: provides cart (evidence: `src/app/layout.js`)
