# anil2211/qubimall architecture

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

- Interactive diagram: https://gitdiagram.com/anil2211/qubimall
- Repository: https://github.com/anil2211/qubimall

## Overview

QubiMall is a full-stack storefront. The main customer journey is browsing or searching products, adding items to a cart, checking out into an order, and reviewing order history. Authentication supports account creation and sign-in; storefront capabilities also include category shops, featured items, wishlists, and profile management. The README describes search, filtering, responsive UI, and themes. Sampled API code confirms several database and authentication calls; frontend-to-API wiring and unsampled features are represented conservatively.

Main entry points: [`src/app/api/orders`](https://github.com/anil2211/qubimall/tree/main/src/app/api/orders) (Orders API), [`src/lib/db.ts`](https://github.com/anil2211/qubimall/blob/main/src/lib/db.ts) (Database connection), [`src/app/api/cart`](https://github.com/anil2211/qubimall/tree/main/src/app/api/cart) (Cart API), [`src/app/api/auth`](https://github.com/anil2211/qubimall/tree/main/src/app/api/auth) (Authentication API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_store["Storefront pages<br/>[page.tsx]"]
  node_shop["Shop listings"]
  node_productpage["Product details<br/>[page.tsx]"]
  node_catalogui["Catalog UI"]
  node_profile["Profile and orders UI"]
  node_wishlist["Wishlists"]
  node_theme["Theme support<br/>[ThemeProvider.tsx]"]
end

subgraph group_identity["Identity"]
  node_authui["Login and registration"]
  node_authprovider["Auth state<br/>[AuthProvider.tsx]"]
  node_authapi["Authentication API"]
  node_authutils["Token utilities<br/>[utils.ts]"]
end

subgraph group_commerce["Commerce"]
  node_cartui["Cart and checkout<br/>[page.tsx]"]
  node_cartstate["Cart state<br/>[cartSlice.ts]"]
  node_cartapi["Cart API"]
  node_orderapi["Orders API"]
  node_productapi["Product API"]
end

subgraph group_data["Data layer"]
  node_dbconnect["Database connection<br/>[db.ts]"]
  node_mongo[("MongoDB")]
  node_productmodel["Product model<br/>[product.ts]"]
  node_cartmodel["Cart model<br/>[cart.ts]"]
  node_ordermodel["Order model<br/>[order.ts]"]
  node_usermodel["User model<br/>[user.ts]"]
end

node_customer(("Customer"))

node_customer -->|"browses"| node_store
node_customer -->|"signs in"| node_authui
node_customer -->|"checks out"| node_cartui
node_authapi -->|"creates tokens"| node_authutils
node_authapi -->|"connects"| node_dbconnect
node_authapi -->|"reads/writes users"| node_usermodel
node_productapi -->|"connects"| node_dbconnect
node_productapi -->|"queries products"| node_productmodel
node_cartapi -->|"requires auth"| node_authutils
node_cartapi -->|"connects"| node_dbconnect
node_cartapi -->|"reads/writes cart"| node_cartmodel
node_cartapi -->|"looks up products"| node_productmodel
node_orderapi -->|"requires auth"| node_authutils
node_orderapi -->|"connects"| node_dbconnect
node_orderapi -->|"reads/writes orders"| node_ordermodel
node_orderapi -->|"clears cart"| node_cartmodel
node_orderapi -->|"looks up products"| node_productmodel
node_dbconnect -->|"connects"| node_mongo

click node_store "https://github.com/anil2211/qubimall/blob/main/src/app/page.tsx"
click node_shop "https://github.com/anil2211/qubimall/tree/main/src/app/shops"
click node_productpage "https://github.com/anil2211/qubimall/blob/main/src/app/products/%5Bslug%5D/page.tsx"
click node_catalogui "https://github.com/anil2211/qubimall/tree/main/src/components"
click node_profile "https://github.com/anil2211/qubimall/tree/main/src/app/profile"
click node_wishlist "https://github.com/anil2211/qubimall/tree/main/src/app/profile/wishlists"
click node_theme "https://github.com/anil2211/qubimall/blob/main/src/components/ThemeProvider.tsx"
click node_authui "https://github.com/anil2211/qubimall/tree/main/src/app/(auth)"
click node_authprovider "https://github.com/anil2211/qubimall/blob/main/src/components/providers/AuthProvider.tsx"
click node_authapi "https://github.com/anil2211/qubimall/tree/main/src/app/api/auth"
click node_authutils "https://github.com/anil2211/qubimall/blob/main/src/lib/auth/utils.ts"
click node_cartui "https://github.com/anil2211/qubimall/blob/main/src/app/checkout/page.tsx"
click node_cartstate "https://github.com/anil2211/qubimall/blob/main/src/lib/features/cart/cartSlice.ts"
click node_cartapi "https://github.com/anil2211/qubimall/tree/main/src/app/api/cart"
click node_orderapi "https://github.com/anil2211/qubimall/tree/main/src/app/api/orders"
click node_productapi "https://github.com/anil2211/qubimall/tree/main/src/app/api/products"
click node_dbconnect "https://github.com/anil2211/qubimall/blob/main/src/lib/db.ts"
click node_productmodel "https://github.com/anil2211/qubimall/blob/main/src/lib/models/product.ts"
click node_cartmodel "https://github.com/anil2211/qubimall/blob/main/src/lib/models/cart.ts"
click node_ordermodel "https://github.com/anil2211/qubimall/blob/main/src/lib/models/order.ts"
click node_usermodel "https://github.com/anil2211/qubimall/blob/main/src/lib/models/user.ts"

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_store,node_shop,node_productpage,node_catalogui,node_profile,node_wishlist,node_theme toneBlue
class node_authui,node_authprovider,node_authapi,node_authutils toneAmber
class node_cartui,node_cartstate,node_cartapi,node_orderapi,node_productapi toneMint
class node_dbconnect,node_mongo,node_productmodel,node_cartmodel,node_ordermodel,node_usermodel toneRose
class node_customer toneIndigo
```

## Components

### Storefront

- [Storefront pages](https://github.com/anil2211/qubimall/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Shop listings](https://github.com/anil2211/qubimall/tree/main/src/app/shops): `src/app/shops`
- [Product details](https://github.com/anil2211/qubimall/blob/main/src/app/products/%5Bslug%5D/page.tsx): `src/app/products/[slug]/page.tsx`
- [Catalog UI](https://github.com/anil2211/qubimall/tree/main/src/components): `src/components`
- [Profile and orders UI](https://github.com/anil2211/qubimall/tree/main/src/app/profile): `src/app/profile`
- [Wishlists](https://github.com/anil2211/qubimall/tree/main/src/app/profile/wishlists): `src/app/profile/wishlists`
- [Theme support](https://github.com/anil2211/qubimall/blob/main/src/components/ThemeProvider.tsx): `src/components/ThemeProvider.tsx`

### Identity

- [Login and registration](https://github.com/anil2211/qubimall/tree/main/src/app/(auth)): `src/app/(auth)`
- [Auth state](https://github.com/anil2211/qubimall/blob/main/src/components/providers/AuthProvider.tsx): `src/components/providers/AuthProvider.tsx`
- [Authentication API](https://github.com/anil2211/qubimall/tree/main/src/app/api/auth): `src/app/api/auth`
- [Token utilities](https://github.com/anil2211/qubimall/blob/main/src/lib/auth/utils.ts): `src/lib/auth/utils.ts`

### Commerce

- [Cart and checkout](https://github.com/anil2211/qubimall/blob/main/src/app/checkout/page.tsx): `src/app/checkout/page.tsx`
- [Cart state](https://github.com/anil2211/qubimall/blob/main/src/lib/features/cart/cartSlice.ts): `src/lib/features/cart/cartSlice.ts`
- [Cart API](https://github.com/anil2211/qubimall/tree/main/src/app/api/cart): `src/app/api/cart`
- [Orders API](https://github.com/anil2211/qubimall/tree/main/src/app/api/orders): `src/app/api/orders`
- [Product API](https://github.com/anil2211/qubimall/tree/main/src/app/api/products): `src/app/api/products`

### Data layer

- [Database connection](https://github.com/anil2211/qubimall/blob/main/src/lib/db.ts): `src/lib/db.ts`
- **MongoDB**
- [Product model](https://github.com/anil2211/qubimall/blob/main/src/lib/models/product.ts): `src/lib/models/product.ts`
- [Cart model](https://github.com/anil2211/qubimall/blob/main/src/lib/models/cart.ts): `src/lib/models/cart.ts`
- [Order model](https://github.com/anil2211/qubimall/blob/main/src/lib/models/order.ts): `src/lib/models/order.ts`
- [User model](https://github.com/anil2211/qubimall/blob/main/src/lib/models/user.ts): `src/lib/models/user.ts`

### Other components

- **Customer**

## Connections

- Customer → Storefront pages: browses
- Customer → Login and registration: signs in
- Customer → Cart and checkout: checks out
- Authentication API → Token utilities: creates tokens
- Authentication API → Database connection: connects
- Authentication API → User model: reads/writes users
- Product API → Database connection: connects
- Product API → Product model: queries products
- Cart API → Token utilities: requires auth
- Cart API → Database connection: connects
- Cart API → Cart model: reads/writes cart
- Cart API → Product model: looks up products
- Orders API → Token utilities: requires auth
- Orders API → Database connection: connects
- Orders API → Order model: reads/writes orders
- Orders API → Cart model: clears cart
- Orders API → Product model: looks up products
- Database connection → MongoDB: connects
