# jojo-valentine/product-management architecture

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

- Interactive diagram: https://gitdiagram.com/jojo-valentine/product-management
- Repository: https://github.com/jojo-valentine/product-management

## Overview

This is a product-management web application. Its main workflow is managing products and categories: users search/filter and page through records, create or edit products with category assignments and images, and manage status; requests pass through Next.js API proxies to Express controllers and persistent storage. The README also documents Redis caching and Swagger. The sampled source confirms representative product/category flows and cache behavior; some UI-to-proxy and image-service wiring is inferred only at the subsystem level from the tree and README.

Main entry points: [`server/src/controllers/productController.ts`](https://github.com/jojo-valentine/product-management/blob/main/server/src/controllers/productController.ts) (Product operations), [`server/src/server.ts`](https://github.com/jojo-valentine/product-management/blob/main/server/src/server.ts) (Express runtime), [`server/src/controllers/categoryController.ts`](https://github.com/jojo-valentine/product-management/blob/main/server/src/controllers/categoryController.ts) (Category operations), [`server/src/routes/index.ts`](https://github.com/jojo-valentine/product-management/blob/main/server/src/routes/index.ts) (API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_catalog_ui["Catalog pages<br/>[page.tsx]"]
  node_product_forms["Product forms<br/>[page.tsx]"]
  node_category_ui["Category pages<br/>[page.tsx]"]
  node_dashboard_ui["Dashboard<br/>[page.tsx]"]
  node_client_api["Next API proxies<br/>[route.ts]"]
  node_image_proxy["Image proxies<br/>[route.ts]"]
  node_category_proxy["Category proxies<br/>[route.ts]"]
  node_dashboard_proxy["Dashboard proxy<br/>[route.ts]"]
end

subgraph group_api["API and domain"]
  node_express["Express runtime<br/>[server.ts]"]
  node_routes["API routes<br/>[index.ts]"]
  node_product_controller["Product operations"]
  node_category_controller["Category operations"]
  node_dashboard_controller["Dashboard stats"]
  node_validation["Request validation<br/>[product.ts]"]
  node_category_service["Category lookup<br/>[CategoryService.ts]"]
  node_product_service["Product lookup<br/>[ProductService.ts]"]
  node_repository["Product queries"]
  node_resources["Response resources<br/>[ProductResource.ts]"]
  node_image_handling["Image handling"]
end

subgraph group_state["Persistence and cache"]
  node_models["Catalog models<br/>[Associations.ts]"]
  node_cache_service["Cache operations<br/>[CacheService.ts]"]
end

subgraph group_integrations["Runtime integrations"]
  node_mysql[("MySQL<br/>[database.ts]")]
  node_redis[("Redis<br/>[redis.ts]")]
  node_uploads[("Uploaded files")]
  node_swagger["API documentation<br/>[swagger.ts]"]
end

node_user(("Catalog manager"))

node_user -->|"browse catalog"| node_catalog_ui
node_user -->|"edit products"| node_product_forms
node_user -->|"manage categories"| node_category_ui
node_user -->|"view stats"| node_dashboard_ui
node_catalog_ui -->|"request products"| node_client_api
node_product_forms -->|"submit products"| node_client_api
node_product_forms -->|"upload images"| node_image_proxy
node_category_ui -->|"request categories"| node_category_proxy
node_dashboard_ui -->|"request stats"| node_dashboard_proxy
node_client_api -->|"forward requests"| node_express
node_image_proxy -->|"forward images"| node_express
node_category_proxy -->|"forward requests"| node_express
node_dashboard_proxy -->|"forward request"| node_express
node_express -->|"mount routes"| node_routes
node_routes -->|"dispatch product"| node_product_controller
node_routes -->|"dispatch category"| node_category_controller
node_routes -->|"dispatch stats"| node_dashboard_controller
node_product_controller -->|"validate input"| node_validation
node_product_controller -->|"resolve categories"| node_category_service
node_product_controller -->|"check product"| node_product_service
node_product_controller -->|"load relations"| node_repository
node_product_controller -->|"read and write"| node_models
node_category_controller -->|"check category"| node_category_service
node_category_controller -->|"read and write"| node_models
node_product_controller -->|"format response"| node_resources
node_category_controller -->|"format response"| node_resources
node_repository -->|"query relations"| node_models
node_models -->|"persist records"| node_mysql
node_product_controller -->|"update cache"| node_cache_service
node_category_controller -->|"update cache"| node_cache_service
node_cache_service -.->|"read and write"| node_redis
node_express -->|"configure docs"| node_swagger
node_image_handling -.->|"serve image files"| node_uploads

click node_catalog_ui "https://github.com/jojo-valentine/product-management/blob/main/client/app/(main)/products/page.tsx"
click node_product_forms "https://github.com/jojo-valentine/product-management/blob/main/client/app/(main)/products/create/page.tsx"
click node_category_ui "https://github.com/jojo-valentine/product-management/blob/main/client/app/(main)/categories/page.tsx"
click node_dashboard_ui "https://github.com/jojo-valentine/product-management/blob/main/client/app/(main)/page.tsx"
click node_client_api "https://github.com/jojo-valentine/product-management/blob/main/client/app/api/products/route.ts"
click node_image_proxy "https://github.com/jojo-valentine/product-management/blob/main/client/app/api/products/%5Bid%5D/images/route.ts"
click node_category_proxy "https://github.com/jojo-valentine/product-management/blob/main/client/app/api/categories/route.ts"
click node_dashboard_proxy "https://github.com/jojo-valentine/product-management/blob/main/client/app/api/dashboard/route.ts"
click node_express "https://github.com/jojo-valentine/product-management/blob/main/server/src/server.ts"
click node_routes "https://github.com/jojo-valentine/product-management/blob/main/server/src/routes/index.ts"
click node_product_controller "https://github.com/jojo-valentine/product-management/blob/main/server/src/controllers/productController.ts"
click node_category_controller "https://github.com/jojo-valentine/product-management/blob/main/server/src/controllers/categoryController.ts"
click node_dashboard_controller "https://github.com/jojo-valentine/product-management/blob/main/server/src/controllers/dashboardController.ts"
click node_validation "https://github.com/jojo-valentine/product-management/blob/main/server/src/validations/product.ts"
click node_category_service "https://github.com/jojo-valentine/product-management/blob/main/server/src/services/CategoryService.ts"
click node_product_service "https://github.com/jojo-valentine/product-management/blob/main/server/src/services/ProductService.ts"
click node_repository "https://github.com/jojo-valentine/product-management/blob/main/server/src/repositories/productRepository.ts"
click node_resources "https://github.com/jojo-valentine/product-management/blob/main/server/src/resources/ProductResource.ts"
click node_models "https://github.com/jojo-valentine/product-management/blob/main/server/src/models/Associations.ts"
click node_mysql "https://github.com/jojo-valentine/product-management/blob/main/server/src/config/database.ts"
click node_cache_service "https://github.com/jojo-valentine/product-management/blob/main/server/src/services/CacheService.ts"
click node_redis "https://github.com/jojo-valentine/product-management/blob/main/server/src/config/redis.ts"
click node_image_handling "https://github.com/jojo-valentine/product-management/blob/main/server/src/controllers/productController.ts"
click node_swagger "https://github.com/jojo-valentine/product-management/blob/main/server/src/config/swagger.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_ui,node_product_forms,node_category_ui,node_dashboard_ui,node_client_api,node_image_proxy,node_category_proxy,node_dashboard_proxy toneBlue
class node_express,node_routes,node_product_controller,node_category_controller,node_dashboard_controller,node_validation,node_category_service,node_product_service,node_repository,node_resources,node_image_handling toneAmber
class node_models,node_cache_service toneMint
class node_mysql,node_redis,node_uploads,node_swagger toneRose
class node_user toneIndigo
```

## Components

### Web client

- [Catalog pages](https://github.com/jojo-valentine/product-management/blob/main/client/app/(main)/products/page.tsx): `client/app/(main)/products/page.tsx`
- [Product forms](https://github.com/jojo-valentine/product-management/blob/main/client/app/(main)/products/create/page.tsx): `client/app/(main)/products/create/page.tsx`
- [Category pages](https://github.com/jojo-valentine/product-management/blob/main/client/app/(main)/categories/page.tsx): `client/app/(main)/categories/page.tsx`
- [Dashboard](https://github.com/jojo-valentine/product-management/blob/main/client/app/(main)/page.tsx): `client/app/(main)/page.tsx`
- [Next API proxies](https://github.com/jojo-valentine/product-management/blob/main/client/app/api/products/route.ts): `client/app/api/products/route.ts`
- [Image proxies](https://github.com/jojo-valentine/product-management/blob/main/client/app/api/products/%5Bid%5D/images/route.ts): `client/app/api/products/[id]/images/route.ts`
- [Category proxies](https://github.com/jojo-valentine/product-management/blob/main/client/app/api/categories/route.ts): `client/app/api/categories/route.ts`
- [Dashboard proxy](https://github.com/jojo-valentine/product-management/blob/main/client/app/api/dashboard/route.ts): `client/app/api/dashboard/route.ts`

### API and domain

- [Express runtime](https://github.com/jojo-valentine/product-management/blob/main/server/src/server.ts): `server/src/server.ts`
- [API routes](https://github.com/jojo-valentine/product-management/blob/main/server/src/routes/index.ts): `server/src/routes/index.ts`
- [Product operations](https://github.com/jojo-valentine/product-management/blob/main/server/src/controllers/productController.ts): `server/src/controllers/productController.ts`
- [Category operations](https://github.com/jojo-valentine/product-management/blob/main/server/src/controllers/categoryController.ts): `server/src/controllers/categoryController.ts`
- [Dashboard stats](https://github.com/jojo-valentine/product-management/blob/main/server/src/controllers/dashboardController.ts): `server/src/controllers/dashboardController.ts`
- [Request validation](https://github.com/jojo-valentine/product-management/blob/main/server/src/validations/product.ts): `server/src/validations/product.ts`
- [Category lookup](https://github.com/jojo-valentine/product-management/blob/main/server/src/services/CategoryService.ts): `server/src/services/CategoryService.ts`
- [Product lookup](https://github.com/jojo-valentine/product-management/blob/main/server/src/services/ProductService.ts): `server/src/services/ProductService.ts`
- [Product queries](https://github.com/jojo-valentine/product-management/blob/main/server/src/repositories/productRepository.ts): `server/src/repositories/productRepository.ts`
- [Response resources](https://github.com/jojo-valentine/product-management/blob/main/server/src/resources/ProductResource.ts): `server/src/resources/ProductResource.ts`
- [Image handling](https://github.com/jojo-valentine/product-management/blob/main/server/src/controllers/productController.ts): `server/src/controllers/productController.ts`

### Persistence and cache

- [Catalog models](https://github.com/jojo-valentine/product-management/blob/main/server/src/models/Associations.ts): `server/src/models/Associations.ts`
- [Cache operations](https://github.com/jojo-valentine/product-management/blob/main/server/src/services/CacheService.ts): `server/src/services/CacheService.ts`

### Runtime integrations

- [MySQL](https://github.com/jojo-valentine/product-management/blob/main/server/src/config/database.ts): `server/src/config/database.ts`
- [Redis](https://github.com/jojo-valentine/product-management/blob/main/server/src/config/redis.ts): `server/src/config/redis.ts`
- **Uploaded files**
- [API documentation](https://github.com/jojo-valentine/product-management/blob/main/server/src/config/swagger.ts): `server/src/config/swagger.ts`

### Other components

- **Catalog manager**

## Connections

- Catalog manager → Catalog pages: browse catalog
- Catalog manager → Product forms: edit products
- Catalog manager → Category pages: manage categories
- Catalog manager → Dashboard: view stats
- Catalog pages → Next API proxies: request products
- Product forms → Next API proxies: submit products
- Product forms → Image proxies: upload images
- Category pages → Category proxies: request categories
- Dashboard → Dashboard proxy: request stats
- Next API proxies → Express runtime: forward requests
- Image proxies → Express runtime: forward images
- Category proxies → Express runtime: forward requests
- Dashboard proxy → Express runtime: forward request
- Express runtime → API routes: mount routes
- API routes → Product operations: dispatch product
- API routes → Category operations: dispatch category
- API routes → Dashboard stats: dispatch stats
- Product operations → Request validation: validate input
- Product operations → Category lookup: resolve categories
- Product operations → Product lookup: check product
- Product operations → Product queries: load relations
- Product operations → Catalog models: read and write
- Category operations → Category lookup: check category
- Category operations → Catalog models: read and write
- Product operations → Response resources: format response
- Category operations → Response resources: format response
- Product queries → Catalog models: query relations
- Catalog models → MySQL: persist records
- Product operations → Cache operations: update cache
- Category operations → Cache operations: update cache
- Cache operations → Redis: read and write
- Express runtime → API documentation: configure docs
- Image handling → Uploaded files: serve image files
