# kkcire/storage-system architecture

> Architecture diagram of the GitHub repository kkcire/storage-system, 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/kkcire/storage-system
- Repository: https://github.com/kkcire/storage-system

## Overview

Storage System is a console-based inventory manager for brands and products. Users navigate the console menus to register, update, delete, search, and list records; product operations also cover stock adjustments and brand changes. Services apply use-case checks and invoke repository contracts, while domain entities enforce business rules and EF Core repositories persist through SQL Server. The README documents database constraints and automatic startup migrations. The map reflects the shown wiring and calls; repository implementation details are supported by the source index, not quoted excerpts.

Main entry points: [`src/StorageSystem.Console/Program.cs`](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Console/Program.cs) (Startup Wiring), [`src/StorageSystem.Application/Services/ProductService.cs`](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Application/Services/ProductService.cs) (Product Service), [`src/StorageSystem.Infrastructure/Data/StorageContext.cs`](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Infrastructure/Data/StorageContext.cs) (EF Context), [`src/StorageSystem.Console/UI/Menu.cs`](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Console/UI/Menu.cs) (Main Menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Console UI"]
  node_runtime["Startup Wiring<br/>[Program.cs]"]
  node_main_menu["Main Menu<br/>[Menu.cs]"]
  node_brand_menu["Brand Menu<br/>[BrandMenu.cs]"]
  node_product_menu["Product Menu<br/>[ProductMenu.cs]"]
  node_update_menu["Product Updates<br/>[UpdateMenu.cs]"]
end

subgraph group_application["Application"]
  node_brand_service["Brand Service<br/>[BrandService.cs]"]
  node_product_service["Product Service<br/>[ProductService.cs]"]
  node_brand_contract["Brand Contract"]
  node_product_contract["Product Contract"]
end

subgraph group_domain["Domain Model"]
  node_brand_entity["Brand Entity<br/>[Brand.cs]"]
  node_product_entity["Product Entity<br/>[Product.cs]"]
  node_guards["Validation Guards<br/>[GuardClause.cs]"]
  node_domain_error["Domain Error<br/>[DomainException.cs]"]
end

subgraph group_persistence["Persistence"]
  node_brand_repo["Brand Repository<br/>[BrandRepository.cs]"]
  node_product_repo["Product Repository"]
  node_context["EF Context<br/>[StorageContext.cs]"]
end

node_user(("Operator"))
node_sql[("SQL Server")]

node_user -->|"uses"| node_main_menu
node_runtime -->|"migrates"| node_context
node_runtime -->|"constructs"| node_brand_repo
node_runtime -->|"constructs"| node_product_repo
node_runtime -->|"constructs"| node_brand_service
node_runtime -->|"constructs"| node_product_service
node_runtime -->|"constructs"| node_brand_menu
node_runtime -->|"constructs"| node_product_menu
node_runtime -->|"constructs"| node_update_menu
node_runtime -->|"runs"| node_main_menu
node_main_menu -->|"dispatches"| node_brand_menu
node_main_menu -->|"dispatches"| node_product_menu
node_product_menu -->|"opens"| node_update_menu
node_brand_menu -->|"calls"| node_brand_service
node_product_menu -->|"calls"| node_product_service
node_update_menu -->|"calls"| node_product_service
node_brand_service -->|"uses"| node_brand_contract
node_product_service -->|"uses"| node_product_contract
node_brand_service -->|"creates and mutates"| node_brand_entity
node_product_service -->|"creates and mutates"| node_product_entity
node_product_service -->|"checks brand"| node_brand_entity
node_brand_entity -->|"validates with"| node_guards
node_product_entity -->|"validates with"| node_guards
node_product_entity -->|"throws"| node_domain_error
node_brand_repo -->|"queries and saves"| node_context
node_product_repo -->|"queries and saves"| node_context
node_context -->|"maps"| node_brand_entity
node_context -->|"maps"| node_product_entity
node_context -->|"persists through"| node_sql

click node_runtime "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Console/Program.cs"
click node_main_menu "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Console/UI/Menu.cs"
click node_brand_menu "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Console/UI/Brand/BrandMenu.cs"
click node_product_menu "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Console/UI/Product/ProductMenu.cs"
click node_update_menu "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Console/UI/Product/UpdateMenu.cs"
click node_brand_service "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Application/Services/BrandService.cs"
click node_product_service "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Application/Services/ProductService.cs"
click node_brand_contract "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Application/Repository/IBrandRepository.cs"
click node_product_contract "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Application/Repository/IProductRepository.cs"
click node_brand_entity "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Domain/Entities/Brand.cs"
click node_product_entity "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Domain/Entities/Product.cs"
click node_guards "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Domain/Guards/GuardClause.cs"
click node_domain_error "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Domain/Exceptions/DomainException.cs"
click node_brand_repo "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Infrastructure/Repository/BrandRepository.cs"
click node_product_repo "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Infrastructure/Repository/ProductRepository.cs"
click node_context "https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Infrastructure/Data/StorageContext.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_runtime,node_main_menu,node_brand_menu,node_product_menu,node_update_menu toneBlue
class node_brand_service,node_product_service,node_brand_contract,node_product_contract,node_sql toneAmber
class node_brand_entity,node_product_entity,node_guards,node_domain_error toneMint
class node_brand_repo,node_product_repo,node_context toneRose
class node_user toneIndigo
```

## Components

### Console UI

- [Startup Wiring](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Console/Program.cs): `src/StorageSystem.Console/Program.cs`
- [Main Menu](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Console/UI/Menu.cs): `src/StorageSystem.Console/UI/Menu.cs`
- [Brand Menu](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Console/UI/Brand/BrandMenu.cs): `src/StorageSystem.Console/UI/Brand/BrandMenu.cs`
- [Product Menu](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Console/UI/Product/ProductMenu.cs): `src/StorageSystem.Console/UI/Product/ProductMenu.cs`
- [Product Updates](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Console/UI/Product/UpdateMenu.cs): `src/StorageSystem.Console/UI/Product/UpdateMenu.cs`

### Application

- [Brand Service](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Application/Services/BrandService.cs): `src/StorageSystem.Application/Services/BrandService.cs`
- [Product Service](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Application/Services/ProductService.cs): `src/StorageSystem.Application/Services/ProductService.cs`
- [Brand Contract](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Application/Repository/IBrandRepository.cs): `src/StorageSystem.Application/Repository/IBrandRepository.cs`
- [Product Contract](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Application/Repository/IProductRepository.cs): `src/StorageSystem.Application/Repository/IProductRepository.cs`

### Domain Model

- [Brand Entity](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Domain/Entities/Brand.cs): `src/StorageSystem.Domain/Entities/Brand.cs`
- [Product Entity](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Domain/Entities/Product.cs): `src/StorageSystem.Domain/Entities/Product.cs`
- [Validation Guards](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Domain/Guards/GuardClause.cs): `src/StorageSystem.Domain/Guards/GuardClause.cs`
- [Domain Error](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Domain/Exceptions/DomainException.cs): `src/StorageSystem.Domain/Exceptions/DomainException.cs`

### Persistence

- [Brand Repository](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Infrastructure/Repository/BrandRepository.cs): `src/StorageSystem.Infrastructure/Repository/BrandRepository.cs`
- [Product Repository](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Infrastructure/Repository/ProductRepository.cs): `src/StorageSystem.Infrastructure/Repository/ProductRepository.cs`
- [EF Context](https://github.com/kkcire/storage-system/blob/main/src/StorageSystem.Infrastructure/Data/StorageContext.cs): `src/StorageSystem.Infrastructure/Data/StorageContext.cs`

### Other components

- **Operator**
- **SQL Server**

## Connections

- Operator → Main Menu: uses (evidence: `README.md`)
- Startup Wiring → EF Context: migrates (evidence: `src/StorageSystem.Console/Program.cs`)
- Startup Wiring → Brand Repository: constructs (evidence: `src/StorageSystem.Console/Program.cs`)
- Startup Wiring → Product Repository: constructs (evidence: `src/StorageSystem.Console/Program.cs`)
- Startup Wiring → Brand Service: constructs (evidence: `src/StorageSystem.Console/Program.cs`)
- Startup Wiring → Product Service: constructs (evidence: `src/StorageSystem.Console/Program.cs`)
- Startup Wiring → Brand Menu: constructs (evidence: `src/StorageSystem.Console/Program.cs`)
- Startup Wiring → Product Menu: constructs (evidence: `src/StorageSystem.Console/Program.cs`)
- Startup Wiring → Product Updates: constructs (evidence: `src/StorageSystem.Console/Program.cs`)
- Startup Wiring → Main Menu: runs (evidence: `src/StorageSystem.Console/Program.cs`)
- Main Menu → Brand Menu: dispatches (evidence: `src/StorageSystem.Console/UI/Menu.cs`)
- Main Menu → Product Menu: dispatches (evidence: `src/StorageSystem.Console/UI/Menu.cs`)
- Product Menu → Product Updates: opens (evidence: `src/StorageSystem.Console/UI/Product/ProductMenu.cs`)
- Brand Menu → Brand Service: calls (evidence: `src/StorageSystem.Console/UI/Brand/BrandMenu.cs`)
- Product Menu → Product Service: calls (evidence: `src/StorageSystem.Console/UI/Product/ProductMenu.cs`)
- Product Updates → Product Service: calls (evidence: `src/StorageSystem.Console/UI/Product/UpdateMenu.cs`)
- Brand Service → Brand Contract: uses (evidence: `src/StorageSystem.Application/Services/BrandService.cs`)
- Product Service → Product Contract: uses (evidence: `src/StorageSystem.Application/Services/ProductService.cs`)
- Brand Service → Brand Entity: creates and mutates (evidence: `src/StorageSystem.Application/Services/BrandService.cs`)
- Product Service → Product Entity: creates and mutates (evidence: `src/StorageSystem.Application/Services/ProductService.cs`)
- Product Service → Brand Entity: checks brand (evidence: `src/StorageSystem.Application/Services/ProductService.cs`)
- Brand Entity → Validation Guards: validates with (evidence: `src/StorageSystem.Domain/Entities/Brand.cs`)
- Product Entity → Validation Guards: validates with (evidence: `src/StorageSystem.Domain/Entities/Product.cs`)
- Product Entity → Domain Error: throws (evidence: `src/StorageSystem.Domain/Entities/Product.cs`)
- Brand Repository → EF Context: queries and saves (evidence: `src/StorageSystem.Infrastructure/Repository/BrandRepository.cs`)
- Product Repository → EF Context: queries and saves (evidence: `src/StorageSystem.Infrastructure/Repository/ProductRepository.cs`)
- EF Context → Brand Entity: maps (evidence: `src/StorageSystem.Infrastructure/Data/StorageContext.cs`)
- EF Context → Product Entity: maps (evidence: `src/StorageSystem.Infrastructure/Data/StorageContext.cs`)
- EF Context → SQL Server: persists through (evidence: `README.md`)
