# donavfulish/autionweb_finalproject_ptudw architecture

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

- Interactive diagram: https://gitdiagram.com/donavfulish/autionweb_finalproject_ptudw
- Repository: https://github.com/donavfulish/autionweb_finalproject_ptudw

## Overview

Aution Web is a full-stack auction marketplace: buyers browse listings, inspect products, bid and track orders, while sellers manage listings and fulfill sales; an admin app manages marketplace data and users. The client’s product page explicitly uses bid history, questions and related-product components, and its product hooks call product services. The Express backend provides domain controllers and services, with authentication and scheduled auction-expiry work among the documented source modules. README identifies PostgreSQL and the client/server stack. Many domain pages and backend routes are listed but unsampled, so their links are omitted or marked unverified.

Main entry points: [`client/app/(MainLayout)/product/[product_slug]/page.tsx`](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/%5Bproduct_slug%5D/page.tsx) (Product details), [`server/src/controllers/ProductController.ts`](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/controllers/ProductController.ts) (Product controller), [`shared/src/api/index.ts`](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/shared/src/api/index.ts) (API route definitions), [`client/hooks/useProduct.ts`](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/hooks/useProduct.ts) (Product data hooks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_marketplace["Marketplace browsing"]
  node_catalog["Browse and search<br/>[page.tsx]"]
  node_product_detail["Product details<br/>[page.tsx]"]
  node_bid_history["Bid history<br/>[BidHistory.tsx]"]
  node_questions["Product questions<br/>[Question.tsx]"]
  node_related_products["Related products"]
  node_product_hooks["Product data hooks<br/>[useProduct.ts]"]
  node_product_service["Product API client<br/>[ProductService.ts]"]
end

subgraph group_accounts["Accounts and administration"]
  node_account_portal["Account and selling<br/>[page.tsx]"]
  node_admin_portal["Admin management<br/>[page.tsx]"]
  node_admin_product_hooks["Admin product hooks<br/>[useProduct.ts]"]
  node_admin_product_service["Admin product API client<br/>[ProductService.ts]"]
end

subgraph group_transactions["Auction transactions"]
  node_order_tracking["Buyer order tracking<br/>[page.tsx]"]
  node_seller_fulfillment["Seller order fulfillment<br/>[page.tsx]"]
end

subgraph group_backend["Backend services"]
  node_express_app["Express application<br/>[server.ts]"]
  node_product_controller["Product controller"]
  node_product_backend["Product domain service<br/>[ProductService.ts]"]
  node_auth_controller["Authentication controller<br/>[AuthController.ts]"]
  node_auth_service["Authentication service<br/>[AuthService.ts]"]
  node_auction_cron["Auction expiry job"]
  node_mailer["Email delivery<br/>[mailer.ts]"]
  node_database[("PostgreSQL database<br/>[db.ts]")]
end

subgraph group_contracts["Shared contracts"]
  node_api_routes["API route definitions<br/>[index.ts]"]
  node_shared_types["Domain types<br/>[index.ts]"]
end

node_visitor(("Marketplace user"))

node_visitor -->|"browses"| node_catalog
node_visitor -->|"opens listing"| node_product_detail
node_product_detail -->|"renders"| node_bid_history
node_product_detail -->|"renders"| node_questions
node_product_detail -->|"renders"| node_related_products
node_product_hooks -->|"calls"| node_product_service
node_visitor -.->|"manages listings"| node_account_portal
node_visitor -.->|"tracks purchase"| node_order_tracking
node_visitor -.->|"fulfills sale"| node_seller_fulfillment
node_admin_portal -.->|"manages products"| node_admin_product_hooks
node_admin_product_hooks -->|"calls"| node_admin_product_service
node_product_service -->|"uses routes"| node_api_routes
node_admin_product_service -->|"uses routes"| node_api_routes
node_api_routes -.->|"targets API"| node_express_app
node_express_app -.->|"dispatches"| node_product_controller
node_product_controller -->|"delegates"| node_product_backend
node_auth_controller -->|"delegates"| node_auth_service
node_auth_service -.->|"queries via base service"| node_database
node_auction_cron -->|"checks expiry"| node_database
node_auction_cron -->|"sends notices"| node_mailer
node_auth_controller -->|"sends OTP email"| node_mailer
node_product_controller -->|"uses types"| node_shared_types
node_product_hooks -->|"uses types"| node_shared_types

click node_catalog "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/(sidebar-category)/page.tsx"
click node_product_detail "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/%5Bproduct_slug%5D/page.tsx"
click node_bid_history "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/%5Bproduct_slug%5D/components/BidHistory.tsx"
click node_questions "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/%5Bproduct_slug%5D/components/Question.tsx"
click node_related_products "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/%5Bproduct_slug%5D/components/RelatedProducts.tsx"
click node_product_hooks "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/hooks/useProduct.ts"
click node_product_service "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/services/ProductService.ts"
click node_account_portal "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/user/selling_products/create/page.tsx"
click node_order_tracking "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/order/%5Bproduct_id%5D/page.tsx"
click node_seller_fulfillment "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/sell/order/%5Bproduct_id%5D/page.tsx"
click node_admin_portal "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/admin/app/(MainLayout)/page.tsx"
click node_admin_product_hooks "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/admin/hooks/useProduct.ts"
click node_admin_product_service "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/admin/services/ProductService.ts"
click node_api_routes "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/shared/src/api/index.ts"
click node_express_app "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/server.ts"
click node_product_controller "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/controllers/ProductController.ts"
click node_product_backend "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/services/ProductService.ts"
click node_auth_controller "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/controllers/AuthController.ts"
click node_auth_service "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/services/AuthService.ts"
click node_auction_cron "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/cron/checkEndTimeProduct.ts"
click node_mailer "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/utils/mailer.ts"
click node_database "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/config/db.ts"
click node_shared_types "https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/shared/src/types/index.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_catalog,node_product_detail,node_bid_history,node_questions,node_related_products,node_product_hooks,node_product_service,node_visitor toneBlue
class node_account_portal,node_admin_portal,node_admin_product_hooks,node_admin_product_service toneAmber
class node_order_tracking,node_seller_fulfillment toneMint
class node_express_app,node_product_controller,node_product_backend,node_auth_controller,node_auth_service,node_auction_cron,node_mailer,node_database toneRose
class node_api_routes,node_shared_types toneIndigo
```

## Components

### Marketplace browsing

- [Browse and search](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/(sidebar-category)/page.tsx): `client/app/(MainLayout)/(sidebar-category)/page.tsx`
- [Product details](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/%5Bproduct_slug%5D/page.tsx): `client/app/(MainLayout)/product/[product_slug]/page.tsx`
- [Bid history](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/%5Bproduct_slug%5D/components/BidHistory.tsx): `client/app/(MainLayout)/product/[product_slug]/components/BidHistory.tsx`
- [Product questions](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/%5Bproduct_slug%5D/components/Question.tsx): `client/app/(MainLayout)/product/[product_slug]/components/Question.tsx`
- [Related products](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/%5Bproduct_slug%5D/components/RelatedProducts.tsx): `client/app/(MainLayout)/product/[product_slug]/components/RelatedProducts.tsx`
- [Product data hooks](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/hooks/useProduct.ts): `client/hooks/useProduct.ts`
- [Product API client](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/services/ProductService.ts): `client/services/ProductService.ts`

### Accounts and administration

- [Account and selling](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/user/selling_products/create/page.tsx): `client/app/(MainLayout)/user/selling_products/create/page.tsx`
- [Admin management](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/admin/app/(MainLayout)/page.tsx): `admin/app/(MainLayout)/page.tsx`
- [Admin product hooks](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/admin/hooks/useProduct.ts): `admin/hooks/useProduct.ts`
- [Admin product API client](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/admin/services/ProductService.ts): `admin/services/ProductService.ts`

### Auction transactions

- [Buyer order tracking](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/order/%5Bproduct_id%5D/page.tsx): `client/app/(MainLayout)/product/order/[product_id]/page.tsx`
- [Seller order fulfillment](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/client/app/(MainLayout)/product/sell/order/%5Bproduct_id%5D/page.tsx): `client/app/(MainLayout)/product/sell/order/[product_id]/page.tsx`

### Backend services

- [Express application](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/server.ts): `server/src/server.ts`
- [Product controller](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/controllers/ProductController.ts): `server/src/controllers/ProductController.ts`
- [Product domain service](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/services/ProductService.ts): `server/src/services/ProductService.ts`
- [Authentication controller](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/controllers/AuthController.ts): `server/src/controllers/AuthController.ts`
- [Authentication service](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/services/AuthService.ts): `server/src/services/AuthService.ts`
- [Auction expiry job](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/cron/checkEndTimeProduct.ts): `server/src/cron/checkEndTimeProduct.ts`
- [Email delivery](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/utils/mailer.ts): `server/src/utils/mailer.ts`
- [PostgreSQL database](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/server/src/config/db.ts): `server/src/config/db.ts`

### Shared contracts

- [API route definitions](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/shared/src/api/index.ts): `shared/src/api/index.ts`
- [Domain types](https://github.com/donavfulish/autionweb_finalproject_ptudw/blob/main/shared/src/types/index.ts): `shared/src/types/index.ts`

### Other components

- **Marketplace user**

## Connections

- Marketplace user → Browse and search: browses
- Marketplace user → Product details: opens listing
- Product details → Bid history: renders (evidence: `client/app/(MainLayout)/product/[product_slug]/page.tsx`)
- Product details → Product questions: renders (evidence: `client/app/(MainLayout)/product/[product_slug]/page.tsx`)
- Product details → Related products: renders (evidence: `client/app/(MainLayout)/product/[product_slug]/page.tsx`)
- Product data hooks → Product API client: calls (evidence: `client/hooks/useProduct.ts`)
- Marketplace user → Account and selling: manages listings
- Marketplace user → Buyer order tracking: tracks purchase
- Marketplace user → Seller order fulfillment: fulfills sale
- Admin management → Admin product hooks: manages products
- Admin product hooks → Admin product API client: calls (evidence: `admin/hooks/useProduct.ts`)
- Product API client → API route definitions: uses routes (evidence: `client/services/ProductService.ts`)
- Admin product API client → API route definitions: uses routes (evidence: `admin/services/ProductService.ts`)
- API route definitions → Express application: targets API
- Express application → Product controller: dispatches
- Product controller → Product domain service: delegates (evidence: `server/src/controllers/ProductController.ts`)
- Authentication controller → Authentication service: delegates (evidence: `server/src/controllers/AuthController.ts`)
- Authentication service → PostgreSQL database: queries via base service
- Auction expiry job → PostgreSQL database: checks expiry (evidence: `server/src/cron/checkEndTimeProduct.ts`)
- Auction expiry job → Email delivery: sends notices (evidence: `server/src/cron/checkEndTimeProduct.ts`)
- Authentication controller → Email delivery: sends OTP email (evidence: `server/src/controllers/AuthController.ts`)
- Product controller → Domain types: uses types (evidence: `server/src/controllers/ProductController.ts`)
- Product data hooks → Domain types: uses types (evidence: `client/hooks/useProduct.ts`)
