# riteshsoni-8957/shopease-ecomm architecture

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

- Interactive diagram: https://gitdiagram.com/riteshsoni-8957/shopease-ecomm
- Repository: https://github.com/riteshsoni-8957/shopease-ecomm

## Overview

ShopEase is a Next.js storefront. Customers browse the home, product, and category views, then use account, cart, and checkout flows; contact and profile pages provide supporting experiences. Server actions coordinate session and commerce operations, while API modules use PostgreSQL through a shared pool. The source index supports several component and data-layer connections, but some route and checkout details are only identified by imports; those links are shown cautiously.

Main entry points: [`src/serverAction/auth.js`](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/serverAction/auth.js) (Auth actions), [`src/_lib/db.js`](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/_lib/db.js) (PostgreSQL pool), [`src/app/page.tsx`](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/page.tsx) (Home page), [`src/app/products`](https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/app/products) (Product routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home page<br/>[page.tsx]"]
  node_home_sections["Home sections"]
  node_product_routes["Product routes"]
  node_product_views["Product views"]
  node_category_route["Category route<br/>[page.jsx]"]
  node_category_views["Category views"]
  node_contact_route["Contact route<br/>[page.jsx]"]
  node_contact_views["Contact views"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
end

subgraph group_accounts["Accounts"]
  node_auth_routes["Auth routes"]
  node_auth_views["Auth forms"]
  node_auth_actions["Auth actions<br/>[auth.js]"]
  node_sessions["Sessions<br/>[session.js]"]
  node_profile_route["Profile route<br/>[page.jsx]"]
  node_profile_views["Profile views<br/>[ProfilePage.jsx]"]
  node_session_route["Session endpoint<br/>[route.js]"]
end

subgraph group_commerce["Commerce"]
  node_cart_route["Cart route<br/>[page.jsx]"]
  node_cart_views["Cart views"]
  node_checkout_route["Checkout route<br/>[page.jsx]"]
  node_checkout_view["Checkout view<br/>[CheckoutPage.jsx]"]
end

subgraph group_data["Data access"]
  node_products_api["Product data<br/>[products.js]"]
  node_categories_api["Category data<br/>[categories.js]"]
  node_users_api["User data<br/>[users.js]"]
  node_carts_api["Cart data<br/>[carts.js]"]
  node_database[("PostgreSQL pool<br/>[db.js]")]
end

node_customer(("Customer"))

node_customer -.->|"visits"| node_home
node_customer -.->|"browses"| node_product_routes
node_customer -.->|"browses"| node_category_route
node_customer -.->|"signs in"| node_auth_routes
node_customer -.->|"opens cart"| node_cart_route
node_customer -.->|"checks out"| node_checkout_route
node_home -->|"renders"| node_home_sections
node_home -->|"renders"| node_navbar
node_home -->|"renders"| node_footer
node_product_routes -.->|"renders"| node_product_views
node_product_routes -.->|"loads"| node_products_api
node_category_route -->|"renders"| node_category_views
node_category_route -->|"loads"| node_categories_api
node_contact_route -.->|"renders"| node_contact_views
node_auth_routes -->|"renders"| node_auth_views
node_auth_views -->|"submits to"| node_auth_actions
node_auth_actions -->|"sets session"| node_sessions
node_auth_actions -->|"creates or updates"| node_users_api
node_auth_actions -->|"changes cart"| node_carts_api
node_auth_actions -->|"loads product"| node_products_api
node_auth_actions -->|"queries"| node_database
node_profile_route -->|"renders"| node_profile_views
node_profile_views -->|"updates via"| node_auth_actions
node_session_route -->|"deletes session"| node_sessions
node_cart_route -->|"renders"| node_cart_views
node_cart_views -.->|"loads cart"| node_carts_api
node_cart_views -->|"invokes actions"| node_auth_actions
node_checkout_route -->|"renders"| node_checkout_view
node_checkout_view -->|"invokes actions"| node_auth_actions
node_products_api -->|"queries"| node_database
node_categories_api -->|"queries"| node_database
node_users_api -->|"queries"| node_database
node_carts_api -->|"queries"| node_database

click node_home "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/page.tsx"
click node_home_sections "https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/components/home"
click node_product_routes "https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/app/products"
click node_product_views "https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/components/shopRouter"
click node_category_route "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/categories/page.jsx"
click node_category_views "https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/components/categoryRouter"
click node_contact_route "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/contact/page.jsx"
click node_contact_views "https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/components/contactRouter"
click node_navbar "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/components/navbar/Navbar.jsx"
click node_footer "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/components/footer/Footer.jsx"
click node_auth_routes "https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/app/(auth)"
click node_auth_views "https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/components/auth"
click node_auth_actions "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/serverAction/auth.js"
click node_sessions "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/_lib/session.js"
click node_profile_route "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/profile/page.jsx"
click node_profile_views "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/components/profile/ProfilePage.jsx"
click node_session_route "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/api/session/route.js"
click node_cart_route "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/carts/page.jsx"
click node_cart_views "https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/components/cartRouter"
click node_checkout_route "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/checkout/%5BpId%5D/page.jsx"
click node_checkout_view "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/components/checkoutRouter/CheckoutPage.jsx"
click node_products_api "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/api/products.js"
click node_categories_api "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/api/categories.js"
click node_users_api "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/api/users.js"
click node_carts_api "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/api/carts.js"
click node_database "https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/_lib/db.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_home_sections,node_product_routes,node_product_views,node_category_route,node_category_views,node_contact_route,node_contact_views,node_navbar,node_footer toneBlue
class node_auth_routes,node_auth_views,node_auth_actions,node_sessions,node_profile_route,node_profile_views,node_session_route toneAmber
class node_cart_route,node_cart_views,node_checkout_route,node_checkout_view toneMint
class node_products_api,node_categories_api,node_users_api,node_carts_api,node_database toneRose
class node_customer toneIndigo
```

## Components

### Storefront

- [Home page](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Home sections](https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/components/home): `src/components/home`
- [Product routes](https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/app/products): `src/app/products`
- [Product views](https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/components/shopRouter): `src/components/shopRouter`
- [Category route](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/categories/page.jsx): `src/app/categories/page.jsx`
- [Category views](https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/components/categoryRouter): `src/components/categoryRouter`
- [Contact route](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/contact/page.jsx): `src/app/contact/page.jsx`
- [Contact views](https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/components/contactRouter): `src/components/contactRouter`
- [Navigation](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/components/navbar/Navbar.jsx): `src/components/navbar/Navbar.jsx`
- [Footer](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/components/footer/Footer.jsx): `src/components/footer/Footer.jsx`

### Accounts

- [Auth routes](https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/app/(auth)): `src/app/(auth)`
- [Auth forms](https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/components/auth): `src/components/auth`
- [Auth actions](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/serverAction/auth.js): `src/serverAction/auth.js`
- [Sessions](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/_lib/session.js): `src/_lib/session.js`
- [Profile route](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/profile/page.jsx): `src/app/profile/page.jsx`
- [Profile views](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/components/profile/ProfilePage.jsx): `src/components/profile/ProfilePage.jsx`
- [Session endpoint](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/api/session/route.js): `src/app/api/session/route.js`

### Commerce

- [Cart route](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/carts/page.jsx): `src/app/carts/page.jsx`
- [Cart views](https://github.com/riteshsoni-8957/shopease-ecomm/tree/main/src/components/cartRouter): `src/components/cartRouter`
- [Checkout route](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/app/checkout/%5BpId%5D/page.jsx): `src/app/checkout/[pId]/page.jsx`
- [Checkout view](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/components/checkoutRouter/CheckoutPage.jsx): `src/components/checkoutRouter/CheckoutPage.jsx`

### Data access

- [Product data](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/api/products.js): `src/api/products.js`
- [Category data](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/api/categories.js): `src/api/categories.js`
- [User data](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/api/users.js): `src/api/users.js`
- [Cart data](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/api/carts.js): `src/api/carts.js`
- [PostgreSQL pool](https://github.com/riteshsoni-8957/shopease-ecomm/blob/main/src/_lib/db.js): `src/_lib/db.js`

### Other components

- **Customer**

## Connections

- Customer → Home page: visits
- Customer → Product routes: browses
- Customer → Category route: browses
- Customer → Auth routes: signs in
- Customer → Cart route: opens cart
- Customer → Checkout route: checks out
- Home page → Home sections: renders (evidence: `src/app/page.tsx`)
- Home page → Navigation: renders (evidence: `src/app/page.tsx`)
- Home page → Footer: renders (evidence: `src/app/page.tsx`)
- Product routes → Product views: renders (evidence: `src/app/products/page.jsx`)
- Product routes → Product data: loads (evidence: `src/app/products/page.jsx`)
- Category route → Category views: renders (evidence: `src/app/categories/page.jsx`)
- Category route → Category data: loads (evidence: `src/app/categories/page.jsx`)
- Contact route → Contact views: renders (evidence: `src/app/contact/page.jsx`)
- Auth routes → Auth forms: renders (evidence: `src/app/(auth)/login/page.jsx`)
- Auth forms → Auth actions: submits to (evidence: `src/components/auth/Login.jsx`)
- Auth actions → Sessions: sets session (evidence: `src/serverAction/auth.js`)
- Auth actions → User data: creates or updates (evidence: `src/serverAction/auth.js`)
- Auth actions → Cart data: changes cart (evidence: `src/serverAction/auth.js`)
- Auth actions → Product data: loads product (evidence: `src/serverAction/auth.js`)
- Auth actions → PostgreSQL pool: queries (evidence: `src/serverAction/auth.js`)
- Profile route → Profile views: renders (evidence: `src/app/profile/page.jsx`)
- Profile views → Auth actions: updates via (evidence: `src/components/profile/ProfilePage.jsx`)
- Session endpoint → Sessions: deletes session (evidence: `src/app/api/session/route.js`)
- Cart route → Cart views: renders (evidence: `src/app/carts/page.jsx`)
- Cart views → Cart data: loads cart
- Cart views → Auth actions: invokes actions (evidence: `src/components/cartRouter/AllCarts.jsx`)
- Checkout route → Checkout view: renders (evidence: `src/app/checkout/[pId]/page.jsx`)
- Checkout view → Auth actions: invokes actions (evidence: `src/components/checkoutRouter/CheckoutPage.jsx`)
- Product data → PostgreSQL pool: queries (evidence: `src/api/products.js`)
- Category data → PostgreSQL pool: queries (evidence: `src/api/categories.js`)
- User data → PostgreSQL pool: queries (evidence: `src/api/users.js`)
- Cart data → PostgreSQL pool: queries (evidence: `src/api/carts.js`)
