# sorvisal/bookstore-ecommerce architecture

> Architecture diagram of the GitHub repository sorvisal/bookstore-ecommerce, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sorvisal/bookstore-ecommerce
- Repository: https://github.com/sorvisal/bookstore-ecommerce

## Overview

This is an ASP.NET e-commerce bookstore: customers browse books, manage an account and cart, place orders, and pay; administrators manage catalog, orders, users, and dashboard data. The graph includes catalog, cart, checkout/payment, and administration, with the EF data layer as the internal foundation. Source-index references support several connections, but many controllers and integration details were not excerpted; uncertain wiring is omitted rather than inferred.

Main entry points: [`Data/ApplicationDbContext.cs`](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Data/ApplicationDbContext.cs) (EF data context), [`Controllers/CheckoutController.cs`](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/CheckoutController.cs) (Checkout), [`Models/User.cs`](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/User.cs) (User model), [`Controllers/CartController.cs`](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/CartController.cs) (Shopping cart)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Book catalog"]
  node_catalog_browse["Browse books<br/>[BooksController.cs]"]
  node_catalog_categories["Categories"]
  node_catalog_publishers["Publishers"]
  node_catalog_home["Store home<br/>[HomeController.cs]"]
  node_book_model["Book and catalog models<br/>[Book.cs]"]
  node_author_model["Author models<br/>[Author.cs]"]
end

subgraph group_shopping["Customer shopping"]
  node_account["Account"]
  node_cart["Shopping cart<br/>[CartController.cs]"]
  node_cart_summary["Cart summary"]
  node_cart_model["Cart models<br/>[ShoppingCart.cs]"]
  node_user_model["User model<br/>[User.cs]"]
  node_pricing["Cart pricing<br/>[Pricing.cs]"]
end

subgraph group_payments["Checkout and payments"]
  node_checkout["Checkout"]
  node_orders["Customer orders"]
  node_aba_payment["ABA confirmation"]
  node_khqr["KHQR payments"]
  node_payway["PayWay client"]
  node_payment_status["Payment status"]
  node_order_model["Order models<br/>[Order.cs]"]
  node_payment_model["Payment models<br/>[Payment.cs]"]
  node_aba_service["ABA integration"]
  node_order_totals["Order totals<br/>[OrderTotals.cs]"]
end

subgraph group_administration["Administration and data"]
  node_admin_books["Catalog admin<br/>[BooksController.cs]"]
  node_admin_orders["Order admin"]
  node_admin_users["User admin<br/>[UsersController.cs]"]
  node_admin_dashboard["Dashboard"]
  node_admin_authors["Author admin"]
  node_admin_categories["Category admin"]
  node_admin_publishers["Publisher admin"]
  node_admin_messages["Message admin"]
  node_data_context[("EF data context")]
  node_data_initializer["Data initializer"]
end

node_customer(("Customer"))

node_customer -.->|"browses"| node_catalog_browse
node_customer -.->|"manages account"| node_account
node_customer -.->|"manages cart"| node_cart
node_customer -.->|"checks out"| node_checkout
node_catalog_browse -->|"uses"| node_book_model
node_catalog_browse -->|"loads reviews"| node_user_model
node_cart -->|"updates"| node_cart_model
node_cart -->|"loads items"| node_book_model
node_cart -->|"calculates prices"| node_pricing
node_account -->|"manages"| node_user_model
node_checkout -->|"initiates KHQR"| node_khqr
node_checkout -->|"confirms payment"| node_aba_service
node_checkout -->|"calculates totals"| node_order_totals
node_checkout -->|"calculates prices"| node_pricing
node_khqr -->|"requests payment"| node_payway
node_aba_service -->|"updates payment state"| node_order_model
node_aba_service -->|"marks paid"| node_payment_model
node_admin_orders -->|"marks paid"| node_aba_service
node_admin_orders -->|"manages orders"| node_order_model
node_admin_books -->|"manages books"| node_book_model
node_admin_users -->|"manages users"| node_user_model
node_admin_dashboard -->|"reads orders"| node_order_model
node_admin_dashboard -->|"reads users"| node_user_model
node_data_context -->|"maps entities"| node_book_model
node_data_context -->|"maps entities"| node_order_model
node_data_context -->|"maps entities"| node_cart_model
node_data_context -->|"maps entities"| node_payment_model
node_data_context -->|"maps entities"| node_user_model
node_data_initializer -.->|"initializes data"| node_data_context

click node_catalog_browse "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/BooksController.cs"
click node_catalog_categories "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/CategoryController.cs"
click node_catalog_publishers "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/PublisherController.cs"
click node_catalog_home "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/HomeController.cs"
click node_account "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/AccountController.cs"
click node_cart "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/CartController.cs"
click node_cart_summary "https://github.com/sorvisal/bookstore-ecommerce/blob/main/ViewComponents/CartSummaryViewComponent.cs"
click node_checkout "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/CheckoutController.cs"
click node_orders "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/Orderscontroller.cs"
click node_aba_payment "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/AbaPaymentService.cs"
click node_khqr "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/Khqr/DynamicKhqrService.cs"
click node_payway "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/Khqr/PayWayLinkClient.cs"
click node_payment_status "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/PaymentStatusHelper.cs"
click node_admin_books "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/BooksController.cs"
click node_admin_orders "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/OrdersController.cs"
click node_admin_users "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/UsersController.cs"
click node_admin_dashboard "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/DashboardController.cs"
click node_admin_authors "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/AuthorsController.cs"
click node_admin_categories "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/CategoriesController.cs"
click node_admin_publishers "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/PublishersController.cs"
click node_admin_messages "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/MessagesController.cs"
click node_data_context "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Data/ApplicationDbContext.cs"
click node_data_initializer "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Data/AppDbInitializer.cs"
click node_book_model "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/Book.cs"
click node_author_model "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/Author.cs"
click node_cart_model "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/ShoppingCart.cs"
click node_order_model "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/Order.cs"
click node_payment_model "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/Payment.cs"
click node_user_model "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/User.cs"
click node_aba_service "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/AbaPaymentService.cs"
click node_pricing "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/Pricing.cs"
click node_order_totals "https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/OrderTotals.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_catalog_browse,node_catalog_categories,node_catalog_publishers,node_catalog_home,node_book_model,node_author_model toneBlue
class node_account,node_cart,node_cart_summary,node_cart_model,node_user_model,node_pricing toneAmber
class node_checkout,node_orders,node_aba_payment,node_khqr,node_payway,node_payment_status,node_order_model,node_payment_model,node_aba_service,node_order_totals toneMint
class node_admin_books,node_admin_orders,node_admin_users,node_admin_dashboard,node_admin_authors,node_admin_categories,node_admin_publishers,node_admin_messages,node_data_context,node_data_initializer toneRose
class node_customer toneIndigo
```

## Components

### Book catalog

- [Browse books](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/BooksController.cs): `Controllers/BooksController.cs`
- [Categories](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/CategoryController.cs): `Controllers/CategoryController.cs`
- [Publishers](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/PublisherController.cs): `Controllers/PublisherController.cs`
- [Store home](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/HomeController.cs): `Controllers/HomeController.cs`
- [Book and catalog models](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/Book.cs): `Models/Book.cs`
- [Author models](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/Author.cs): `Models/Author.cs`

### Customer shopping

- [Account](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/AccountController.cs): `Controllers/AccountController.cs`
- [Shopping cart](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/CartController.cs): `Controllers/CartController.cs`
- [Cart summary](https://github.com/sorvisal/bookstore-ecommerce/blob/main/ViewComponents/CartSummaryViewComponent.cs): `ViewComponents/CartSummaryViewComponent.cs`
- [Cart models](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/ShoppingCart.cs): `Models/ShoppingCart.cs`
- [User model](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/User.cs): `Models/User.cs`
- [Cart pricing](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/Pricing.cs): `Services/Pricing.cs`

### Checkout and payments

- [Checkout](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/CheckoutController.cs): `Controllers/CheckoutController.cs`
- [Customer orders](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Controllers/Orderscontroller.cs): `Controllers/Orderscontroller.cs`
- [ABA confirmation](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/AbaPaymentService.cs): `Services/AbaPaymentService.cs`
- [KHQR payments](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/Khqr/DynamicKhqrService.cs): `Services/Khqr/DynamicKhqrService.cs`
- [PayWay client](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/Khqr/PayWayLinkClient.cs): `Services/Khqr/PayWayLinkClient.cs`
- [Payment status](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/PaymentStatusHelper.cs): `Services/PaymentStatusHelper.cs`
- [Order models](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/Order.cs): `Models/Order.cs`
- [Payment models](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Models/Payment.cs): `Models/Payment.cs`
- [ABA integration](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/AbaPaymentService.cs): `Services/AbaPaymentService.cs`
- [Order totals](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Services/OrderTotals.cs): `Services/OrderTotals.cs`

### Administration and data

- [Catalog admin](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/BooksController.cs): `Areas/Admin/Controllers/BooksController.cs`
- [Order admin](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/OrdersController.cs): `Areas/Admin/Controllers/OrdersController.cs`
- [User admin](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/UsersController.cs): `Areas/Admin/Controllers/UsersController.cs`
- [Dashboard](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/DashboardController.cs): `Areas/Admin/Controllers/DashboardController.cs`
- [Author admin](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/AuthorsController.cs): `Areas/Admin/Controllers/AuthorsController.cs`
- [Category admin](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/CategoriesController.cs): `Areas/Admin/Controllers/CategoriesController.cs`
- [Publisher admin](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/PublishersController.cs): `Areas/Admin/Controllers/PublishersController.cs`
- [Message admin](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Areas/Admin/Controllers/MessagesController.cs): `Areas/Admin/Controllers/MessagesController.cs`
- [EF data context](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Data/ApplicationDbContext.cs): `Data/ApplicationDbContext.cs`
- [Data initializer](https://github.com/sorvisal/bookstore-ecommerce/blob/main/Data/AppDbInitializer.cs): `Data/AppDbInitializer.cs`

### Other components

- **Customer**

## Connections

- Customer → Browse books: browses
- Customer → Account: manages account
- Customer → Shopping cart: manages cart
- Customer → Checkout: checks out
- Browse books → Book and catalog models: uses (evidence: `Controllers/BooksController.cs`)
- Browse books → User model: loads reviews (evidence: `Controllers/BooksController.cs`)
- Shopping cart → Cart models: updates (evidence: `Controllers/CartController.cs`)
- Shopping cart → Book and catalog models: loads items (evidence: `Controllers/CartController.cs`)
- Shopping cart → Cart pricing: calculates prices (evidence: `Controllers/CartController.cs`)
- Account → User model: manages (evidence: `Controllers/AccountController.cs`)
- Checkout → KHQR payments: initiates KHQR (evidence: `Controllers/CheckoutController.cs`)
- Checkout → ABA integration: confirms payment (evidence: `Controllers/CheckoutController.cs`)
- Checkout → Order totals: calculates totals (evidence: `Controllers/CheckoutController.cs`)
- Checkout → Cart pricing: calculates prices (evidence: `Controllers/CheckoutController.cs`)
- KHQR payments → PayWay client: requests payment (evidence: `Services/Khqr/DynamicKhqrService.cs`)
- ABA integration → Order models: updates payment state (evidence: `Services/AbaPaymentService.cs`)
- ABA integration → Payment models: marks paid (evidence: `Services/AbaPaymentService.cs`)
- Order admin → ABA integration: marks paid (evidence: `Areas/Admin/Controllers/OrdersController.cs`)
- Order admin → Order models: manages orders (evidence: `Areas/Admin/Controllers/OrdersController.cs`)
- Catalog admin → Book and catalog models: manages books (evidence: `Areas/Admin/Controllers/BooksController.cs`)
- User admin → User model: manages users (evidence: `Areas/Admin/Controllers/UsersController.cs`)
- Dashboard → Order models: reads orders (evidence: `Areas/Admin/Controllers/DashboardController.cs`)
- Dashboard → User model: reads users (evidence: `Areas/Admin/Controllers/DashboardController.cs`)
- EF data context → Book and catalog models: maps entities (evidence: `Data/ApplicationDbContext.cs`)
- EF data context → Order models: maps entities (evidence: `Data/ApplicationDbContext.cs`)
- EF data context → Cart models: maps entities (evidence: `Data/ApplicationDbContext.cs`)
- EF data context → Payment models: maps entities (evidence: `Data/ApplicationDbContext.cs`)
- EF data context → User model: maps entities (evidence: `Data/ApplicationDbContext.cs`)
- Data initializer → EF data context: initializes data
