# votrongnhia1234/productmanagement architecture

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

- Interactive diagram: https://gitdiagram.com/votrongnhia1234/productmanagement
- Repository: https://github.com/votrongnhia1234/productmanagement

## Overview

##### Project type and purpose
- This is a full-stack ASP.NET Core MVC web application named “ProductManagement.”
- Purpose: provide CRUD operations on Products and Categories via a web UI, backed by a relational database (Entity Framework Core).

##### File structure
- Top-level folders:
- Controllers – MVC controllers handling HTTP requests.
- Models – domain models (Product, Category) and view models.
- Views – Razor view templates for rendering HTML.
- Data – EF Core DbContext and factory.
- Repositories – abstraction over data access, with EF implementations and in-memory stubs.
- Migrations – EF schema migrations.
- wwwroot – static assets (CSS, JS, images, third-party libs).
- Configuration: appsettings.json(s), launchSettings.json.
- Build: .csproj, solution file, Program.cs bootstrapping the web host.

##### README
- Minimal: confirms “ProductManagement” but no architecture overview.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        Browser["Web Browser"]:::client
        subgraph "Static Assets"
            SiteJS["site.js"]:::static
            PriceJS["price-formatter.js"]:::static
            SiteCSS["site.css"]:::static
            LibAssets["lib/"]:::static
        end
    end

    %% Server Layer
    subgraph "Server Layer"
        WebHost["Web Host (Kestrel/IIS)"]:::server
        subgraph "Presentation Layer"
            Controllers["Controllers"]:::presentation
            Views["Razor Views"]:::presentation
        end
        Config["Configuration Providers"]:::config
    end

    %% Business/Data Layer
    subgraph "Business/Data Layer"
        Domain["Domain & View Models"]:::domain
        RepoInterfaces["Repository Interfaces"]:::data
        RepoImplementations["EF Repository Implementations"]:::data
        DbContext["ApplicationDbContext"]:::data
        Migrations["EF Migrations"]:::data
    end

    %% Persistence
    Database["Relational Database"]:::db

    %% Connections
    Browser -->|"HTTP request/response"| WebHost
    WebHost -->|serves| SiteJS
    WebHost -->|serves| PriceJS
    WebHost -->|serves| SiteCSS
    WebHost -->|serves| LibAssets
    WebHost -->|routes to| Controllers
    Controllers -->|renders via| Views
    Controllers -->|uses| Domain
    Controllers -->|calls| RepoInterfaces
    RepoInterfaces -->|implemented by| RepoImplementations
    RepoImplementations -->|uses| DbContext
    DbContext -->|queries| Database
    Migrations -->|updates schema| Database
    Config -->|provides settings| WebHost

    %% Click Events
    click SiteJS "https://github.com/votrongnhia1234/productmanagement/blob/main/wwwroot/js/site.js"
    click PriceJS "https://github.com/votrongnhia1234/productmanagement/blob/main/wwwroot/js/price-formatter.js"
    click SiteCSS "https://github.com/votrongnhia1234/productmanagement/blob/main/wwwroot/css/site.css"
    click LibAssets "https://github.com/votrongnhia1234/productmanagement/tree/main/wwwroot/lib/"
    click WebHost "https://github.com/votrongnhia1234/productmanagement/blob/main/Program.cs"
    click Controllers "https://github.com/votrongnhia1234/productmanagement/blob/main/Controllers/HomeController.cs"
    click Controllers "https://github.com/votrongnhia1234/productmanagement/blob/main/Controllers/ProductController.cs"
    click Controllers "https://github.com/votrongnhia1234/productmanagement/blob/main/Controllers/CategoryController.cs"
    click Views "https://github.com/votrongnhia1234/productmanagement/blob/main/Views/Home/*.cshtml"
    click Views "https://github.com/votrongnhia1234/productmanagement/blob/main/Views/Product/*.cshtml"
    click Views "https://github.com/votrongnhia1234/productmanagement/blob/main/Views/Category/*.cshtml"
    click Views "https://github.com/votrongnhia1234/productmanagement/blob/main/Views/Shared/*.cshtml"
    click Views "https://github.com/votrongnhia1234/productmanagement/blob/main/Views/_ViewImports.cshtml"
    click Views "https://github.com/votrongnhia1234/productmanagement/blob/main/Views/_ViewStart.cshtml"
    click Config "https://github.com/votrongnhia1234/productmanagement/blob/main/appsettings.json"
    click Config "https://github.com/votrongnhia1234/productmanagement/blob/main/appsettings.Development.json"
    click Config "https://github.com/votrongnhia1234/productmanagement/blob/main/Properties/launchSettings.json"
    click Domain "https://github.com/votrongnhia1234/productmanagement/blob/main/Models/Product.cs"
    click Domain "https://github.com/votrongnhia1234/productmanagement/blob/main/Models/Category.cs"
    click Domain "https://github.com/votrongnhia1234/productmanagement/blob/main/Models/ProductViewModel.cs"
    click Domain "https://github.com/votrongnhia1234/productmanagement/blob/main/Models/CategoryViewModel.cs"
    click Domain "https://github.com/votrongnhia1234/productmanagement/blob/main/Models/ErrorViewModel.cs"
    click RepoInterfaces "https://github.com/votrongnhia1234/productmanagement/blob/main/Repositories/ICategoryRepository.cs"
    click RepoInterfaces "https://github.com/votrongnhia1234/productmanagement/blob/main/Repositories/IProductRepository.cs"
    click RepoInterfaces "https://github.com/votrongnhia1234/productmanagement/blob/main/Repositories/IMemoryProductRepository.cs"
    click RepoImplementations "https://github.com/votrongnhia1234/productmanagement/blob/main/Repositories/EF/EFCategoryRepository.cs"
    click RepoImplementations "https://github.com/votrongnhia1234/productmanagement/blob/main/Repositories/EF/EFProductRepository.cs"
    click RepoImplementations "https://github.com/votrongnhia1234/productmanagement/blob/main/Repositories/CategoryRepository.cs"
    click RepoImplementations "https://github.com/votrongnhia1234/productmanagement/blob/main/Repositories/ProductRepository(Del).cs"
    click DbContext "https://github.com/votrongnhia1234/productmanagement/blob/main/Data/ApplicationDbContext.cs"
    click DbContext "https://github.com/votrongnhia1234/productmanagement/blob/main/Data/ApplicationDbContextFactory.cs"
    click Migrations "https://github.com/votrongnhia1234/productmanagement/blob/main/Migrations/20250525141857_InitialCreate.cs"
    click Migrations "https://github.com/votrongnhia1234/productmanagement/blob/main/Migrations/20250525141857_InitialCreate.Designer.cs"
    click Migrations "https://github.com/votrongnhia1234/productmanagement/blob/main/Migrations/ApplicationDbContextModelSnapshot.cs"
    click Database "https://github.com/votrongnhia1234/productmanagement/blob/main/ProductManagement.sln"
    click Database "https://github.com/votrongnhia1234/productmanagement/blob/main/ProductManagement.csproj"

    %% Styles
    classDef client fill:#ffe4e1,stroke:#333,stroke-width:1px
    classDef static fill:#e1f5fe,stroke:#333,stroke-width:1px
    classDef server fill:#e8f5e9,stroke:#333,stroke-width:1px
    classDef presentation fill:#fff3e0,stroke:#333,stroke-width:1px
    classDef data fill:#f3e5f5,stroke:#333,stroke-width:1px
    classDef domain fill:#f1f8e9,stroke:#333,stroke-width:1px
    classDef config fill:#ffebee,stroke:#333,stroke-width:1px
    classDef db fill:#ffccbc,stroke:#333,stroke-width:1px
```
