# moataz-1/smartclean architecture

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

- Interactive diagram: https://gitdiagram.com/moataz-1/smartclean
- Repository: https://github.com/moataz-1/smartclean

## Overview

Smartclean is an ASP.NET API for product and category browsing/management, customer baskets, and account authentication. The principal workflow starts with an API client calling a controller, which uses the unit-of-work abstraction to reach application data; product operations also map DTOs and manage product images. Authentication supports registration, login, email confirmation, and password reset. The graph reflects documented calls and source-index references; several repository implementations and ancillary controllers were not excerpted, so their internal behavior and some wiring remain uncertain.

Main entry points: [`Smartclean.infrastructure/DependencyInjection.cs`](https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/DependencyInjection.cs) (Service registration), [`Smartclean.infrastructure/Repositories/UnitOfWork.cs`](https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Repositories/UnitOfWork.cs) (Unit of work), [`Smartclean.infrastructure/Repositories/ProductRepositry.cs`](https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Repositories/ProductRepositry.cs) (Product repository), [`Smartclean.API/Controllers/ProductsController.cs`](https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Controllers/ProductsController.cs) (Products API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API surface"]
  node_account["Account API"]
  node_products["Products API"]
  node_categories["Categories API"]
  node_basket["Basket API"]
  node_base["Controller base<br/>[BaseController.cs]"]
  node_responses["API responses<br/>[ResponseAPI.cs]"]
end

subgraph group_domain["Domain model"]
  node_productdto["Product DTOs<br/>[ProductDTO.cs]"]
  node_product["Product model<br/>[Product.cs]"]
  node_category["Category model<br/>[Category.cs]"]
  node_basketmodel["Basket model<br/>[CustomerBasket.cs]"]
  node_user["Account model<br/>[AppUser.cs]"]
end

subgraph group_infra["Persistence"]
  node_uow["Unit of work<br/>[UnitOfWork.cs]"]
  node_productrepo["Product repository"]
  node_authrepo["Authentication repository<br/>[AuthRepository.cs]"]
  node_db[("Application database<br/>[AppDbContext.cs]")]
end

subgraph group_services["Supporting services"]
  node_images["Image management"]
  node_email["Email delivery<br/>[EmailService.cs]"]
  node_token["Token generation<br/>[GenerateToken.cs]"]
  node_di["Service registration"]
end

node_client(("API client"))

node_client -->|"calls"| node_account
node_client -->|"calls"| node_products
node_client -->|"calls"| node_categories
node_client -->|"calls"| node_basket
node_account -->|"uses"| node_uow
node_products -->|"uses"| node_uow
node_categories -->|"uses"| node_uow
node_basket -->|"uses"| node_uow
node_products -->|"accepts and returns"| node_productdto
node_productrepo -->|"queries and saves"| node_db
node_productrepo -->|"manages images"| node_images
node_productrepo -->|"maps"| node_productdto
node_authrepo -->|"sends email"| node_email
node_authrepo -->|"creates login token"| node_token
node_di -->|"registers"| node_db
node_di -->|"registers"| node_uow
node_di -->|"registers"| node_authrepo
node_di -->|"registers"| node_images
node_di -->|"registers"| node_email
node_di -->|"registers"| node_token

click node_account "https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Controllers/AccountController.cs"
click node_products "https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Controllers/ProductsController.cs"
click node_categories "https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Controllers/CategorysController.cs"
click node_basket "https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Controllers/BasketController.cs"
click node_base "https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Controllers/BaseController.cs"
click node_responses "https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Helper/ResponseAPI.cs"
click node_productdto "https://github.com/moataz-1/smartclean/blob/main/Smartclean.core/DTO/ProductDTO.cs"
click node_product "https://github.com/moataz-1/smartclean/blob/main/Smartclean.core/Entities/Product/Product.cs"
click node_category "https://github.com/moataz-1/smartclean/blob/main/Smartclean.core/Entities/Product/Category.cs"
click node_basketmodel "https://github.com/moataz-1/smartclean/blob/main/Smartclean.core/Entities/CustomerBasket.cs"
click node_user "https://github.com/moataz-1/smartclean/blob/main/Smartclean.core/Entities/AppUser.cs"
click node_uow "https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Repositories/UnitOfWork.cs"
click node_productrepo "https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Repositories/ProductRepositry.cs"
click node_authrepo "https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Repositories/AuthRepository.cs"
click node_db "https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Data/AppDbContext.cs"
click node_images "https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Services/ImageManagementService.cs"
click node_email "https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Services/EmailService.cs"
click node_token "https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Services/GenerateToken.cs"
click node_di "https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/DependencyInjection.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_account,node_products,node_categories,node_basket,node_base,node_responses,node_client toneBlue
class node_productdto,node_product,node_category,node_basketmodel,node_user toneAmber
class node_uow,node_productrepo,node_authrepo,node_db toneMint
class node_images,node_email,node_token,node_di toneRose
```

## Components

### API surface

- [Account API](https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Controllers/AccountController.cs): `Smartclean.API/Controllers/AccountController.cs`
- [Products API](https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Controllers/ProductsController.cs): `Smartclean.API/Controllers/ProductsController.cs`
- [Categories API](https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Controllers/CategorysController.cs): `Smartclean.API/Controllers/CategorysController.cs`
- [Basket API](https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Controllers/BasketController.cs): `Smartclean.API/Controllers/BasketController.cs`
- [Controller base](https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Controllers/BaseController.cs): `Smartclean.API/Controllers/BaseController.cs`
- [API responses](https://github.com/moataz-1/smartclean/blob/main/Smartclean.API/Helper/ResponseAPI.cs): `Smartclean.API/Helper/ResponseAPI.cs`

### Domain model

- [Product DTOs](https://github.com/moataz-1/smartclean/blob/main/Smartclean.core/DTO/ProductDTO.cs): `Smartclean.core/DTO/ProductDTO.cs`
- [Product model](https://github.com/moataz-1/smartclean/blob/main/Smartclean.core/Entities/Product/Product.cs): `Smartclean.core/Entities/Product/Product.cs`
- [Category model](https://github.com/moataz-1/smartclean/blob/main/Smartclean.core/Entities/Product/Category.cs): `Smartclean.core/Entities/Product/Category.cs`
- [Basket model](https://github.com/moataz-1/smartclean/blob/main/Smartclean.core/Entities/CustomerBasket.cs): `Smartclean.core/Entities/CustomerBasket.cs`
- [Account model](https://github.com/moataz-1/smartclean/blob/main/Smartclean.core/Entities/AppUser.cs): `Smartclean.core/Entities/AppUser.cs`

### Persistence

- [Unit of work](https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Repositories/UnitOfWork.cs): `Smartclean.infrastructure/Repositories/UnitOfWork.cs`
- [Product repository](https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Repositories/ProductRepositry.cs): `Smartclean.infrastructure/Repositories/ProductRepositry.cs`
- [Authentication repository](https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Repositories/AuthRepository.cs): `Smartclean.infrastructure/Repositories/AuthRepository.cs`
- [Application database](https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Data/AppDbContext.cs): `Smartclean.infrastructure/Data/AppDbContext.cs`

### Supporting services

- [Image management](https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Services/ImageManagementService.cs): `Smartclean.infrastructure/Services/ImageManagementService.cs`
- [Email delivery](https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Services/EmailService.cs): `Smartclean.infrastructure/Services/EmailService.cs`
- [Token generation](https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/Services/GenerateToken.cs): `Smartclean.infrastructure/Services/GenerateToken.cs`
- [Service registration](https://github.com/moataz-1/smartclean/blob/main/Smartclean.infrastructure/DependencyInjection.cs): `Smartclean.infrastructure/DependencyInjection.cs`

### Other components

- **API client**

## Connections

- API client → Account API: calls (evidence: `Smartclean.API/Controllers/AccountController.cs`)
- API client → Products API: calls (evidence: `Smartclean.API/Controllers/ProductsController.cs`)
- API client → Categories API: calls (evidence: `Smartclean.API/Controllers/CategorysController.cs`)
- API client → Basket API: calls (evidence: `Smartclean.API/Controllers/BasketController.cs`)
- Account API → Unit of work: uses (evidence: `Smartclean.API/Controllers/AccountController.cs`)
- Products API → Unit of work: uses (evidence: `Smartclean.API/Controllers/ProductsController.cs`)
- Categories API → Unit of work: uses (evidence: `Smartclean.API/Controllers/CategorysController.cs`)
- Basket API → Unit of work: uses (evidence: `Smartclean.API/Controllers/BasketController.cs`)
- Products API → Product DTOs: accepts and returns (evidence: `Smartclean.API/Controllers/ProductsController.cs`)
- Product repository → Application database: queries and saves (evidence: `Smartclean.infrastructure/Repositories/ProductRepositry.cs`)
- Product repository → Image management: manages images (evidence: `Smartclean.infrastructure/Repositories/ProductRepositry.cs`)
- Product repository → Product DTOs: maps (evidence: `Smartclean.infrastructure/Repositories/ProductRepositry.cs`)
- Authentication repository → Email delivery: sends email (evidence: `Smartclean.infrastructure/Repositories/AuthRepository.cs`)
- Authentication repository → Token generation: creates login token (evidence: `Smartclean.infrastructure/Repositories/AuthRepository.cs`)
- Service registration → Application database: registers (evidence: `Smartclean.infrastructure/DependencyInjection.cs`)
- Service registration → Unit of work: registers (evidence: `Smartclean.infrastructure/DependencyInjection.cs`)
- Service registration → Authentication repository: registers (evidence: `Smartclean.infrastructure/DependencyInjection.cs`)
- Service registration → Image management: registers (evidence: `Smartclean.infrastructure/DependencyInjection.cs`)
- Service registration → Email delivery: registers (evidence: `Smartclean.infrastructure/DependencyInjection.cs`)
- Service registration → Token generation: registers (evidence: `Smartclean.infrastructure/DependencyInjection.cs`)
