# sohaali710/handmade-marketplace architecture

> Architecture diagram of the GitHub repository sohaali710/handmade-marketplace, 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/sohaali710/handmade-marketplace
- Repository: https://github.com/sohaali710/handmade-marketplace

## Overview

This NestJS API supports marketplace accounts, seller shops, product listings, category administration, and protected admin operations. The main workflow is registration/login, shop creation, product management, and public category browsing; product search/filtering and pagination are documented capabilities, but their implementation is not visible in the supplied files. The sampled controllers call their services, which use Prisma for persistence. No order or payment modules appear in the tree. Edges are limited to calls or wiring shown in excerpts, the source index, or README.

Main entry points: [`src/seller/seller.controller.ts`](https://github.com/sohaali710/handmade-marketplace/blob/master/src/seller/seller.controller.ts) (Shop API), [`src/product/product.controller.ts`](https://github.com/sohaali710/handmade-marketplace/blob/master/src/product/product.controller.ts) (Product API), [`prisma/prisma.service.ts`](https://github.com/sohaali710/handmade-marketplace/blob/master/prisma/prisma.service.ts) (PostgreSQL via Prisma), [`src/app.module.ts`](https://github.com/sohaali710/handmade-marketplace/blob/master/src/app.module.ts) (Nest application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity &amp; access"]
  node_auth_api["Authentication API<br/>[auth.controller.ts]"]
  node_auth_logic["Registration &amp; login<br/>[auth.service.ts]"]
  node_auth_guard["Auth guard<br/>[auth.guard.ts]"]
  node_roles_guard["Role authorization<br/>[roles.guard.ts]"]
end

subgraph group_catalog["Marketplace catalog"]
  node_seller_api["Shop API"]
  node_seller_logic["Shop management<br/>[seller.service.ts]"]
  node_product_api["Product API"]
  node_product_logic["Product listings<br/>[product.service.ts]"]
  node_category_api["Category API"]
  node_category_logic["Category management"]
  node_search["Search &amp; pagination"]
end

subgraph group_operations["Administration"]
  node_admin_api["Admin API"]
  node_admin_logic["Admin operations<br/>[admin.service.ts]"]
  node_admin_init["Admin initialization"]
end

subgraph group_platform["API platform"]
  node_database[("PostgreSQL via Prisma<br/>[prisma.service.ts]")]
  node_file_validation["Upload validation"]
  node_app["Nest application<br/>[app.module.ts]"]
end

node_user(("Marketplace user"))

node_user -->|"registers or logs in"| node_auth_api
node_auth_api -->|"calls"| node_auth_logic
node_auth_logic -->|"reads and writes users"| node_database
node_auth_logic -->|"returns token"| node_user
node_user -->|"manages shop"| node_seller_api
node_seller_api -->|"guards routes"| node_auth_guard
node_seller_api -->|"checks roles"| node_roles_guard
node_seller_api -->|"calls"| node_seller_logic
node_seller_api -->|"validates logo"| node_file_validation
node_seller_logic -->|"reads and writes shops"| node_database
node_user -->|"manages listings"| node_product_api
node_product_api -->|"guards routes"| node_auth_guard
node_product_api -->|"checks roles"| node_roles_guard
node_product_api -->|"calls"| node_product_logic
node_product_logic -->|"reads and writes listings"| node_database
node_user -->|"browses categories"| node_category_api
node_category_api -->|"calls"| node_category_logic
node_category_logic -->|"reads and writes categories"| node_database
node_category_api -->|"guards admin routes"| node_auth_guard
node_category_api -->|"checks admin role"| node_roles_guard
node_user -.->|"uses admin tools"| node_admin_api
node_admin_api -->|"calls"| node_admin_logic
node_admin_logic -.->|"persists admin data"| node_database
node_app -->|"registers module"| node_auth_api
node_app -->|"registers module"| node_seller_api
node_app -->|"registers module"| node_product_api
node_app -->|"registers module"| node_category_api
node_app -->|"registers module"| node_admin_api
node_product_api -.->|"capability documented"| node_search
node_admin_init -.->|"initializes admin"| node_database

click node_auth_api "https://github.com/sohaali710/handmade-marketplace/blob/master/src/auth/auth.controller.ts"
click node_auth_logic "https://github.com/sohaali710/handmade-marketplace/blob/master/src/auth/auth.service.ts"
click node_auth_guard "https://github.com/sohaali710/handmade-marketplace/blob/master/src/common/guards/auth/auth.guard.ts"
click node_roles_guard "https://github.com/sohaali710/handmade-marketplace/blob/master/src/common/guards/roles/roles.guard.ts"
click node_seller_api "https://github.com/sohaali710/handmade-marketplace/blob/master/src/seller/seller.controller.ts"
click node_seller_logic "https://github.com/sohaali710/handmade-marketplace/blob/master/src/seller/seller.service.ts"
click node_product_api "https://github.com/sohaali710/handmade-marketplace/blob/master/src/product/product.controller.ts"
click node_product_logic "https://github.com/sohaali710/handmade-marketplace/blob/master/src/product/product.service.ts"
click node_category_api "https://github.com/sohaali710/handmade-marketplace/blob/master/src/category/category.controller.ts"
click node_category_logic "https://github.com/sohaali710/handmade-marketplace/blob/master/src/category/category.service.ts"
click node_search "https://github.com/sohaali710/handmade-marketplace/tree/master/src/product"
click node_admin_api "https://github.com/sohaali710/handmade-marketplace/blob/master/src/admin/admin.controller.ts"
click node_admin_logic "https://github.com/sohaali710/handmade-marketplace/blob/master/src/admin/admin.service.ts"
click node_admin_init "https://github.com/sohaali710/handmade-marketplace/blob/master/src/admin/admin-initializer.service.ts"
click node_database "https://github.com/sohaali710/handmade-marketplace/blob/master/prisma/prisma.service.ts"
click node_file_validation "https://github.com/sohaali710/handmade-marketplace/blob/master/src/common/validators/files/files-validation-factory.ts"
click node_app "https://github.com/sohaali710/handmade-marketplace/blob/master/src/app.module.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_auth_api,node_auth_logic,node_auth_guard,node_roles_guard,node_user toneBlue
class node_seller_api,node_seller_logic,node_product_api,node_product_logic,node_category_api,node_category_logic,node_search toneAmber
class node_admin_api,node_admin_logic,node_admin_init toneMint
class node_database,node_file_validation,node_app toneRose
```

## Components

### Identity & access

- [Authentication API](https://github.com/sohaali710/handmade-marketplace/blob/master/src/auth/auth.controller.ts): `src/auth/auth.controller.ts`
- [Registration & login](https://github.com/sohaali710/handmade-marketplace/blob/master/src/auth/auth.service.ts): `src/auth/auth.service.ts`
- [Auth guard](https://github.com/sohaali710/handmade-marketplace/blob/master/src/common/guards/auth/auth.guard.ts): `src/common/guards/auth/auth.guard.ts`
- [Role authorization](https://github.com/sohaali710/handmade-marketplace/blob/master/src/common/guards/roles/roles.guard.ts): `src/common/guards/roles/roles.guard.ts`

### Marketplace catalog

- [Shop API](https://github.com/sohaali710/handmade-marketplace/blob/master/src/seller/seller.controller.ts): `src/seller/seller.controller.ts`
- [Shop management](https://github.com/sohaali710/handmade-marketplace/blob/master/src/seller/seller.service.ts): `src/seller/seller.service.ts`
- [Product API](https://github.com/sohaali710/handmade-marketplace/blob/master/src/product/product.controller.ts): `src/product/product.controller.ts`
- [Product listings](https://github.com/sohaali710/handmade-marketplace/blob/master/src/product/product.service.ts): `src/product/product.service.ts`
- [Category API](https://github.com/sohaali710/handmade-marketplace/blob/master/src/category/category.controller.ts): `src/category/category.controller.ts`
- [Category management](https://github.com/sohaali710/handmade-marketplace/blob/master/src/category/category.service.ts): `src/category/category.service.ts`
- [Search & pagination](https://github.com/sohaali710/handmade-marketplace/tree/master/src/product): `src/product`

### Administration

- [Admin API](https://github.com/sohaali710/handmade-marketplace/blob/master/src/admin/admin.controller.ts): `src/admin/admin.controller.ts`
- [Admin operations](https://github.com/sohaali710/handmade-marketplace/blob/master/src/admin/admin.service.ts): `src/admin/admin.service.ts`
- [Admin initialization](https://github.com/sohaali710/handmade-marketplace/blob/master/src/admin/admin-initializer.service.ts): `src/admin/admin-initializer.service.ts`

### API platform

- [PostgreSQL via Prisma](https://github.com/sohaali710/handmade-marketplace/blob/master/prisma/prisma.service.ts): `prisma/prisma.service.ts`
- [Upload validation](https://github.com/sohaali710/handmade-marketplace/blob/master/src/common/validators/files/files-validation-factory.ts): `src/common/validators/files/files-validation-factory.ts`
- [Nest application](https://github.com/sohaali710/handmade-marketplace/blob/master/src/app.module.ts): `src/app.module.ts`

### Other components

- **Marketplace user**

## Connections

- Marketplace user → Authentication API: registers or logs in (evidence: `src/auth/auth.controller.ts`)
- Authentication API → Registration & login: calls (evidence: `src/auth/auth.controller.ts`)
- Registration & login → PostgreSQL via Prisma: reads and writes users (evidence: `src/auth/auth.service.ts`)
- Registration & login → Marketplace user: returns token (evidence: `src/auth/auth.service.ts`)
- Marketplace user → Shop API: manages shop (evidence: `src/seller/seller.controller.ts`)
- Shop API → Auth guard: guards routes (evidence: `src/seller/seller.controller.ts`)
- Shop API → Role authorization: checks roles (evidence: `src/seller/seller.controller.ts`)
- Shop API → Shop management: calls (evidence: `src/seller/seller.controller.ts`)
- Shop API → Upload validation: validates logo (evidence: `src/seller/seller.controller.ts`)
- Shop management → PostgreSQL via Prisma: reads and writes shops (evidence: `src/seller/seller.service.ts`)
- Marketplace user → Product API: manages listings (evidence: `src/product/product.controller.ts`)
- Product API → Auth guard: guards routes (evidence: `src/product/product.controller.ts`)
- Product API → Role authorization: checks roles (evidence: `src/product/product.controller.ts`)
- Product API → Product listings: calls (evidence: `src/product/product.controller.ts`)
- Product listings → PostgreSQL via Prisma: reads and writes listings (evidence: `src/product/product.service.ts`)
- Marketplace user → Category API: browses categories (evidence: `src/category/category.controller.ts`)
- Category API → Category management: calls (evidence: `src/category/category.controller.ts`)
- Category management → PostgreSQL via Prisma: reads and writes categories (evidence: `src/category/category.service.ts`)
- Category API → Auth guard: guards admin routes (evidence: `src/category/category.controller.ts`)
- Category API → Role authorization: checks admin role (evidence: `src/category/category.controller.ts`)
- Marketplace user → Admin API: uses admin tools (evidence: `README.md`)
- Admin API → Admin operations: calls (evidence: `src/admin/admin.controller.ts`)
- Admin operations → PostgreSQL via Prisma: persists admin data
- Nest application → Authentication API: registers module (evidence: `src/app.module.ts`)
- Nest application → Shop API: registers module (evidence: `src/app.module.ts`)
- Nest application → Product API: registers module (evidence: `src/app.module.ts`)
- Nest application → Category API: registers module (evidence: `src/app.module.ts`)
- Nest application → Admin API: registers module (evidence: `src/app.module.ts`)
- Product API → Search & pagination: capability documented (evidence: `README.md`)
- Admin initialization → PostgreSQL via Prisma: initializes admin
