# ashutosh7706/gocart architecture

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

- Interactive diagram: https://gitdiagram.com/ashutosh7706/gocart
- Repository: https://github.com/ashutosh7706/gocart

## Overview

GoCart is a multi-vendor marketplace. The principal journey is browsing and filtering products, adding items to a cart, checking out, and then viewing and tracking orders; users can also manage wishlists and reviews. Vendors manage products, inventory, orders, and sales analytics, while admins oversee platform operations. The graph combines sampled implementation evidence with README-documented capabilities; dashed, uncited links mark interactions whose implementation was not shown.

Main entry points: [`lib/prisma.js`](https://github.com/ashutosh7706/gocart/blob/main/lib/prisma.js) (PostgreSQL), [`app/api/orders/route.js`](https://github.com/ashutosh7706/gocart/blob/main/app/api/orders/route.js) (Order Placement), [`app/store/add-product/page.jsx`](https://github.com/ashutosh7706/gocart/blob/main/app/store/add-product/page.jsx) (Product Management), [`app/(public)/shop/page.jsx`](https://github.com/ashutosh7706/gocart/blob/main/app/(public)/shop/page.jsx) (Product Catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shop["Shopping"]
  node_storefront["Storefront<br/>[page.jsx]"]
  node_catalog["Product Catalog<br/>[page.jsx]"]
  node_product["Product Detail<br/>[ProductClient.jsx]"]
  node_search["Search and Filters<br/>[Filters.jsx]"]
  node_wishlist["Wishlist<br/>[page.jsx]"]
end

subgraph group_commerce["Commerce Operations"]
  node_cart["Shopping Cart<br/>[page.jsx]"]
  node_checkout["Checkout<br/>[page.jsx]"]
  node_orders["Order Placement<br/>[route.js]"]
  node_payment["Payment Routes<br/>[route.js]"]
  node_orderhistory["Order History<br/>[page.jsx]"]
  node_orderui["Order Components"]
  node_returns["Returns<br/>[page.jsx]"]
  node_ratings["Ratings and Reviews<br/>[route.js]"]
end

subgraph group_seller["Vendor Operations"]
  node_vendorportal["Vendor Portal<br/>[page.jsx]"]
  node_productmanagement["Product Management<br/>[page.jsx]"]
  node_sellerorders["Seller Orders<br/>[page.jsx]"]
  node_selleranalytics["Sales Analytics<br/>[route.js]"]
end

subgraph group_platform["Platform Services"]
  node_admin["Admin Dashboard<br/>[page.jsx]"]
  node_auth["Authentication<br/>[route.js]"]
  node_identity["JWT Identity<br/>[auth.js]"]
  node_database[("PostgreSQL<br/>[prisma.js]")]
  node_uploads["Image Upload<br/>[route.js]"]
  node_notifications["Notifications<br/>[route.js]"]
end

node_shopper(("Shopper"))
node_vendor(("Vendor"))

node_shopper -->|"browses"| node_storefront
node_shopper -->|"browses"| node_catalog
node_catalog -.->|"filters"| node_search
node_shopper -->|"views"| node_product
node_shopper -->|"saves products"| node_wishlist
node_shopper -->|"adds products"| node_cart
node_shopper -.->|"checks out"| node_checkout
node_checkout -.->|"places order"| node_orders
node_orders -->|"reads and writes"| node_database
node_orders -.->|"creates notification"| node_notifications
node_shopper -.->|"pays"| node_payment
node_shopper -->|"tracks orders"| node_orderhistory
node_orderhistory -->|"renders"| node_orderui
node_shopper -.->|"requests returns"| node_returns
node_shopper -->|"reviews purchases"| node_ratings
node_ratings -->|"reads and writes"| node_database
node_vendor -->|"manages store"| node_vendorportal
node_vendorportal -->|"fetches dashboard"| node_selleranalytics
node_vendor -->|"manages products"| node_productmanagement
node_productmanagement -->|"creates products"| node_database
node_vendor -->|"manages orders"| node_sellerorders
node_selleranalytics -->|"reads metrics"| node_database
node_admin -.->|"reads platform data"| node_database
node_auth -.->|"verifies identity"| node_identity
node_identity -->|"looks up store"| node_database
node_productmanagement -.->|"uploads images"| node_uploads

click node_storefront "https://github.com/ashutosh7706/gocart/blob/main/app/(public)/page.jsx"
click node_catalog "https://github.com/ashutosh7706/gocart/blob/main/app/(public)/shop/page.jsx"
click node_product "https://github.com/ashutosh7706/gocart/blob/main/app/(public)/product/%5BproductId%5D/ProductClient.jsx"
click node_search "https://github.com/ashutosh7706/gocart/blob/main/components/shop/Filters.jsx"
click node_wishlist "https://github.com/ashutosh7706/gocart/blob/main/app/(public)/wishlist/page.jsx"
click node_cart "https://github.com/ashutosh7706/gocart/blob/main/app/(public)/cart/page.jsx"
click node_checkout "https://github.com/ashutosh7706/gocart/blob/main/app/(public)/checkout/page.jsx"
click node_orders "https://github.com/ashutosh7706/gocart/blob/main/app/api/orders/route.js"
click node_payment "https://github.com/ashutosh7706/gocart/blob/main/app/api/payment/create-order/route.js"
click node_orderhistory "https://github.com/ashutosh7706/gocart/blob/main/app/orders/page.jsx"
click node_orderui "https://github.com/ashutosh7706/gocart/tree/main/app/orders/components"
click node_returns "https://github.com/ashutosh7706/gocart/blob/main/app/(public)/returns/page.jsx"
click node_ratings "https://github.com/ashutosh7706/gocart/blob/main/app/api/ratings/route.js"
click node_vendorportal "https://github.com/ashutosh7706/gocart/blob/main/app/store/page.jsx"
click node_productmanagement "https://github.com/ashutosh7706/gocart/blob/main/app/store/add-product/page.jsx"
click node_sellerorders "https://github.com/ashutosh7706/gocart/blob/main/app/store/orders/page.jsx"
click node_selleranalytics "https://github.com/ashutosh7706/gocart/blob/main/app/api/store/dashboard/route.js"
click node_admin "https://github.com/ashutosh7706/gocart/blob/main/app/admin/page.jsx"
click node_auth "https://github.com/ashutosh7706/gocart/blob/main/app/api/auth/login/route.js"
click node_identity "https://github.com/ashutosh7706/gocart/blob/main/lib/auth.js"
click node_database "https://github.com/ashutosh7706/gocart/blob/main/lib/prisma.js"
click node_uploads "https://github.com/ashutosh7706/gocart/blob/main/app/api/upload/route.js"
click node_notifications "https://github.com/ashutosh7706/gocart/blob/main/app/api/notifications/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_storefront,node_catalog,node_product,node_search,node_wishlist toneBlue
class node_cart,node_checkout,node_orders,node_payment,node_orderhistory,node_orderui,node_returns,node_ratings toneAmber
class node_vendorportal,node_productmanagement,node_sellerorders,node_selleranalytics toneMint
class node_admin,node_auth,node_identity,node_database,node_uploads,node_notifications toneRose
class node_shopper,node_vendor toneIndigo
```

## Components

### Shopping

- [Storefront](https://github.com/ashutosh7706/gocart/blob/main/app/(public)/page.jsx): `app/(public)/page.jsx`
- [Product Catalog](https://github.com/ashutosh7706/gocart/blob/main/app/(public)/shop/page.jsx): `app/(public)/shop/page.jsx`
- [Product Detail](https://github.com/ashutosh7706/gocart/blob/main/app/(public)/product/%5BproductId%5D/ProductClient.jsx): `app/(public)/product/[productId]/ProductClient.jsx`
- [Search and Filters](https://github.com/ashutosh7706/gocart/blob/main/components/shop/Filters.jsx): `components/shop/Filters.jsx`
- [Wishlist](https://github.com/ashutosh7706/gocart/blob/main/app/(public)/wishlist/page.jsx): `app/(public)/wishlist/page.jsx`

### Commerce Operations

- [Shopping Cart](https://github.com/ashutosh7706/gocart/blob/main/app/(public)/cart/page.jsx): `app/(public)/cart/page.jsx`
- [Checkout](https://github.com/ashutosh7706/gocart/blob/main/app/(public)/checkout/page.jsx): `app/(public)/checkout/page.jsx`
- [Order Placement](https://github.com/ashutosh7706/gocart/blob/main/app/api/orders/route.js): `app/api/orders/route.js`
- [Payment Routes](https://github.com/ashutosh7706/gocart/blob/main/app/api/payment/create-order/route.js): `app/api/payment/create-order/route.js`
- [Order History](https://github.com/ashutosh7706/gocart/blob/main/app/orders/page.jsx): `app/orders/page.jsx`
- [Order Components](https://github.com/ashutosh7706/gocart/tree/main/app/orders/components): `app/orders/components`
- [Returns](https://github.com/ashutosh7706/gocart/blob/main/app/(public)/returns/page.jsx): `app/(public)/returns/page.jsx`
- [Ratings and Reviews](https://github.com/ashutosh7706/gocart/blob/main/app/api/ratings/route.js): `app/api/ratings/route.js`

### Vendor Operations

- [Vendor Portal](https://github.com/ashutosh7706/gocart/blob/main/app/store/page.jsx): `app/store/page.jsx`
- [Product Management](https://github.com/ashutosh7706/gocart/blob/main/app/store/add-product/page.jsx): `app/store/add-product/page.jsx`
- [Seller Orders](https://github.com/ashutosh7706/gocart/blob/main/app/store/orders/page.jsx): `app/store/orders/page.jsx`
- [Sales Analytics](https://github.com/ashutosh7706/gocart/blob/main/app/api/store/dashboard/route.js): `app/api/store/dashboard/route.js`

### Platform Services

- [Admin Dashboard](https://github.com/ashutosh7706/gocart/blob/main/app/admin/page.jsx): `app/admin/page.jsx`
- [Authentication](https://github.com/ashutosh7706/gocart/blob/main/app/api/auth/login/route.js): `app/api/auth/login/route.js`
- [JWT Identity](https://github.com/ashutosh7706/gocart/blob/main/lib/auth.js): `lib/auth.js`
- [PostgreSQL](https://github.com/ashutosh7706/gocart/blob/main/lib/prisma.js): `lib/prisma.js`
- [Image Upload](https://github.com/ashutosh7706/gocart/blob/main/app/api/upload/route.js): `app/api/upload/route.js`
- [Notifications](https://github.com/ashutosh7706/gocart/blob/main/app/api/notifications/route.js): `app/api/notifications/route.js`

### Other components

- **Shopper**
- **Vendor**

## Connections

- Shopper → Storefront: browses (evidence: `README.md`)
- Shopper → Product Catalog: browses (evidence: `README.md`)
- Product Catalog → Search and Filters: filters
- Shopper → Product Detail: views (evidence: `README.md`)
- Shopper → Wishlist: saves products (evidence: `README.md`)
- Shopper → Shopping Cart: adds products (evidence: `README.md`)
- Shopper → Checkout: checks out
- Checkout → Order Placement: places order
- Order Placement → PostgreSQL: reads and writes (evidence: `app/api/orders/route.js`)
- Order Placement → Notifications: creates notification
- Shopper → Payment Routes: pays
- Shopper → Order History: tracks orders (evidence: `README.md`)
- Order History → Order Components: renders (evidence: `app/orders/page.jsx`)
- Shopper → Returns: requests returns
- Shopper → Ratings and Reviews: reviews purchases (evidence: `README.md`)
- Ratings and Reviews → PostgreSQL: reads and writes (evidence: `app/api/ratings/route.js`)
- Vendor → Vendor Portal: manages store (evidence: `README.md`)
- Vendor Portal → Sales Analytics: fetches dashboard (evidence: `app/store/page.jsx`)
- Vendor → Product Management: manages products (evidence: `README.md`)
- Product Management → PostgreSQL: creates products
- Vendor → Seller Orders: manages orders (evidence: `README.md`)
- Sales Analytics → PostgreSQL: reads metrics (evidence: `app/api/store/dashboard/route.js`)
- Admin Dashboard → PostgreSQL: reads platform data
- Authentication → JWT Identity: verifies identity
- JWT Identity → PostgreSQL: looks up store (evidence: `lib/auth.js`)
- Product Management → Image Upload: uploads images
