# kietpham-vn/bulkyweb architecture

> Architecture diagram of the GitHub repository kietpham-vn/bulkyweb, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kietpham-vn/bulkyweb
- Repository: https://github.com/kietpham-vn/bulkyweb

## Overview

##### Main Architectural Components

a) Presentation Layer (Top)
- BulkyWeb (ASP.NET Core MVC Application)
- Areas
- Admin Area (Administrative functions)
- Customer Area (Public-facing features)
- Identity Area (Authentication/Authorization)
- Views/Controllers structure

b) Business/Domain Layer (Middle)
- Bulky.Models
- Domain entities (Category, Product, ApplicationUser)
- ViewModels

c) Data Access Layer (Bottom)
- Bulky.DataAccess
- Repository Pattern implementation
- Entity Framework Core context
- Migrations

d) Cross-Cutting Concerns (Side)
- Bulky.Utilities
- Email services
- Static details (SD)
- Common utilities

##### Component Relationships

**[Web Layer (BulkyWeb)]**
- ↑↓
**[Business Layer (Bulky.Models)]**
- ↑↓
**[Data Access Layer (BulkyDataAccess)]**
- ↑↓
**[Database]**

**[Utilities] → [All Layers]**

##### Specific Elements

a) Web Layer Details:
- MVC Controllers
- Area-specific components
- Identity management
- Static files (wwwroot)

b) Business Layer Details:
- Entity models
- View models
- Data transfer objects

c) Data Access Layer Details:
- Repository interfaces
- Repository implementations
- DbContext
- Unit of Work pattern

d) Database Interactions:
- Entity Framework Core
- Migration handling
- Data persistence

##### Technical Stack Indicators

Technologies:
- ASP.NET Core MVC
- Entity Framework Core
- Identity Framework
- Bootstrap/jQuery (Client-side)
- SQL Server (Database)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Presentation Layer"
        BulkyWeb["BulkyWeb (ASP.NET Core MVC)"]:::web
        
        subgraph "Areas"
            AdminArea["Admin Area"]:::web
            CustomerArea["Customer Area"]:::web
            IdentityArea["Identity Area"]:::web
            
            AdminControllers["Admin Controllers"]:::controller
            CustomerControllers["Customer Controllers"]:::controller
        end
        
        StaticFiles["Static Files (wwwroot)"]:::web
    end
    
    subgraph "Business Layer"
        DomainEntities["Domain Entities"]:::domain
        ViewModels["View Models"]:::domain
        
        Category["Category"]:::model
        Product["Product"]:::model
        ApplicationUser["ApplicationUser"]:::model
        ProductVM["ProductVM"]:::model
    end
    
    subgraph "Data Access Layer"
        DbContext["ApplicationDbContext"]:::data
        
        subgraph "Repository Pattern"
            IRepository["IRepository<T>"]:::interface
            CategoryRepo["CategoryRepository"]:::repo
            ProductRepo["ProductRepository"]:::repo
            
            IUnitOfWork["IUnitOfWork"]:::interface
            UnitOfWork["UnitOfWork"]:::repo
        end
        
        Migrations["Migrations"]:::data
        Database[(Database)]:::database
    end
    
    subgraph "Cross-Cutting Concerns"
        EmailService["Email Service"]:::utility
        StaticDetails["Static Details (SD)"]:::utility
    end
    
    %% Relationships
    BulkyWeb --> AdminArea
    BulkyWeb --> CustomerArea
    BulkyWeb --> IdentityArea
    
    AdminArea --> AdminControllers
    CustomerArea --> CustomerControllers
    
    AdminControllers --> DomainEntities
    CustomerControllers --> DomainEntities
    
    DomainEntities --> Category
    DomainEntities --> Product
    DomainEntities --> ApplicationUser
    ViewModels --> ProductVM
    
    IRepository --> DbContext
    CategoryRepo --> IRepository
    ProductRepo --> IRepository
    
    UnitOfWork --> IUnitOfWork
    IUnitOfWork --> IRepository
    
    DbContext --> Database
    DbContext --> Migrations
    
    %% Cross-cutting concerns connections
    EmailService -.-> BulkyWeb
    StaticDetails -.-> BulkyWeb
    
    %% Click events
    click AdminArea "https://github.com/KietPham-VN/BulkyWeb/tree/main/BulkyWeb/Areas/Admin/"
    click CustomerArea "https://github.com/KietPham-VN/BulkyWeb/tree/main/BulkyWeb/Areas/Customer/"
    click IdentityArea "https://github.com/KietPham-VN/BulkyWeb/tree/main/BulkyWeb/Areas/Identity/"
    click Category "https://github.com/KietPham-VN/BulkyWeb/blob/main/Bulky.Models/Category.cs"
    click Product "https://github.com/KietPham-VN/BulkyWeb/blob/main/Bulky.Models/Product.cs"
    click ApplicationUser "https://github.com/KietPham-VN/BulkyWeb/blob/main/Bulky.Models/ApplicationUser.cs"
    click ProductVM "https://github.com/KietPham-VN/BulkyWeb/blob/main/Bulky.Models/ViewModels/ProductVM.cs"
    click DbContext "https://github.com/KietPham-VN/BulkyWeb/blob/main/BulkyDataAccess/Data/ApplicationDbContext.cs"
    click IRepository "https://github.com/KietPham-VN/BulkyWeb/blob/main/BulkyDataAccess/Repository/IRepository/IRepository.cs"
    click CategoryRepo "https://github.com/KietPham-VN/BulkyWeb/blob/main/BulkyDataAccess/Repository/CategoryRepository.cs"
    click ProductRepo "https://github.com/KietPham-VN/BulkyWeb/blob/main/BulkyDataAccess/Repository/ProductRepository.cs"
    click IUnitOfWork "https://github.com/KietPham-VN/BulkyWeb/blob/main/BulkyDataAccess/Repository/IRepository/IUnitOfWork.cs"
    click UnitOfWork "https://github.com/KietPham-VN/BulkyWeb/blob/main/BulkyDataAccess/Repository/UnitOfWork.cs"
    click Migrations "https://github.com/KietPham-VN/BulkyWeb/tree/main/BulkyDataAccess/Migrations/"
    click EmailService "https://github.com/KietPham-VN/BulkyWeb/blob/main/Bulky.Utilities/EmailSender.cs"
    click StaticDetails "https://github.com/KietPham-VN/BulkyWeb/blob/main/Bulky.Utilities/SD.cs"
    click AdminControllers "https://github.com/KietPham-VN/BulkyWeb/blob/main/BulkyWeb/Areas/Admin/Controllers/CategoryController.cs"
    click CustomerControllers "https://github.com/KietPham-VN/BulkyWeb/blob/main/BulkyWeb/Areas/Customer/Controllers/HomeController.cs"
    
    %% Styles
    classDef web fill:#2196F3,color:white
    classDef controller fill:#1976D2,color:white
    classDef domain fill:#4CAF50,color:white
    classDef model fill:#388E3C,color:white
    classDef data fill:#FF9800,color:white
    classDef repo fill:#F57C00,color:white
    classDef interface fill:#FFA726,color:white
    classDef database fill:#E65100,color:white
    classDef utility fill:#9E9E9E,color:white
    
    %% Legend
    subgraph Legend
        WebComponent["Web Component"]:::web
        DomainComponent["Domain Component"]:::domain
        DataComponent["Data Component"]:::data
        UtilityComponent["Utility Component"]:::utility
    end
```
