# byseif21/depi-e-commerce-.net-project architecture

> Architecture diagram of the GitHub repository byseif21/depi-e-commerce-.net-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/byseif21/depi-e-commerce-.net-project
- Repository: https://github.com/byseif21/depi-e-commerce-.net-project

## Overview

1. **Overall shape**  
   Styleza is a classic **ASP.NET Core MVC (.NET 8) monolith** for e-commerce. The runtime path is: browser requests hit MVC controllers, controllers use EF Core/Identity-backed services and models, then render **Razor views** with Bootstrap-based static assets.

2. **Presentation layer**  
   UI lives in `Views/` plus `Areas/Identity/Pages/` for auth UI. Shared layout and reusable fragments are centralized in `Views/Shared/` (`_Layout`, `_LoginPartial`, `_ProductCard`, `_Footer`, loader/error partials). Styling and client behavior are split across feature-specific files in `wwwroot/css` and `wwwroot/js`.

3. **Application boundaries by controller**  
   The main functional boundaries are the controllers: `Home`, `Products`, `Category`, `Cart`, `Order`, `Account`, and `Admin`. Each controller maps to a dedicated view folder, which makes the app organized by business capability rather than by technical layer.

4. **Identity and user account flow**  
   Authentication is built on **ASP.NET Core Identity**. The repo includes the Identity area plus custom account views and models for login, registration, password reset, confirmation, and lockout. `AccountController` likely wraps or extends these flows, while `Services/EmailSender.cs` supports confirmation/reset email delivery.

5. **Catalog domain and data model**  
   The product catalog is modeled in `Models/Product`, `Category`, `SubCategory`, and `ProductImage`. These objects form the core browse/search/shop experience and are likely the main data shape returned to `ProductsController`, `CategoryController`, and the home page.

6. **Shopping cart and wishlist flow**  
   `Cart`, `CartItem`, and `Wishlist` are separate domain objects, indicating user-specific shopping state. `CartController` and `Views/Home/Wishlist.cshtml` suggest a flow where users add products from catalog views, manage quantities/items in the cart, and persist or display wishlist state.

7. **Order and checkout flow**  
   Orders are modeled explicitly with `Order` and `OrderItem`. The checkout UI is split into `Views/Checkout/Checkout.cshtml` and `OrderConfirmation.cshtml`, so the data flow is: cart contents are converted into an order, order items are stored, then the confirmation view summarizes the result.

8. **Admin subsystem**  
   `AdminController` and the `Views/Admin/` folder form a separate management boundary for back-office tasks: product CRUD, category CRUD, user management, order management, and order details. This is the main operational surface for staff rather than customers.

9. **Persistence layer**  
   `Data/ApplicationDbContext.cs` is the EF Core persistence boundary. It likely maps all ecommerce entities plus Identity tables to SQL Server, with `Data/DbSeeder.cs` providing initial data or bootstrapping for categories, products, users, or order-related reference data.

10. **View models and form models**  
   The `Models/` folder also contains request/view models such as `LoginModel`, `RegisterModel`, `ForgotPasswordModel`, `ResetPasswordModel`, `ContactFormModel`, and `ShopViewModel`. These indicate the app avoids binding UI directly to persistence entities when a screen needs tailored input or aggregated data.

11. **Reusable server-side helpers**  
   `Extensions/ControllerExtensions.cs` suggests shared controller helper behavior, likely for consistent redirects, notifications, or user/context access. This is a small cross-cutting layer rather than a separate subsystem.

12. **Static frontend assets and behavior**  
   `wwwroot/` contains the app’s full client-side footprint: Bootstrap libraries, page-specific CSS, and JavaScript for cart, wishlist, validation, loader behavior, and shop interactions. This means the UI is mostly server-rendered, with lightweight enhancement scripts rather than a SPA frontend.

13. **Configuration and environment**  
   `Program.cs` is the composition root where MVC, Identity, EF Core, and services are wired together. Connection settings live in `appsettings.json`, and the presence of `launchSettings.json` plus `serviceDependencies` files indicates local environment and deployment configuration are part of the project setup.

14. **Non-runtime repo artifacts**  
   `ecommerce_data/` contains spreadsheet files that look like seed/reference datasets for carts, products, orders, users, and shipping methods. They are not part of the app’s request flow, but they likely support data preparation, import, or presentation/demo material.

15. **External/automation boundary**  
   `.github/workflows/label-pr.yml` is the only visible CI automation and is focused on PR labeling, not build/deploy. It does not affect runtime architecture, but it shows the repo uses GitHub-based collaboration conventions.

Main entry points: [`Program.cs`](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Program.cs) (Program), [`Controllers/AdminController.cs`](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/AdminController.cs) (Admin), [`Controllers/ProductsController.cs`](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/ProductsController.cs) (Products), [`Controllers/AccountController.cs`](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/AccountController.cs) (Account)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_sharedviews["Shared Views<br/>razor partials<br/>[_Layout.cshtml]"]
  node_accountviews["Account Views<br/>razor pages<br/>[Login.cshtml]"]
  node_storefrontviews["Storefront Views<br/>razor views<br/>[Index.cshtml]"]
  node_adminviews["Admin Views<br/>razor views<br/>[Index.cshtml]"]
  node_identityarea["Identity Area<br/>asp.net identity<br/>[_ViewStart.cshtml]"]
  node_staticassets["Static Assets<br/>css/js/bootstrap<br/>[global.css]"]
end

subgraph group_application["Application"]
  node_program["Program<br/>composition root<br/>[Program.cs]"]
  node_emailsender["Email Sender<br/>notification service<br/>[EmailSender.cs]"]
  node_controllerext["Controller Ext<br/>mvc helper"]
  node_homectl["Home<br/>storefront controller<br/>[HomeController.cs]"]
  node_productctl["Products<br/>catalog controller"]
  node_categoryctl["Category<br/>catalog controller"]
  node_cartctl["Cart<br/>[CartController.cs]"]
  node_orderctl["Order<br/>checkout controller<br/>[OrderController.cs]"]
  node_accountctl["Account<br/>auth controller"]
  node_adminctl["Admin<br/>back-office controller<br/>[AdminController.cs]"]
end

subgraph group_domain["Domain"]
  node_catalogmodels["Catalog Models<br/>product domain<br/>[Product.cs]"]
  node_commercemodels["Commerce Models<br/>shopping domain<br/>[Cart.cs]"]
  node_authmodels["Auth Models<br/>form/view models<br/>[LoginModel.cs]"]
  node_shopviewmodel["Shop VM<br/>page model<br/>[ShopViewModel.cs]"]
end

subgraph group_persistence["Persistence"]
  node_dbcontext[("App Db<br/>ef core context")]
  node_dbseeder["Seeder<br/>bootstrap data<br/>[DbSeeder.cs]"]
end

node_program -->|"configures"| node_dbcontext
node_program -->|"registers"| node_emailsender
node_program -.->|"uses"| node_controllerext
node_program -->|"hosts"| node_homectl
node_program -->|"hosts"| node_productctl
node_program -->|"hosts"| node_cartctl
node_program -->|"hosts"| node_orderctl
node_program -->|"hosts"| node_accountctl
node_program -->|"hosts"| node_adminctl
node_homectl -->|"reads"| node_catalogmodels
node_productctl -->|"reads"| node_catalogmodels
node_categoryctl -->|"reads"| node_catalogmodels
node_cartctl -->|"updates"| node_commercemodels
node_orderctl -->|"creates"| node_commercemodels
node_accountctl -->|"binds"| node_authmodels
node_adminctl -->|"manages"| node_catalogmodels
node_adminctl -->|"manages"| node_commercemodels
node_adminctl -->|"persists"| node_dbcontext
node_homectl -->|"renders"| node_sharedviews
node_productctl -->|"renders"| node_storefrontviews
node_cartctl -->|"renders"| node_storefrontviews
node_orderctl -->|"renders"| node_storefrontviews
node_accountctl -->|"renders"| node_accountviews
node_adminctl -->|"renders"| node_adminviews
node_identityarea -.->|"complements"| node_accountctl
node_storefrontviews -->|"uses"| node_staticassets
node_adminviews -->|"uses"| node_staticassets
node_sharedviews -->|"uses"| node_staticassets
node_dbseeder -->|"seeds"| node_dbcontext
node_shopviewmodel -.->|"shapes"| node_productctl

click node_program "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Program.cs"
click node_dbcontext "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Data/ApplicationDbContext.cs"
click node_dbseeder "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Data/DbSeeder.cs"
click node_emailsender "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Services/EmailSender.cs"
click node_controllerext "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Extensions/ControllerExtensions.cs"
click node_homectl "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/HomeController.cs"
click node_productctl "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/ProductsController.cs"
click node_categoryctl "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/CategoryController.cs"
click node_cartctl "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/CartController.cs"
click node_orderctl "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/OrderController.cs"
click node_accountctl "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/AccountController.cs"
click node_adminctl "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/AdminController.cs"
click node_catalogmodels "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Models/Product.cs"
click node_commercemodels "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Models/Cart.cs"
click node_authmodels "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Models/LoginModel.cs"
click node_shopviewmodel "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Models/ShopViewModel.cs"
click node_sharedviews "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Views/Shared/_Layout.cshtml"
click node_accountviews "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Views/Account/Login.cshtml"
click node_storefrontviews "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Views/Home/Index.cshtml"
click node_adminviews "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Views/Admin/Index.cshtml"
click node_identityarea "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Areas/Identity/Pages/_ViewStart.cshtml"
click node_staticassets "https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/wwwroot/css/global.css"

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_sharedviews,node_accountviews,node_storefrontviews,node_adminviews,node_identityarea,node_staticassets toneBlue
class node_program,node_emailsender,node_controllerext,node_homectl,node_productctl,node_categoryctl,node_cartctl,node_orderctl,node_accountctl,node_adminctl toneAmber
class node_catalogmodels,node_commercemodels,node_authmodels,node_shopviewmodel toneMint
class node_dbcontext,node_dbseeder toneRose
```

## Components

### Presentation

MVC views, Razor pages, and static assets

- [Shared Views](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Views/Shared/_Layout.cshtml): razor partials · Layout, header/footer, login partial, product card, loader, and validation partials · `Views/Shared/_Layout.cshtml`
- [Account Views](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Views/Account/Login.cshtml): razor pages · Login, registration, password recovery, and lockout UI · `Views/Account/Login.cshtml`
- [Storefront Views](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Views/Home/Index.cshtml): razor views · Home, products, cart, checkout, and policy pages · `Views/Home/Index.cshtml`
- [Admin Views](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Views/Admin/Index.cshtml): razor views · Back-office management screens for catalog and orders · `Views/Admin/Index.cshtml`
- [Identity Area](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Areas/Identity/Pages/_ViewStart.cshtml): asp.net identity · Identity UI area used for auth-related pages · `Areas/Identity/Pages/_ViewStart.cshtml`
- [Static Assets](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/wwwroot/css/global.css): css/js/bootstrap · Feature CSS, client scripts, and bundled libraries · `wwwroot/css/global.css`

### Application

Controllers, services, and cross-cutting helpers

- [Program](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Program.cs): composition root · Wires MVC, Identity, EF Core, and services · `Program.cs`
- [Email Sender](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Services/EmailSender.cs): notification service · Sends account confirmation and reset emails · `Services/EmailSender.cs`
- [Controller Ext](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Extensions/ControllerExtensions.cs): mvc helper · Shared controller-side helper behavior · `Extensions/ControllerExtensions.cs`
- [Home](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/HomeController.cs): storefront controller · Landing pages, content pages, and wishlist entry points · `Controllers/HomeController.cs`
- [Products](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/ProductsController.cs): catalog controller · Browse, shop, and product preview flows · `Controllers/ProductsController.cs`
- [Category](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/CategoryController.cs): catalog controller · Category browsing and navigation · `Controllers/CategoryController.cs`
- [Cart](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/CartController.cs): cart controller · Cart management and quantity updates · `Controllers/CartController.cs`
- [Order](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/OrderController.cs): checkout controller · Checkout, order creation, and confirmation · `Controllers/OrderController.cs`
- [Account](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/AccountController.cs): auth controller · Custom authentication and account flows · `Controllers/AccountController.cs`
- [Admin](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Controllers/AdminController.cs): back-office controller · Management surface for products, categories, users, and orders · `Controllers/AdminController.cs`

### Domain

E-commerce entities and view models

- [Catalog Models](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Models/Product.cs): product domain · Products, categories, subcategories, and images · `Models/Product.cs`
- [Commerce Models](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Models/Cart.cs): shopping domain · Cart, wishlist, orders, and order items · `Models/Cart.cs`
- [Auth Models](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Models/LoginModel.cs): form/view models · Login, register, reset, and contact form models · `Models/LoginModel.cs`
- [Shop VM](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Models/ShopViewModel.cs): page model · Aggregated data for shop and browsing screens · `Models/ShopViewModel.cs`

### Persistence

EF Core database boundary and seed data

- [App Db](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Data/ApplicationDbContext.cs): ef core context · Primary persistence boundary for app and Identity data · `Data/ApplicationDbContext.cs`
- [Seeder](https://github.com/byseif21/depi-e-commerce-.net-project/blob/main/Data/DbSeeder.cs): bootstrap data · Seeds or prepares initial application data · `Data/DbSeeder.cs`

## Connections

- Program → App Db: configures · Registers EF Core persistence
- Program → Email Sender: registers · Adds email delivery support
- Program → Controller Ext: uses · Shares common controller helpers
- Program → Home: hosts · Enables MVC request routing
- Program → Products: hosts · Enables MVC request routing
- Program → Cart: hosts · Enables MVC request routing
- Program → Order: hosts · Enables MVC request routing
- Program → Account: hosts · Enables MVC request routing
- Program → Admin: hosts · Enables MVC request routing
- Home → Catalog Models: reads · Composes landing and browse content
- Products → Catalog Models: reads · Builds product browsing and preview screens
- Category → Catalog Models: reads · Uses category and subcategory data
- Cart → Commerce Models: updates · Manages cart state and line items
- Order → Commerce Models: creates · Converts cart content into orders
- Account → Auth Models: binds · Handles login and recovery forms
- Admin → Catalog Models: manages · CRUD over products and categories
- Admin → Commerce Models: manages · Views and processes orders
- Admin → App Db: persists · Reads and writes admin data
- Home → Shared Views: renders · Uses shared layout and partials
- Products → Storefront Views: renders · Uses shop and product pages
- Cart → Storefront Views: renders · Uses cart UI
- Order → Storefront Views: renders · Uses checkout and confirmation pages
- Account → Account Views: renders · Uses custom auth pages
- Admin → Admin Views: renders · Uses management pages
- Identity Area → Account: complements · Identity UI supports account flows
- Storefront Views → Static Assets: uses · Loads site CSS and scripts
- Admin Views → Static Assets: uses · Loads admin styles and scripts
- Shared Views → Static Assets: uses · Shared layout and components depend on assets
- Seeder → App Db: seeds · Initializes persistent data
- Shop VM → Products: shapes · Backs shop browsing responses
