# orex-x/vapeshop architecture

> Architecture diagram of the GitHub repository orex-x/vapeshop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/orex-x/vapeshop
- Repository: https://github.com/orex-x/vapeshop

## Overview

VapeShop is an ASP.NET MVC storefront for vape products. A customer browses the catalog, manages a basket, registers or signs in, then submits an order and views order history. The controllers own these operations and use Entity Framework through DatabaseContext; the domain models represent catalog, client, basket, and order state. Other documented-in-source capabilities include favorites, an administrative area, and read-only data API endpoints. The provided excerpts do not show application startup wiring or most view interactions, so those connections are omitted rather than inferred.

Main entry points: [`VapeShop/DatabaseContext.cs`](https://github.com/orex-x/vapeshop/blob/main/VapeShop/DatabaseContext.cs) (Entity Framework Context), [`VapeShop/Controllers/AccountController.cs`](https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/AccountController.cs) (Account And Favorites), [`VapeShop/Controllers/OrderController.cs`](https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/OrderController.cs) (Order Checkout), [`VapeShop/Controllers/HomeController.cs`](https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/HomeController.cs) (Catalog Browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_catalog["Catalog Browsing<br/>[HomeController.cs]"]
  node_catalog_views["Catalog Views"]
end

subgraph group_identity["Customer Accounts"]
  node_account["Account And Favorites"]
  node_account_views["Account Views"]
end

subgraph group_commerce["Basket And Orders"]
  node_basket["Basket Management"]
  node_basket_view["Basket View<br/>[Basket.cshtml]"]
  node_checkout["Order Checkout<br/>[OrderController.cs]"]
  node_checkout_view["Payment View<br/>[PayOrder.cshtml]"]
end

subgraph group_operations["Operations And API"]
  node_admin["Admin Tools<br/>[AdminController.cs]"]
  node_admin_views["Admin Views"]
  node_data_api["Data API<br/>[ApiController.cs]"]
end

subgraph group_data["Persistence And Domain"]
  node_database["Entity Framework Context<br/>[DatabaseContext.cs]"]
  node_domain{{"Commerce Domain"}}
  node_viewmodels["Request And View Models"]
end

node_shopper(("Shopper"))
node_postgres[("PostgreSQL")]

node_shopper -.->|"browses"| node_catalog
node_catalog -->|"reads catalog"| node_database
node_catalog -->|"uses catalog models"| node_domain
node_account -->|"reads and updates"| node_database
node_account -->|"accepts account forms"| node_viewmodels
node_account -->|"creates clients"| node_domain
node_basket -->|"reads and updates"| node_database
node_checkout -->|"saves orders"| node_database
node_checkout -->|"accepts payment form"| node_viewmodels
node_checkout -->|"updates order state"| node_domain
node_admin -->|"queries shop data"| node_database
node_admin -->|"uses chart model"| node_viewmodels
node_data_api -->|"reads entities"| node_database
node_database -->|"maps entities"| node_domain
node_database -->|"configures provider"| node_postgres
node_catalog -.->|"renders"| node_catalog_views
node_account -.->|"renders"| node_account_views
node_basket -.->|"renders"| node_basket_view
node_checkout -.->|"renders"| node_checkout_view
node_admin -.->|"renders"| node_admin_views

click node_catalog "https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/HomeController.cs"
click node_catalog_views "https://github.com/orex-x/vapeshop/tree/main/VapeShop/Views/Home"
click node_account "https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/AccountController.cs"
click node_account_views "https://github.com/orex-x/vapeshop/tree/main/VapeShop/Views/Account"
click node_basket "https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/BasketController.cs"
click node_basket_view "https://github.com/orex-x/vapeshop/blob/main/VapeShop/Views/Basket/Basket.cshtml"
click node_checkout "https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/OrderController.cs"
click node_checkout_view "https://github.com/orex-x/vapeshop/blob/main/VapeShop/Views/Order/PayOrder.cshtml"
click node_admin "https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/AdminController.cs"
click node_admin_views "https://github.com/orex-x/vapeshop/tree/main/VapeShop/Views/Admin"
click node_data_api "https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/ApiController.cs"
click node_database "https://github.com/orex-x/vapeshop/blob/main/VapeShop/DatabaseContext.cs"
click node_domain "https://github.com/orex-x/vapeshop/tree/main/VapeShop/Models"
click node_viewmodels "https://github.com/orex-x/vapeshop/tree/main/VapeShop/ViewModels"

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_catalog,node_catalog_views toneBlue
class node_account,node_account_views,node_postgres toneAmber
class node_basket,node_basket_view,node_checkout,node_checkout_view toneMint
class node_admin,node_admin_views,node_data_api toneRose
class node_database,node_domain,node_viewmodels,node_shopper toneIndigo
```

## Components

### Storefront

- [Catalog Browsing](https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/HomeController.cs): `VapeShop/Controllers/HomeController.cs`
- [Catalog Views](https://github.com/orex-x/vapeshop/tree/main/VapeShop/Views/Home): `VapeShop/Views/Home`

### Customer Accounts

- [Account And Favorites](https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/AccountController.cs): `VapeShop/Controllers/AccountController.cs`
- [Account Views](https://github.com/orex-x/vapeshop/tree/main/VapeShop/Views/Account): `VapeShop/Views/Account`

### Basket And Orders

- [Basket Management](https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/BasketController.cs): `VapeShop/Controllers/BasketController.cs`
- [Basket View](https://github.com/orex-x/vapeshop/blob/main/VapeShop/Views/Basket/Basket.cshtml): `VapeShop/Views/Basket/Basket.cshtml`
- [Order Checkout](https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/OrderController.cs): `VapeShop/Controllers/OrderController.cs`
- [Payment View](https://github.com/orex-x/vapeshop/blob/main/VapeShop/Views/Order/PayOrder.cshtml): `VapeShop/Views/Order/PayOrder.cshtml`

### Operations And API

- [Admin Tools](https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/AdminController.cs): `VapeShop/Controllers/AdminController.cs`
- [Admin Views](https://github.com/orex-x/vapeshop/tree/main/VapeShop/Views/Admin): `VapeShop/Views/Admin`
- [Data API](https://github.com/orex-x/vapeshop/blob/main/VapeShop/Controllers/ApiController.cs): `VapeShop/Controllers/ApiController.cs`

### Persistence And Domain

- [Entity Framework Context](https://github.com/orex-x/vapeshop/blob/main/VapeShop/DatabaseContext.cs): `VapeShop/DatabaseContext.cs`
- [Commerce Domain](https://github.com/orex-x/vapeshop/tree/main/VapeShop/Models): `VapeShop/Models`
- [Request And View Models](https://github.com/orex-x/vapeshop/tree/main/VapeShop/ViewModels): `VapeShop/ViewModels`

### Other components

- **Shopper**
- **PostgreSQL**

## Connections

- Shopper → Catalog Browsing: browses
- Catalog Browsing → Entity Framework Context: reads catalog (evidence: `VapeShop/Controllers/HomeController.cs`)
- Catalog Browsing → Commerce Domain: uses catalog models (evidence: `VapeShop/Controllers/HomeController.cs`)
- Account And Favorites → Entity Framework Context: reads and updates (evidence: `VapeShop/Controllers/AccountController.cs`)
- Account And Favorites → Request And View Models: accepts account forms (evidence: `VapeShop/Controllers/AccountController.cs`)
- Account And Favorites → Commerce Domain: creates clients (evidence: `VapeShop/Controllers/AccountController.cs`)
- Basket Management → Entity Framework Context: reads and updates (evidence: `VapeShop/Controllers/BasketController.cs`)
- Order Checkout → Entity Framework Context: saves orders (evidence: `VapeShop/Controllers/OrderController.cs`)
- Order Checkout → Request And View Models: accepts payment form (evidence: `VapeShop/Controllers/OrderController.cs`)
- Order Checkout → Commerce Domain: updates order state (evidence: `VapeShop/Controllers/OrderController.cs`)
- Admin Tools → Entity Framework Context: queries shop data (evidence: `VapeShop/Controllers/AdminController.cs`)
- Admin Tools → Request And View Models: uses chart model (evidence: `VapeShop/Controllers/AdminController.cs`)
- Data API → Entity Framework Context: reads entities (evidence: `VapeShop/Controllers/ApiController.cs`)
- Entity Framework Context → Commerce Domain: maps entities (evidence: `VapeShop/DatabaseContext.cs`)
- Entity Framework Context → PostgreSQL: configures provider (evidence: `VapeShop/DatabaseContext.cs`)
- Catalog Browsing → Catalog Views: renders
- Account And Favorites → Account Views: renders
- Basket Management → Basket View: renders
- Order Checkout → Payment View: renders
- Admin Tools → Admin Views: renders
