# sanketch04/productapi architecture

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

- Interactive diagram: https://gitdiagram.com/sanketch04/productapi
- Repository: https://github.com/sanketch04/productapi

## Overview

This ASP.NET Core product-management API supports product CRUD, image upload/download, QR generation, reports, and email. The main workflow is an HTTP request through a controller, into a business service, through the product repository, and to the database; image and QR operations branch from the product API, while reports and email have separate endpoints. Source excerpts show product and image persistence details. Report and email implementation links are based on the SOURCE INDEX; their downstream behavior is not fully shown.

Main entry points: [`Product.API/Program.cs`](https://github.com/sanketch04/productapi/blob/master/Product.API/Program.cs) (App Registration), [`Product.API/Controllers/ProductsController.cs`](https://github.com/sanketch04/productapi/blob/master/Product.API/Controllers/ProductsController.cs) (Products API), [`Product.DAL/Implementation/ProductRepository.cs`](https://github.com/sanketch04/productapi/blob/master/Product.DAL/Implementation/ProductRepository.cs) (Product Repository), [`Product.BLL/Implementation/ProductImageService.cs`](https://github.com/sanketch04/productapi/blob/master/Product.BLL/Implementation/ProductImageService.cs) (Image Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_products_api["Products API"]
  node_email_api["Email API<br/>[EmailController.cs]"]
  node_report_api["Report API"]
  node_product_dto["Product DTOs"]
  node_create_dto["Create DTO"]
  node_update_dto["Update DTO"]
  node_image_dto["Image Upload DTO"]
  node_email_request["Email Request"]
  node_app_config["App Registration<br/>[Program.cs]"]
end

subgraph group_business["Business Services"]
  node_product_service["Product Service<br/>[ProductService.cs]"]
  node_image_service["Image Service"]
  node_qr_service["QR Service<br/>[QrService.cs]"]
  node_report_service["Report Service<br/>[ReportSevice.cs]"]
  node_email_service["Email Service<br/>[EmailService.cs]"]
end

subgraph group_data["Product Data"]
  node_repository["Product Repository"]
  node_db_context["EF DbContext<br/>[AppDbContext.cs]"]
  node_product_entity["Product Entity<br/>[ProductEntity.cs]"]
end

subgraph group_assets["Product Assets &amp; Integrations"]
  node_image_files[("Uploaded Images<br/>[products]")]
end

node_client(("API Client"))
node_sql_db[("SQL Server")]

node_client -->|"sends HTTP"| node_products_api
node_client -->|"sends HTTP"| node_email_api
node_client -->|"sends HTTP"| node_report_api
node_products_api -->|"calls CRUD"| node_product_service
node_products_api -->|"calls image ops"| node_image_service
node_products_api -->|"requests QR"| node_qr_service
node_products_api -->|"accepts input"| node_create_dto
node_products_api -->|"accepts input"| node_update_dto
node_products_api -->|"accepts upload"| node_image_dto
node_product_service -->|"maps results"| node_product_dto
node_product_service -->|"calls data access"| node_repository
node_image_service -->|"reads product"| node_repository
node_image_service -->|"writes and reads"| node_image_files
node_image_service -->|"updates image path"| node_repository
node_qr_service -->|"looks up product"| node_repository
node_report_api -->|"requests report"| node_report_service
node_report_service -->|"uses products"| node_repository
node_email_api -->|"sends request"| node_email_service
node_email_api -->|"accepts payload"| node_email_request
node_repository -->|"queries and saves"| node_db_context
node_db_context -->|"maps table"| node_product_entity
node_db_context -.->|"persists records"| node_sql_db
node_app_config -->|"configures database"| node_db_context
node_app_config -->|"registers implementation"| node_repository
node_app_config -->|"registers implementation"| node_product_service
node_app_config -->|"registers implementation"| node_image_service
node_app_config -->|"registers implementation"| node_qr_service
node_app_config -->|"registers implementation"| node_report_service
node_app_config -->|"registers implementation"| node_email_service

click node_products_api "https://github.com/sanketch04/productapi/blob/master/Product.API/Controllers/ProductsController.cs"
click node_email_api "https://github.com/sanketch04/productapi/blob/master/Product.API/Controllers/EmailController.cs"
click node_report_api "https://github.com/sanketch04/productapi/blob/master/Product.API/Controllers/ReportController.cs"
click node_product_service "https://github.com/sanketch04/productapi/blob/master/Product.BLL/Implementation/ProductService.cs"
click node_image_service "https://github.com/sanketch04/productapi/blob/master/Product.BLL/Implementation/ProductImageService.cs"
click node_qr_service "https://github.com/sanketch04/productapi/blob/master/Product.BLL/Implementation/QrService.cs"
click node_report_service "https://github.com/sanketch04/productapi/blob/master/Product.BLL/Implementation/ReportSevice.cs"
click node_email_service "https://github.com/sanketch04/productapi/blob/master/Product.BLL/Implementation/EmailService.cs"
click node_product_dto "https://github.com/sanketch04/productapi/blob/master/Product.Common/DTOs/ProductResponseDto.cs"
click node_create_dto "https://github.com/sanketch04/productapi/blob/master/Product.Common/DTOs/ProductCreateDto.cs"
click node_update_dto "https://github.com/sanketch04/productapi/blob/master/Product.Common/DTOs/ProductUpdateDto.cs"
click node_image_dto "https://github.com/sanketch04/productapi/blob/master/Product.Common/DTOs/ProductImageUploadDto.cs"
click node_email_request "https://github.com/sanketch04/productapi/blob/master/Product.API/Models/SendEmailRequest.cs"
click node_repository "https://github.com/sanketch04/productapi/blob/master/Product.DAL/Implementation/ProductRepository.cs"
click node_db_context "https://github.com/sanketch04/productapi/blob/master/Product.DAL/Context/AppDbContext.cs"
click node_product_entity "https://github.com/sanketch04/productapi/blob/master/Product.DAL/Entities/ProductEntity.cs"
click node_image_files "https://github.com/sanketch04/productapi/tree/master/Product.API/wwwroot/uploads/products"
click node_app_config "https://github.com/sanketch04/productapi/blob/master/Product.API/Program.cs"

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_products_api,node_email_api,node_report_api,node_product_dto,node_create_dto,node_update_dto,node_image_dto,node_email_request,node_app_config,node_client toneBlue
class node_product_service,node_image_service,node_qr_service,node_report_service,node_email_service,node_sql_db toneAmber
class node_repository,node_db_context,node_product_entity toneMint
class node_image_files toneRose
```

## Components

### HTTP API

- [Products API](https://github.com/sanketch04/productapi/blob/master/Product.API/Controllers/ProductsController.cs): `Product.API/Controllers/ProductsController.cs`
- [Email API](https://github.com/sanketch04/productapi/blob/master/Product.API/Controllers/EmailController.cs): `Product.API/Controllers/EmailController.cs`
- [Report API](https://github.com/sanketch04/productapi/blob/master/Product.API/Controllers/ReportController.cs): `Product.API/Controllers/ReportController.cs`
- [Product DTOs](https://github.com/sanketch04/productapi/blob/master/Product.Common/DTOs/ProductResponseDto.cs): `Product.Common/DTOs/ProductResponseDto.cs`
- [Create DTO](https://github.com/sanketch04/productapi/blob/master/Product.Common/DTOs/ProductCreateDto.cs): `Product.Common/DTOs/ProductCreateDto.cs`
- [Update DTO](https://github.com/sanketch04/productapi/blob/master/Product.Common/DTOs/ProductUpdateDto.cs): `Product.Common/DTOs/ProductUpdateDto.cs`
- [Image Upload DTO](https://github.com/sanketch04/productapi/blob/master/Product.Common/DTOs/ProductImageUploadDto.cs): `Product.Common/DTOs/ProductImageUploadDto.cs`
- [Email Request](https://github.com/sanketch04/productapi/blob/master/Product.API/Models/SendEmailRequest.cs): `Product.API/Models/SendEmailRequest.cs`
- [App Registration](https://github.com/sanketch04/productapi/blob/master/Product.API/Program.cs): `Product.API/Program.cs`

### Business Services

- [Product Service](https://github.com/sanketch04/productapi/blob/master/Product.BLL/Implementation/ProductService.cs): `Product.BLL/Implementation/ProductService.cs`
- [Image Service](https://github.com/sanketch04/productapi/blob/master/Product.BLL/Implementation/ProductImageService.cs): `Product.BLL/Implementation/ProductImageService.cs`
- [QR Service](https://github.com/sanketch04/productapi/blob/master/Product.BLL/Implementation/QrService.cs): `Product.BLL/Implementation/QrService.cs`
- [Report Service](https://github.com/sanketch04/productapi/blob/master/Product.BLL/Implementation/ReportSevice.cs): `Product.BLL/Implementation/ReportSevice.cs`
- [Email Service](https://github.com/sanketch04/productapi/blob/master/Product.BLL/Implementation/EmailService.cs): `Product.BLL/Implementation/EmailService.cs`

### Product Data

- [Product Repository](https://github.com/sanketch04/productapi/blob/master/Product.DAL/Implementation/ProductRepository.cs): `Product.DAL/Implementation/ProductRepository.cs`
- [EF DbContext](https://github.com/sanketch04/productapi/blob/master/Product.DAL/Context/AppDbContext.cs): `Product.DAL/Context/AppDbContext.cs`
- [Product Entity](https://github.com/sanketch04/productapi/blob/master/Product.DAL/Entities/ProductEntity.cs): `Product.DAL/Entities/ProductEntity.cs`

### Product Assets & Integrations

- [Uploaded Images](https://github.com/sanketch04/productapi/tree/master/Product.API/wwwroot/uploads/products): `Product.API/wwwroot/uploads/products`

### Other components

- **API Client**
- **SQL Server**

## Connections

- API Client → Products API: sends HTTP (evidence: `Product.API/Controllers/ProductsController.cs`)
- API Client → Email API: sends HTTP (evidence: `Product.API/Controllers/EmailController.cs`)
- API Client → Report API: sends HTTP (evidence: `Product.API/Controllers/ReportController.cs`)
- Products API → Product Service: calls CRUD (evidence: `Product.API/Controllers/ProductsController.cs`)
- Products API → Image Service: calls image ops (evidence: `Product.API/Controllers/ProductsController.cs`)
- Products API → QR Service: requests QR
- Products API → Create DTO: accepts input (evidence: `Product.API/Controllers/ProductsController.cs`)
- Products API → Update DTO: accepts input (evidence: `Product.API/Controllers/ProductsController.cs`)
- Products API → Image Upload DTO: accepts upload (evidence: `Product.API/Controllers/ProductsController.cs`)
- Product Service → Product DTOs: maps results (evidence: `Product.BLL/Implementation/ProductService.cs`)
- Product Service → Product Repository: calls data access (evidence: `Product.BLL/Implementation/ProductService.cs`)
- Image Service → Product Repository: reads product (evidence: `Product.BLL/Implementation/ProductImageService.cs`)
- Image Service → Uploaded Images: writes and reads (evidence: `Product.BLL/Implementation/ProductImageService.cs`)
- Image Service → Product Repository: updates image path (evidence: `Product.BLL/Implementation/ProductImageService.cs`)
- QR Service → Product Repository: looks up product (evidence: `Product.BLL/Implementation/QrService.cs`)
- Report API → Report Service: requests report (evidence: `Product.API/Controllers/ReportController.cs`)
- Report Service → Product Repository: uses products (evidence: `Product.BLL/Implementation/ReportSevice.cs`)
- Email API → Email Service: sends request (evidence: `Product.API/Controllers/EmailController.cs`)
- Email API → Email Request: accepts payload (evidence: `Product.API/Controllers/EmailController.cs`)
- Product Repository → EF DbContext: queries and saves (evidence: `Product.DAL/Implementation/ProductRepository.cs`)
- EF DbContext → Product Entity: maps table (evidence: `Product.DAL/Context/AppDbContext.cs`)
- EF DbContext → SQL Server: persists records
- App Registration → EF DbContext: configures database (evidence: `Product.API/Program.cs`)
- App Registration → Product Repository: registers implementation (evidence: `Product.API/Program.cs`)
- App Registration → Product Service: registers implementation (evidence: `Product.API/Program.cs`)
- App Registration → Image Service: registers implementation (evidence: `Product.API/Program.cs`)
- App Registration → QR Service: registers implementation (evidence: `Product.API/Program.cs`)
- App Registration → Report Service: registers implementation (evidence: `Product.API/Program.cs`)
- App Registration → Email Service: registers implementation (evidence: `Product.API/Program.cs`)
