# habibor-rahaman1010/asp-net-batch-10 architecture

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

- Interactive diagram: https://gitdiagram.com/habibor-rahaman1010/asp-net-batch-10
- Repository: https://github.com/habibor-rahaman1010/asp-net-batch-10

## Overview

1. **Overall shape**
   This is a layered ASP.NET Core solution built around an inventory domain. The solution is split into four main runtime projects: a web UI, an application-services layer, a domain model, and an infrastructure layer, plus a separate worker service and a test project.

2. **Presentation boundary: `DevSkill.Inventory.Web`**
   The web project is the user-facing host. It uses ASP.NET Core MVC with Areas, especially an `Admin` area for inventory maintenance screens. It contains controllers, Razor views, partials, view models, and static assets from AdminLTE/Bootstrap/jQuery. This is the primary entry point for human users.

3. **Web module responsibilities**
   The web layer owns request handling, form/view models, AutoMapper profiles, and UI composition. Controllers such as `ProductController`, `CategoryController`, `BrandController`, `StockAdjustmentController`, and `DashboardController` map user actions to application services. `AccountController` handles authentication-related flows like login, registration, and email confirmation.

4. **Application layer: orchestration and business use cases**
   `DevSkill.Inventory.Application` contains the management services for each business capability: products, categories, subcategories, brands, units, taxes, locations, warranties, product types, barcode types, adjustment types, and stock adjustments. These services are the main orchestration boundary between UI and persistence and are exposed through matching service contracts.

5. **Domain model: core business concepts**
   `DevSkill.Inventory.Domain` defines the inventory language of the system: entities such as `Product`, `Brand`, `Category`, `StockAdjustment`, `BusinessLocation`, `Unit`, `Warranty`, and tax-related types. It also holds DTOs for product search/listing, enums like `ProductStatus` and `AllowDecimal`, and shared abstractions such as repository contracts, unit-of-work contracts, and utility interfaces.

6. **Infrastructure layer: persistence and concrete services**
   `DevSkill.Inventory.Infrastructure` provides the implementations for domain abstractions. It includes repository classes, unit-of-work implementations, EF Core `DbContext`s, application time abstraction, email utility, SQL utility, Razor utility, TempData helpers, and the concrete inventory identity classes. This is the bridge from the pure domain/application layers to actual runtime dependencies.

7. **Data storage boundary**
   There are two distinct database contexts: `ApplicationDbContext` for identity/authentication data and `InventoryDbContext` for inventory business data. The web project carries EF Core migrations for both contexts, indicating that the web host is responsible for creating and evolving the databases during deployment.

8. **Identity and authorization**
   Authentication is implemented with custom ASP.NET Core Identity types in the infrastructure project: users, roles, claims, logins, tokens, managers, and a custom `AgeRequirement`. This suggests authorization is not just role-based; it also includes policy/requirement-based access control. The account views and admin user-management screens depend on this identity subsystem.

9. **Inventory feature flow**
   The common flow for business features is: browser request → MVC controller/view model → application management service → repository/unit-of-work abstraction → EF Core context → database. The admin screens are CRUD-heavy and centered on catalog/master-data management, with stock adjustment and product maintenance as the more transaction-oriented parts of the domain.

10. **Worker process**
    `DevSkill.Inventory.WorkerService` is a separate .NET worker host with its own `Program`, `Worker`, and module registration. The tree does not show what jobs it runs, but architecturally it is a background execution boundary separate from the web UI, likely intended for scheduled or asynchronous processing using the same solution conventions.

11. **Cross-cutting concerns**
    Email sending, current time abstraction, SQL helpers, and TempData helpers are separated into reusable services rather than being embedded in controllers. This indicates an attempt to keep business/application logic testable and to isolate external concerns from the domain.

12. **Testing strategy**
    The test project focuses on application-service tests for products, categories, brands, business locations, product types, and stock adjustments. That implies the critical logic is expected to live in the application layer, with tests validating orchestration and business rules there rather than in the web layer.

Main entry points: [`DevSlkill.Inventory/DevSkill.Inventory.Application/Services/ProductManagementService.cs`](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Application/Services/ProductManagementService.cs) (Mgmt services), [`DevSlkill.Inventory/DevSkill.Inventory.Domain/RepositoryContracts/IRepositoryBase.cs`](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Domain/RepositoryContracts/IRepositoryBase.cs) (Contracts), [`DevSlkill.Inventory/DevSkill.Inventory.Web/Areas/Admin/Controllers/ProductController.cs`](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Web/Areas/Admin/Controllers/ProductController.cs) (Admin area), [`DevSlkill.Inventory/DevSkill.Inventory.Web/Program.cs`](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Web/Program.cs) (Web host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web UI"]
  node_web_host["Web host<br/>ASP.NET Core host<br/>[Program.cs]"]
  node_admin_area["Admin area<br/>MVC area"]
  node_account_ui["Account UI<br/>auth controllers/views"]
  node_web_models["View models<br/>UI models"]
  node_web_mapping["Mapping<br/>AutoMapper profile<br/>[WebProfile.cs]"]
end

subgraph group_app["Application"]
  node_app_services["Mgmt services<br/>application services"]
  node_app_contracts["Service contracts<br/>service interfaces"]
end

subgraph group_domain["Domain"]
  node_domain_entities[("Entities<br/>[Product.cs]")]
  node_domain_dtos["DTOs<br/>query models<br/>[ProductDto.cs]"]
  node_domain_contracts["Contracts<br/>abstractions<br/>[IRepositoryBase.cs]"]
  node_domain_enums["Enums<br/>[ProductStatus.cs]"]
end

subgraph group_infra["Infrastructure"]
  node_infra_repos["Repositories"]
  node_infra_uow["Unit of work<br/>transaction boundary"]
  node_identity[("Identity<br/>[ApplicationUser.cs]")]
  node_infra_db[("Db contexts<br/>EF Core contexts")]
  node_infra_utils["Utilities<br/>cross-cutting services<br/>[EmailUtility.cs]"]
end

subgraph group_worker["Worker"]
  node_worker_host["Worker host<br/>background host<br/>[Program.cs]"]
  node_worker_module["Worker module<br/>module registration<br/>[WorkerModule.cs]"]
end

subgraph group_tests["Tests"]
  node_test_suite["App tests<br/>xUnit tests"]
end

subgraph group_data["Database"]
end

node_web_host -->|"hosts"| node_admin_area
node_web_host -->|"hosts"| node_account_ui
node_admin_area -->|"binds"| node_web_models
node_admin_area -->|"calls"| node_app_contracts
node_account_ui -->|"auth"| node_identity
node_web_mapping -->|"maps"| node_domain_entities
node_web_mapping -->|"maps"| node_web_models
node_app_services -->|"implements"| node_app_contracts
node_app_services -->|"uses"| node_domain_contracts
node_app_services -->|"operates"| node_domain_entities
node_app_services -->|"returns"| node_domain_dtos
node_infra_repos -->|"implements"| node_domain_contracts
node_infra_repos -->|"persists"| node_domain_entities
node_infra_uow -->|"implements"| node_domain_contracts
node_infra_uow -->|"wraps"| node_infra_db
node_identity -->|"stores"| node_infra_db
node_infra_utils -->|"implements"| node_domain_contracts
node_worker_host -->|"loads"| node_worker_module
node_worker_host -->|"uses"| node_infra_utils
node_test_suite -->|"verifies"| node_app_services
node_test_suite -->|"mocks"| node_domain_contracts
node_web_host -->|"depends"| node_app_services
node_app_services -->|"runs on"| node_infra_repos
node_account_ui -->|"binds"| node_web_models
node_admin_area -->|"manages"| node_identity

click node_web_host "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Web/Program.cs"
click node_admin_area "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Web/Areas/Admin/Controllers/ProductController.cs"
click node_account_ui "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Web/Controllers/Account/AccountController.cs"
click node_web_models "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Web/Areas/Admin/Models/ProductCreateModel.cs"
click node_web_mapping "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Web/AutoMapProfile/WebProfile.cs"
click node_app_services "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Application/Services/ProductManagementService.cs"
click node_app_contracts "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Application/ServicesContract/IProductManagementService.cs"
click node_domain_entities "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Domain/Entities/Product.cs"
click node_domain_dtos "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Domain/Dtos/ProductDto.cs"
click node_domain_contracts "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Domain/RepositoryContracts/IRepositoryBase.cs"
click node_domain_enums "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Domain/Enums/ProductStatus.cs"
click node_infra_repos "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/Repositories/ProductRepository.cs"
click node_infra_uow "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/UnitOfWork/InventoryUnitOfWork.cs"
click node_identity "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/InventoryIdentity/ApplicationUser.cs"
click node_infra_db "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/Data/InventoryDbContext.cs"
click node_infra_utils "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/EmailUtility.cs"
click node_worker_host "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.WorkerService/Program.cs"
click node_worker_module "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.WorkerService/WorkerModules/WorkerModule.cs"
click node_test_suite "https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/tests/DevSkill.Inventory.Application.Tests/ProductManagementServiceTests.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_web_host,node_admin_area,node_account_ui,node_web_models,node_web_mapping toneBlue
class node_app_services,node_app_contracts toneAmber
class node_domain_entities,node_domain_dtos,node_domain_contracts,node_domain_enums toneMint
class node_infra_repos,node_infra_uow,node_identity,node_infra_db,node_infra_utils toneRose
class node_worker_host,node_worker_module toneIndigo
class node_test_suite toneTeal
```

## Components

### Web UI

ASP.NET Core MVC host and admin presentation layer

- [Web host](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Web/Program.cs): ASP.NET Core host · Main user-facing entry point for MVC and areas · `DevSlkill.Inventory/DevSkill.Inventory.Web/Program.cs`
- [Admin area](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Web/Areas/Admin/Controllers/ProductController.cs): MVC area · Back-office screens for inventory maintenance and identity admin · `DevSlkill.Inventory/DevSkill.Inventory.Web/Areas/Admin/Controllers/ProductController.cs`
- [Account UI](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Web/Controllers/Account/AccountController.cs): auth controllers/views · Login, registration, email confirmation, and access denied flows · `DevSlkill.Inventory/DevSkill.Inventory.Web/Controllers/Account/AccountController.cs`
- [View models](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Web/Areas/Admin/Models/ProductCreateModel.cs): UI models · Presentation-specific create, list, update, and auth models · `DevSlkill.Inventory/DevSkill.Inventory.Web/Areas/Admin/Models/ProductCreateModel.cs`
- [Mapping](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Web/AutoMapProfile/WebProfile.cs): AutoMapper profile · Maps domain and service shapes to web view models · `DevSlkill.Inventory/DevSkill.Inventory.Web/AutoMapProfile/WebProfile.cs`

### Application

Use-case orchestration and management services

- [Mgmt services](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Application/Services/ProductManagementService.cs): application services · Orchestrates inventory use cases across master data and stock flows · `DevSlkill.Inventory/DevSkill.Inventory.Application/Services/ProductManagementService.cs`
- [Service contracts](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Application/ServicesContract/IProductManagementService.cs): service interfaces · Application-layer boundaries consumed by controllers and tests · `DevSlkill.Inventory/DevSkill.Inventory.Application/ServicesContract/IProductManagementService.cs`

### Domain

Core inventory model and shared contracts

- [Entities](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Domain/Entities/Product.cs): domain entities · Inventory aggregates and core business concepts · `DevSlkill.Inventory/DevSkill.Inventory.Domain/Entities/Product.cs`
- [DTOs](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Domain/Dtos/ProductDto.cs): query models · Product search and listing data transfer shapes · `DevSlkill.Inventory/DevSkill.Inventory.Domain/Dtos/ProductDto.cs`
- [Contracts](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Domain/RepositoryContracts/IRepositoryBase.cs): abstractions · Repository, unit-of-work, time, email, and SQL abstractions · `DevSlkill.Inventory/DevSkill.Inventory.Domain/RepositoryContracts/IRepositoryBase.cs`
- [Enums](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Domain/Enums/ProductStatus.cs): value enums · Shared domain state such as product status and decimal rules · `DevSlkill.Inventory/DevSkill.Inventory.Domain/Enums/ProductStatus.cs`

### Infrastructure

Persistence, identity, and concrete integrations

- [Repositories](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/Repositories/ProductRepository.cs): EF repositories · Concrete persistence adapters for inventory aggregates · `DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/Repositories/ProductRepository.cs`
- [Unit of work](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/UnitOfWork/InventoryUnitOfWork.cs): transaction boundary · Coordinates repository commits for inventory persistence · `DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/UnitOfWork/InventoryUnitOfWork.cs`
- [Identity](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/InventoryIdentity/ApplicationUser.cs): ASP.NET Identity · Custom user, role, manager, and authorization requirement types · `DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/InventoryIdentity/ApplicationUser.cs`
- [Db contexts](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/Data/InventoryDbContext.cs): EF Core contexts · Application and inventory database contexts · `DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/Data/InventoryDbContext.cs`
- [Utilities](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/EmailUtility.cs): cross-cutting services · Email, time, Razor, SQL, and TempData helpers · `DevSlkill.Inventory/DevSkill.Inventory.Infrastructure/EmailUtility.cs`

### Worker

Background execution host

- [Worker host](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.WorkerService/Program.cs): background host · Separate .NET worker process for asynchronous jobs · `DevSlkill.Inventory/DevSkill.Inventory.WorkerService/Program.cs`
- [Worker module](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/DevSlkill.Inventory/DevSkill.Inventory.WorkerService/WorkerModules/WorkerModule.cs): module registration · Worker-specific dependency registration and wiring · `DevSlkill.Inventory/DevSkill.Inventory.WorkerService/WorkerModules/WorkerModule.cs`

### Tests

Application-service test suite

- [App tests](https://github.com/habibor-rahaman1010/asp-net-batch-10/blob/development/tests/DevSkill.Inventory.Application.Tests/ProductManagementServiceTests.cs): xUnit tests · Validates application-service orchestration and business rules · `tests/DevSkill.Inventory.Application.Tests/ProductManagementServiceTests.cs`

## Connections

- Web host → Admin area: hosts · ASP.NET Core MVC serves the admin area and UI routes
- Web host → Account UI: hosts · Main web host serves account and public pages
- Admin area → View models: binds · Controllers use presentation models for requests and responses
- Admin area → Service contracts: calls · Admin controllers depend on application service interfaces
- Account UI → Identity: auth · Authentication and authorization flow through the identity subsystem
- Mapping → Entities: maps · Web mapping profiles translate domain shapes to UI models
- Mapping → View models: maps · Profiles populate form and list models for views
- Mgmt services → Service contracts: implements · Concrete management services fulfill application contracts
- Mgmt services → Contracts: uses · Services coordinate through repository and unit-of-work abstractions
- Mgmt services → Entities: operates · Business logic centers on inventory entities
- Mgmt services → DTOs: returns · Query and listing operations produce DTOs
- Repositories → Contracts: implements · Repositories satisfy the domain repository interfaces
- Repositories → Entities: persists · Repositories load and store inventory entities
- Unit of work → Contracts: implements · Unit-of-work classes realize domain transaction contracts
- Unit of work → Db contexts: wraps · Unit of work coordinates EF Core database contexts
- Identity → Db contexts: stores · Identity types are backed by the application database context
- Utilities → Contracts: implements · Utilities provide concrete email, time, SQL, and Razor services
- Worker host → Worker module: loads · Worker startup wires services through module registration
- Worker host → Utilities: uses · Background jobs reuse shared utility services
- App tests → Mgmt services: verifies · Tests focus on management-service behavior and orchestration
- App tests → Contracts: mocks · Application tests likely substitute repository abstractions
- Web host → Mgmt services: depends · Web startup resolves application services for controllers
- Mgmt services → Repositories: runs on · Application workflows are backed by repository implementations
- Account UI → View models: binds · Account forms use dedicated signin and registration models
- Admin area → Identity: manages · Admin user-management screens depend on custom identity types
