# pranay8873/product-implementation architecture

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

- Interactive diagram: https://gitdiagram.com/pranay8873/product-implementation
- Repository: https://github.com/pranay8873/product-implementation

## Overview

This is a Spring Boot product-catalog API. Its principal workflow is product requests entering the controller, being handled by the product service, persisted through a repository, and returned as response DTOs; service operations cover creation, lookup by ID/name/category, update, listing, and deletion. Product and address entities model catalog state, with product enums and request/update/response DTOs. The controller and exception handler were not excerpted, so their runtime connections are shown as unverified; the README provides no additional capability documentation.

Main entry points: [`src/main/java/com/product/project/service/ProductServ.java`](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/service/ProductServ.java) (Product service), [`src/main/java/com/product/project/entity/Product.java`](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/entity/Product.java) (Product entity), [`src/main/java/com/product/project/controler/ProductCtlr.java`](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/controler/ProductCtlr.java) (Product controller), [`src/main/java/com/product/project/repository/ProductRepo.java`](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/repository/ProductRepo.java) (Product repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API boundary"]
  node_controller["Product controller<br/>[ProductCtlr.java]"]
  node_request["Product requests"]
  node_update["Update payload"]
  node_response["Product response"]
  node_exceptionhandler["Exception handler"]
  node_addressdto["Address payload<br/>[addressdto.java]"]
end

subgraph group_logic["Product logic"]
  node_service["Product service<br/>[ProductServ.java]"]
  node_servicecontract["Service contract"]
  node_exists["Duplicate exception"]
  node_missing["Not-found exception"]
end

subgraph group_data["Catalog data"]
  node_productrepo["Product repository<br/>[ProductRepo.java]"]
  node_addressrepo["Address repository<br/>[Addressrepo.java]"]
  node_product["Product entity<br/>[Product.java]"]
  node_address["Address entity<br/>[Address.java]"]
  node_types["Product type<br/>[Type.java]"]
  node_status["Product status<br/>[Status.java]"]
end

node_client(("API client"))
node_database[("Relational database")]
node_mapper["ModelMapper"]

node_client -.->|"sends requests"| node_controller
node_controller -.->|"dispatches calls"| node_service
node_service -->|"implements"| node_servicecontract
node_service -->|"reads and writes"| node_productrepo
node_service -->|"maps objects"| node_mapper
node_service -->|"builds and updates"| node_product
node_service -->|"accepts"| node_request
node_service -->|"accepts"| node_update
node_service -->|"returns"| node_response
node_service -->|"throws"| node_missing
node_productrepo -->|"stores"| node_product
node_productrepo -.->|"persists entities"| node_database
node_addressrepo -->|"stores"| node_address
node_address -->|"belongs to"| node_product
node_product -->|"has addresses"| node_address
node_product -->|"uses"| node_types
node_product -->|"uses"| node_status
node_response -->|"includes"| node_addressdto
node_controller -.->|"routes errors"| node_exceptionhandler

click node_controller "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/controler/ProductCtlr.java"
click node_request "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/dto/ProductRequestdto.java"
click node_update "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/dto/ProductUpdateDto.java"
click node_response "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/dto/ProductResponsedto.java"
click node_exceptionhandler "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/Exception/GlobalExceptionHandler.java"
click node_service "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/service/ProductServ.java"
click node_servicecontract "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/service/ProductService.java"
click node_exists "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/Exception/ProductExistsExcption.java"
click node_missing "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/Exception/ProductNotFoundExcption.java"
click node_productrepo "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/repository/ProductRepo.java"
click node_addressrepo "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/repository/Addressrepo.java"
click node_product "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/entity/Product.java"
click node_address "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/entity/Address.java"
click node_types "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/enums/Type.java"
click node_status "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/enums/Status.java"
click node_addressdto "https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/dto/addressdto.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_controller,node_request,node_update,node_response,node_exceptionhandler,node_addressdto,node_client toneBlue
class node_service,node_servicecontract,node_exists,node_missing,node_database toneAmber
class node_productrepo,node_addressrepo,node_product,node_address,node_types,node_status toneMint
class node_mapper toneIndigo
```

## Components

### API boundary

- [Product controller](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/controler/ProductCtlr.java): `src/main/java/com/product/project/controler/ProductCtlr.java`
- [Product requests](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/dto/ProductRequestdto.java): `src/main/java/com/product/project/dto/ProductRequestdto.java`
- [Update payload](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/dto/ProductUpdateDto.java): `src/main/java/com/product/project/dto/ProductUpdateDto.java`
- [Product response](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/dto/ProductResponsedto.java): `src/main/java/com/product/project/dto/ProductResponsedto.java`
- [Exception handler](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/Exception/GlobalExceptionHandler.java): `src/main/java/com/product/project/Exception/GlobalExceptionHandler.java`
- [Address payload](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/dto/addressdto.java): `src/main/java/com/product/project/dto/addressdto.java`

### Product logic

- [Product service](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/service/ProductServ.java): `src/main/java/com/product/project/service/ProductServ.java`
- [Service contract](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/service/ProductService.java): `src/main/java/com/product/project/service/ProductService.java`
- [Duplicate exception](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/Exception/ProductExistsExcption.java): `src/main/java/com/product/project/Exception/ProductExistsExcption.java`
- [Not-found exception](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/Exception/ProductNotFoundExcption.java): `src/main/java/com/product/project/Exception/ProductNotFoundExcption.java`

### Catalog data

- [Product repository](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/repository/ProductRepo.java): `src/main/java/com/product/project/repository/ProductRepo.java`
- [Address repository](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/repository/Addressrepo.java): `src/main/java/com/product/project/repository/Addressrepo.java`
- [Product entity](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/entity/Product.java): `src/main/java/com/product/project/entity/Product.java`
- [Address entity](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/entity/Address.java): `src/main/java/com/product/project/entity/Address.java`
- [Product type](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/enums/Type.java): `src/main/java/com/product/project/enums/Type.java`
- [Product status](https://github.com/pranay8873/product-implementation/blob/main/src/main/java/com/product/project/enums/Status.java): `src/main/java/com/product/project/enums/Status.java`

### Other components

- **API client**
- **Relational database**
- **ModelMapper**

## Connections

- API client → Product controller: sends requests
- Product controller → Product service: dispatches calls
- Product service → Service contract: implements (evidence: `src/main/java/com/product/project/service/ProductServ.java`)
- Product service → Product repository: reads and writes (evidence: `src/main/java/com/product/project/service/ProductServ.java`)
- Product service → ModelMapper: maps objects (evidence: `src/main/java/com/product/project/service/ProductServ.java`)
- Product service → Product entity: builds and updates (evidence: `src/main/java/com/product/project/service/ProductServ.java`)
- Product service → Product requests: accepts (evidence: `src/main/java/com/product/project/service/ProductServ.java`)
- Product service → Update payload: accepts (evidence: `src/main/java/com/product/project/service/ProductServ.java`)
- Product service → Product response: returns (evidence: `src/main/java/com/product/project/service/ProductServ.java`)
- Product service → Not-found exception: throws (evidence: `src/main/java/com/product/project/service/ProductServ.java`)
- Product repository → Product entity: stores (evidence: `src/main/java/com/product/project/repository/ProductRepo.java`)
- Product repository → Relational database: persists entities
- Address repository → Address entity: stores (evidence: `src/main/java/com/product/project/repository/Addressrepo.java`)
- Address entity → Product entity: belongs to (evidence: `src/main/java/com/product/project/entity/Address.java`)
- Product entity → Address entity: has addresses (evidence: `src/main/java/com/product/project/entity/Product.java`)
- Product entity → Product type: uses (evidence: `src/main/java/com/product/project/entity/Product.java`)
- Product entity → Product status: uses (evidence: `src/main/java/com/product/project/entity/Product.java`)
- Product response → Address payload: includes (evidence: `src/main/java/com/product/project/dto/ProductResponsedto.java`)
- Product controller → Exception handler: routes errors
