# sonubth83/wherehouse-logistic architecture

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

- Interactive diagram: https://gitdiagram.com/sonubth83/wherehouse-logistic
- Repository: https://github.com/sonubth83/wherehouse-logistic

## Overview

This is a Spring MVC product-and-category catalog with server-rendered pages and a product REST API. Users register categories, then register products (including an uploaded file and category), browse products with session-backed paging, or delete them; REST clients can list, save, and remove products. Controllers delegate to service implementations, which delegate to DAO implementations, with JPA entities representing catalog data. The excerpts establish these routes and calls; the database connection is shown only as an unverified persistence relationship because no DAO implementation excerpt is available.

Main entry points: [`src/main/java/in/nit/controller/ProductTypeController.java`](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/controller/ProductTypeController.java) (Product controller), [`src/main/java/in/nit/controller/CategoryController.java`](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/controller/CategoryController.java) (Category controller), [`src/main/java/in/nit/dao/impl/CategoryDaoImpl.java`](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/dao/impl/CategoryDaoImpl.java) (Category DAO), [`src/main/java/in/nit/dao/impl/ProductDaoImpl.java`](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/dao/impl/ProductDaoImpl.java) (Product DAO)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interfaces"]
  node_categorycontroller["Category controller"]
  node_productcontroller["Product controller"]
  node_restcontroller["Product REST API"]
  node_categoryview["Category form"]
  node_productform["Product form"]
  node_productlist["Product listing<br/>[ProductData.jsp]"]
  node_appconfig["Spring configuration<br/>[AppConfig.java]"]
  node_appinit["Application initializer<br/>[AppInit.java]"]
end

subgraph group_services["Business services"]
  node_categoryservice["Category service"]
  node_productservice["Product service"]
  node_commonutil["Category map helper<br/>[CommonUtil.java]"]
end

subgraph group_persistence["Persistence"]
  node_categorydao["Category DAO"]
  node_productdao["Product DAO"]
  node_database[("Catalog database")]
end

subgraph group_domain["Catalog domain"]
  node_category["Category entity<br/>[Category.java]"]
  node_product["Product entity<br/>[Product.java]"]
end

node_user(("Catalog user"))
node_restclient(("REST client"))

node_user -->|"submits category"| node_categorycontroller
node_user -->|"uses catalog"| node_productcontroller
node_restclient -->|"calls endpoints"| node_restcontroller
node_categorycontroller -->|"delegates"| node_categoryservice
node_productcontroller -->|"delegates"| node_productservice
node_productcontroller -->|"loads categories"| node_categoryservice
node_productcontroller -->|"converts categories"| node_commonutil
node_restcontroller -->|"delegates"| node_productservice
node_categorycontroller -->|"renders"| node_categoryview
node_productcontroller -->|"renders"| node_productform
node_productcontroller -->|"renders"| node_productlist
node_categoryservice -->|"delegates"| node_categorydao
node_productservice -->|"delegates"| node_productdao
node_categorydao -->|"persists"| node_category
node_productdao -->|"persists"| node_product
node_product -->|"references"| node_category
node_categorydao -.->|"reads and writes"| node_database
node_productdao -.->|"reads and writes"| node_database
node_appinit -->|"initializes"| node_appconfig

click node_categorycontroller "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/controller/CategoryController.java"
click node_productcontroller "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/controller/ProductTypeController.java"
click node_restcontroller "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/controller/rest/ProductTypeControllerRest.java"
click node_categoryview "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/webapp/WEB-INF/views/CategoryRegister.jsp"
click node_productform "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/webapp/WEB-INF/views/ProductRegistration.jsp"
click node_productlist "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/webapp/WEB-INF/views/ProductData.jsp"
click node_categoryservice "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/service/impl/CategoryServiceImpl.java"
click node_productservice "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/service/impl/ProductServiceImpl.java"
click node_commonutil "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/util/CommonUtil.java"
click node_categorydao "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/dao/impl/CategoryDaoImpl.java"
click node_productdao "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/dao/impl/ProductDaoImpl.java"
click node_category "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/model/Category.java"
click node_product "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/model/Product.java"
click node_appconfig "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/config/AppConfig.java"
click node_appinit "https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/init/AppInit.java"

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_categorycontroller,node_productcontroller,node_restcontroller,node_categoryview,node_productform,node_productlist,node_appconfig,node_appinit,node_user,node_restclient toneBlue
class node_categoryservice,node_productservice,node_commonutil toneAmber
class node_categorydao,node_productdao,node_database toneMint
class node_category,node_product toneRose
```

## Components

### Web interfaces

- [Category controller](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/controller/CategoryController.java): `src/main/java/in/nit/controller/CategoryController.java`
- [Product controller](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/controller/ProductTypeController.java): `src/main/java/in/nit/controller/ProductTypeController.java`
- [Product REST API](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/controller/rest/ProductTypeControllerRest.java): `src/main/java/in/nit/controller/rest/ProductTypeControllerRest.java`
- [Category form](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/webapp/WEB-INF/views/CategoryRegister.jsp): `src/main/webapp/WEB-INF/views/CategoryRegister.jsp`
- [Product form](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/webapp/WEB-INF/views/ProductRegistration.jsp): `src/main/webapp/WEB-INF/views/ProductRegistration.jsp`
- [Product listing](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/webapp/WEB-INF/views/ProductData.jsp): `src/main/webapp/WEB-INF/views/ProductData.jsp`
- [Spring configuration](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/config/AppConfig.java): `src/main/java/in/nit/config/AppConfig.java`
- [Application initializer](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/init/AppInit.java): `src/main/java/in/nit/init/AppInit.java`

### Business services

- [Category service](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/service/impl/CategoryServiceImpl.java): `src/main/java/in/nit/service/impl/CategoryServiceImpl.java`
- [Product service](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/service/impl/ProductServiceImpl.java): `src/main/java/in/nit/service/impl/ProductServiceImpl.java`
- [Category map helper](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/util/CommonUtil.java): `src/main/java/in/nit/util/CommonUtil.java`

### Persistence

- [Category DAO](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/dao/impl/CategoryDaoImpl.java): `src/main/java/in/nit/dao/impl/CategoryDaoImpl.java`
- [Product DAO](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/dao/impl/ProductDaoImpl.java): `src/main/java/in/nit/dao/impl/ProductDaoImpl.java`
- **Catalog database**

### Catalog domain

- [Category entity](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/model/Category.java): `src/main/java/in/nit/model/Category.java`
- [Product entity](https://github.com/sonubth83/wherehouse-logistic/blob/master/src/main/java/in/nit/model/Product.java): `src/main/java/in/nit/model/Product.java`

### Other components

- **Catalog user**
- **REST client**

## Connections

- Catalog user → Category controller: submits category (evidence: `src/main/java/in/nit/controller/CategoryController.java`)
- Catalog user → Product controller: uses catalog (evidence: `src/main/java/in/nit/controller/ProductTypeController.java`)
- REST client → Product REST API: calls endpoints (evidence: `src/main/java/in/nit/controller/rest/ProductTypeControllerRest.java`)
- Category controller → Category service: delegates (evidence: `src/main/java/in/nit/controller/CategoryController.java`)
- Product controller → Product service: delegates (evidence: `src/main/java/in/nit/controller/ProductTypeController.java`)
- Product controller → Category service: loads categories (evidence: `src/main/java/in/nit/controller/ProductTypeController.java`)
- Product controller → Category map helper: converts categories (evidence: `src/main/java/in/nit/controller/ProductTypeController.java`)
- Product REST API → Product service: delegates (evidence: `src/main/java/in/nit/controller/rest/ProductTypeControllerRest.java`)
- Category controller → Category form: renders (evidence: `src/main/java/in/nit/controller/CategoryController.java`)
- Product controller → Product form: renders (evidence: `src/main/java/in/nit/controller/ProductTypeController.java`)
- Product controller → Product listing: renders (evidence: `src/main/java/in/nit/controller/ProductTypeController.java`)
- Category service → Category DAO: delegates (evidence: `src/main/java/in/nit/service/impl/CategoryServiceImpl.java`)
- Product service → Product DAO: delegates (evidence: `src/main/java/in/nit/service/impl/ProductServiceImpl.java`)
- Category DAO → Category entity: persists (evidence: `src/main/java/in/nit/dao/impl/CategoryDaoImpl.java`)
- Product DAO → Product entity: persists (evidence: `src/main/java/in/nit/dao/impl/ProductDaoImpl.java`)
- Product entity → Category entity: references (evidence: `src/main/java/in/nit/model/Product.java`)
- Category DAO → Catalog database: reads and writes
- Product DAO → Catalog database: reads and writes
- Application initializer → Spring configuration: initializes (evidence: `src/main/java/in/nit/init/AppInit.java`)
