# xxmazenxx21/taha_supplier architecture

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

- Interactive diagram: https://gitdiagram.com/xxmazenxx21/taha_supplier
- Repository: https://github.com/xxmazenxx21/taha_supplier

## Overview

This is a NestJS commerce backend. Clients and administrators call HTTP controllers, which delegate domain operations to services; those services query PostgreSQL through Prisma and handle uploads or notification behavior where shown. The graph preserves the main commerce stages and the broader catalog, account, promotion, and operational capabilities visible in the source tree. Several service implementations and application wiring were not sampled, so those links are omitted rather than inferred.

Main entry points: [`src/prisma/prisma.service.ts`](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/prisma/prisma.service.ts) (PostgreSQL via Prisma), [`src/product/product.controller.ts`](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/product/product.controller.ts) (Product API), [`src/order/order.service.ts`](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/order/order.service.ts) (Order checkout), [`src/utils/multer/multer.ts`](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/utils/multer/multer.ts) (Upload handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["HTTP and identity"]
  node_app_api["Home API<br/>[app.controller.ts]"]
  node_auth_api["Authentication API<br/>[auth.controller.ts]"]
  node_auth_service["Authentication<br/>[auth.service.ts]"]
end

subgraph group_catalog["Catalog and discovery"]
  node_product_api["Product API"]
  node_products["Product catalog<br/>[product.service.ts]"]
  node_categories["Categories"]
  node_subcategories["Subcategories"]
  node_brands["Brands<br/>[brand.service.ts]"]
  node_banners["Banners<br/>[banner.service.ts]"]
  node_home["Home composition<br/>[app.service.ts]"]
end

subgraph group_commerce["Shopping and orders"]
  node_cart["Cart<br/>[cart.service.ts]"]
  node_orders["Order checkout<br/>[order.service.ts]"]
  node_order_admin["Order administration"]
  node_coupon["Coupons<br/>[coupon.service.ts]"]
  node_shipping["Shipping zones"]
end

subgraph group_accounts["Accounts and engagement"]
  node_reviews["Product reviews<br/>[review.service.ts]"]
  node_customers["Customer management"]
  node_profile["User profile<br/>[profile.service.ts]"]
  node_notifications["Notifications"]
end

subgraph group_infra["Persistence and files"]
  node_database[("PostgreSQL via Prisma<br/>[prisma.service.ts]")]
  node_uploads["Upload handling<br/>[multer.ts]"]
end

node_client(("Client"))
node_admin(("Administrator"))

node_client -->|"requests home"| node_app_api
node_client -->|"authenticates"| node_auth_api
node_client -->|"browses"| node_product_api
node_admin -->|"manages catalog"| node_product_api
node_product_api -->|"delegates to"| node_products
node_product_api -->|"configures images"| node_uploads
node_app_api -->|"delegates to"| node_home
node_auth_api -->|"delegates to"| node_auth_service
node_auth_service -->|"reads and writes"| node_database
node_auth_service -.->|"uses password hashing"| node_uploads
node_home -->|"queries home data"| node_database
node_products -->|"queries catalog"| node_database
node_categories -.->|"persists categories"| node_database
node_subcategories -.->|"persists subcategories"| node_database
node_brands -->|"persists brands"| node_database
node_brands -->|"resolves image paths"| node_uploads
node_banners -->|"queries banners"| node_database
node_cart -.->|"reads and writes"| node_database
node_orders -->|"transacts orders"| node_database
node_orders -->|"checks coupons"| node_coupon
node_orders -->|"invokes notifications"| node_notifications
node_orders -->|"handles payment proofs"| node_uploads
node_order_admin -.->|"manages orders"| node_database
node_coupon -->|"reads and writes"| node_database
node_shipping -.->|"persists zones"| node_database
node_reviews -->|"stores and rates"| node_database
node_customers -.->|"manages customers"| node_database
node_profile -.->|"updates profile"| node_database
node_notifications -->|"reads recipients"| node_database
node_product_api -.->|"not shown"| node_reviews

click node_app_api "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/app.controller.ts"
click node_auth_api "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/auth/auth.controller.ts"
click node_auth_service "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/auth/auth.service.ts"
click node_product_api "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/product/product.controller.ts"
click node_products "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/product/product.service.ts"
click node_categories "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/category/category.service.ts"
click node_subcategories "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/sub-category/sub-category.service.ts"
click node_brands "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/brand/brand.service.ts"
click node_banners "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/banner/banner.service.ts"
click node_home "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/app.service.ts"
click node_cart "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/cart/cart.service.ts"
click node_orders "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/order/order.service.ts"
click node_order_admin "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/order/order-admin.service.ts"
click node_coupon "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/coupon/coupon.service.ts"
click node_shipping "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/shipping-zone/shipping-zone.service.ts"
click node_reviews "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/review/review.service.ts"
click node_customers "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/customers/customers.service.ts"
click node_profile "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/profile/profile.service.ts"
click node_notifications "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/notification/notification.service.ts"
click node_database "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/prisma/prisma.service.ts"
click node_uploads "https://github.com/xxmazenxx21/taha_supplier/blob/main/src/utils/multer/multer.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_app_api,node_auth_api,node_auth_service,node_client toneBlue
class node_product_api,node_products,node_categories,node_subcategories,node_brands,node_banners,node_home toneAmber
class node_cart,node_orders,node_order_admin,node_coupon,node_shipping toneMint
class node_reviews,node_customers,node_profile,node_notifications toneRose
class node_database,node_uploads,node_admin toneIndigo
```

## Components

### HTTP and identity

- [Home API](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/app.controller.ts): `src/app.controller.ts`
- [Authentication API](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/auth/auth.controller.ts): `src/auth/auth.controller.ts`
- [Authentication](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/auth/auth.service.ts): `src/auth/auth.service.ts`

### Catalog and discovery

- [Product API](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/product/product.controller.ts): `src/product/product.controller.ts`
- [Product catalog](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/product/product.service.ts): `src/product/product.service.ts`
- [Categories](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/category/category.service.ts): `src/category/category.service.ts`
- [Subcategories](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/sub-category/sub-category.service.ts): `src/sub-category/sub-category.service.ts`
- [Brands](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/brand/brand.service.ts): `src/brand/brand.service.ts`
- [Banners](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/banner/banner.service.ts): `src/banner/banner.service.ts`
- [Home composition](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/app.service.ts): `src/app.service.ts`

### Shopping and orders

- [Cart](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/cart/cart.service.ts): `src/cart/cart.service.ts`
- [Order checkout](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/order/order.service.ts): `src/order/order.service.ts`
- [Order administration](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/order/order-admin.service.ts): `src/order/order-admin.service.ts`
- [Coupons](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/coupon/coupon.service.ts): `src/coupon/coupon.service.ts`
- [Shipping zones](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/shipping-zone/shipping-zone.service.ts): `src/shipping-zone/shipping-zone.service.ts`

### Accounts and engagement

- [Product reviews](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/review/review.service.ts): `src/review/review.service.ts`
- [Customer management](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/customers/customers.service.ts): `src/customers/customers.service.ts`
- [User profile](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/profile/profile.service.ts): `src/profile/profile.service.ts`
- [Notifications](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/notification/notification.service.ts): `src/notification/notification.service.ts`

### Persistence and files

- [PostgreSQL via Prisma](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/prisma/prisma.service.ts): `src/prisma/prisma.service.ts`
- [Upload handling](https://github.com/xxmazenxx21/taha_supplier/blob/main/src/utils/multer/multer.ts): `src/utils/multer/multer.ts`

### Other components

- **Client**
- **Administrator**

## Connections

- Client → Home API: requests home (evidence: `src/app.controller.ts`)
- Client → Authentication API: authenticates (evidence: `src/auth/auth.controller.ts`)
- Client → Product API: browses (evidence: `src/product/product.controller.ts`)
- Administrator → Product API: manages catalog (evidence: `src/product/product.controller.ts`)
- Product API → Product catalog: delegates to (evidence: `src/product/product.controller.ts`)
- Product API → Upload handling: configures images (evidence: `src/product/product.controller.ts`)
- Home API → Home composition: delegates to (evidence: `src/app.controller.ts`)
- Authentication API → Authentication: delegates to (evidence: `src/auth/auth.controller.ts`)
- Authentication → PostgreSQL via Prisma: reads and writes (evidence: `src/auth/auth.service.ts`)
- Authentication → Upload handling: uses password hashing
- Home composition → PostgreSQL via Prisma: queries home data (evidence: `src/app.service.ts`)
- Product catalog → PostgreSQL via Prisma: queries catalog (evidence: `src/product/product.service.ts`)
- Categories → PostgreSQL via Prisma: persists categories
- Subcategories → PostgreSQL via Prisma: persists subcategories
- Brands → PostgreSQL via Prisma: persists brands (evidence: `src/brand/brand.service.ts`)
- Brands → Upload handling: resolves image paths (evidence: `src/brand/brand.service.ts`)
- Banners → PostgreSQL via Prisma: queries banners (evidence: `src/banner/banner.service.ts`)
- Cart → PostgreSQL via Prisma: reads and writes
- Order checkout → PostgreSQL via Prisma: transacts orders (evidence: `src/order/order.service.ts`)
- Order checkout → Coupons: checks coupons (evidence: `src/order/order.service.ts`)
- Order checkout → Notifications: invokes notifications (evidence: `src/order/order.service.ts`)
- Order checkout → Upload handling: handles payment proofs (evidence: `src/order/order.controller.ts`)
- Order administration → PostgreSQL via Prisma: manages orders
- Coupons → PostgreSQL via Prisma: reads and writes (evidence: `src/coupon/coupon.service.ts`)
- Shipping zones → PostgreSQL via Prisma: persists zones
- Product reviews → PostgreSQL via Prisma: stores and rates (evidence: `src/review/review.service.ts`)
- Customer management → PostgreSQL via Prisma: manages customers
- User profile → PostgreSQL via Prisma: updates profile
- Notifications → PostgreSQL via Prisma: reads recipients (evidence: `src/notification/notification.service.ts`)
- Product API → Product reviews: not shown
