# mostafahendy3/mvc_shopegypt architecture

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

- Interactive diagram: https://gitdiagram.com/mostafahendy3/mvc_shopegypt
- Repository: https://github.com/mostafahendy3/mvc_shopegypt

## Overview

ShopEgypt is an ASP.NET Core MVC storefront and admin application. The customer workflow runs from catalog browsing through cart, address and order confirmation, Stripe payment, and order history; reviews and wishlists are additional storefront capabilities. Admins manage catalog, orders, customers, categories, reviews, dashboard, and settings. The graph uses README statements and source-index references; unsampled subsystem internals are represented at their documented directory paths rather than inferred in detail.

Main entry points: [`ShopEgypt/Controllers/ShopOrdersController.cs`](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Controllers/ShopOrdersController.cs) (Checkout and orders), [`ShopEgypt.Infrastructure/Data/Context/ApplicationDbContext.cs`](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/Data/Context/ApplicationDbContext.cs) (EF data context), [`ShopEgypt/Controllers/ProductsController.cs`](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Controllers/ProductsController.cs) (Product browsing), [`ShopEgypt/Areas/Adminn/Controllers/AdminProductsController.cs`](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/AdminProductsController.cs) (Admin products)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_products_controller["Product browsing"]
  node_reviews_controller["Customer reviews"]
  node_wishlist["Wishlist"]
end

subgraph group_commerce["Checkout and orders"]
  node_cart_controller["Cart<br/>[CartController.cs]"]
  node_orders_controller["Checkout and orders"]
end

subgraph group_admin["Admin operations"]
  node_admin_products["Admin products"]
  node_admin_reviews["Admin reviews"]
  node_admin_dashboard["Admin dashboard"]
  node_admin_orders["Admin orders<br/>[OrderController.cs]"]
  node_admin_customers["Customer administration"]
  node_admin_categories["Category administration"]
  node_admin_settings["Store settings"]
end

subgraph group_services["Application services"]
  node_product_service["Product catalog<br/>[ProductService.cs]"]
  node_categories["Categories<br/>[CategoryService]"]
  node_review_service["Review management<br/>[ReviewService.cs]"]
  node_cart_service["Cart operations<br/>[CartService]"]
  node_address_service["Addresses<br/>[AddressService]"]
  node_order_service["Order processing<br/>[OrderService.cs]"]
  node_stripe_service["Stripe payments<br/>[StripeService.cs]"]
  node_unit_of_work["Unit of Work<br/>[UnitOfWork.cs]"]
  node_image_storage["Image storage"]
end

subgraph group_platform["Persistence and identity"]
  node_identity["Identity accounts"]
  node_db_context[("EF data context")]
end

node_customer(("Customer"))
node_admin_actor(("Admin"))
node_stripe{{"Stripe"}}
node_sql_server[("SQL Server")]
node_cloudinary{{"Cloudinary images"}}
node_sendgrid{{"SendGrid email"}}

node_customer -->|"browses"| node_products_controller
node_products_controller -->|"requests catalog"| node_product_service
node_products_controller -->|"loads categories"| node_categories
node_customer -->|"manages cart"| node_cart_controller
node_cart_controller -->|"updates cart"| node_cart_service
node_customer -->|"checks out"| node_orders_controller
node_orders_controller -->|"handles address"| node_address_service
node_orders_controller -->|"uses cart"| node_cart_service
node_orders_controller -->|"creates order"| node_order_service
node_orders_controller -->|"starts payment"| node_stripe_service
node_stripe_service -->|"creates intent"| node_stripe
node_orders_controller -->|"confirms order"| node_customer
node_customer -->|"reviews products"| node_reviews_controller
node_reviews_controller -->|"manages reviews"| node_review_service
node_customer -->|"manages wishlist"| node_wishlist
node_admin_actor -->|"manages products"| node_admin_products
node_admin_products -->|"edits catalog"| node_product_service
node_admin_actor -->|"moderates reviews"| node_admin_reviews
node_admin_reviews -->|"loads reviews"| node_review_service
node_admin_actor -->|"views dashboard"| node_admin_dashboard
node_admin_actor -->|"manages orders"| node_admin_orders
node_admin_actor -->|"manages customers"| node_admin_customers
node_admin_actor -->|"manages categories"| node_admin_categories
node_admin_actor -->|"updates settings"| node_admin_settings
node_customer -->|"authenticates"| node_identity
node_identity -->|"merges session cart"| node_cart_service
node_product_service -->|"queries catalog"| node_db_context
node_review_service -->|"reads and writes"| node_db_context
node_order_service -->|"uses repositories"| node_unit_of_work
node_unit_of_work -->|"persists changes"| node_db_context
node_db_context -->|"stores records"| node_sql_server
node_admin_dashboard -->|"queries metrics"| node_db_context
node_admin_products -.->|"uploads images"| node_image_storage
node_image_storage -->|"stores images"| node_cloudinary
node_identity -.->|"sends email"| node_sendgrid

click node_products_controller "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Controllers/ProductsController.cs"
click node_product_service "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/Services/ProductService/ProductService.cs"
click node_categories "https://github.com/mostafahendy3/mvc_shopegypt/tree/main/ShopEgypt.Infrastructure/Services/CategoryService"
click node_reviews_controller "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Controllers/ReviewsController.cs"
click node_review_service "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/Services/ReviewService/ReviewService.cs"
click node_cart_controller "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Controllers/Cart/CartController.cs"
click node_cart_service "https://github.com/mostafahendy3/mvc_shopegypt/tree/main/ShopEgypt.Infrastructure/Services/CartService"
click node_wishlist "https://github.com/mostafahendy3/mvc_shopegypt/tree/main/ShopEgypt.Infrastructure/Services/WishlistItemService"
click node_orders_controller "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Controllers/ShopOrdersController.cs"
click node_address_service "https://github.com/mostafahendy3/mvc_shopegypt/tree/main/ShopEgypt.Infrastructure/Services/AddressService"
click node_order_service "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/Services/OrderService/OrderService.cs"
click node_stripe_service "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/ExternalServices/StripeService/StripeService.cs"
click node_identity "https://github.com/mostafahendy3/mvc_shopegypt/tree/main/ShopEgypt/Areas/Identity"
click node_admin_products "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/AdminProductsController.cs"
click node_admin_reviews "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/AdminReviewsController.cs"
click node_admin_dashboard "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/DashboardController.cs"
click node_admin_orders "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/OrderController.cs"
click node_admin_customers "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/CustomersController.cs"
click node_admin_categories "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/AdminCategoriesController.cs"
click node_admin_settings "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/SettingsController.cs"
click node_unit_of_work "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/UnitOfWork/UnitOfWork.cs"
click node_db_context "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/Data/Context/ApplicationDbContext.cs"
click node_image_storage "https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/Services/CloudinaryService/CloudinaryImageStorageService.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_products_controller,node_reviews_controller,node_wishlist toneBlue
class node_cart_controller,node_orders_controller,node_sql_server toneAmber
class node_admin_products,node_admin_reviews,node_admin_dashboard,node_admin_orders,node_admin_customers,node_admin_categories,node_admin_settings toneMint
class node_product_service,node_categories,node_review_service,node_cart_service,node_address_service,node_order_service,node_stripe_service,node_unit_of_work,node_image_storage toneRose
class node_identity,node_db_context,node_customer,node_admin_actor,node_stripe,node_cloudinary,node_sendgrid toneIndigo
```

## Components

### Storefront

- [Product browsing](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Controllers/ProductsController.cs): `ShopEgypt/Controllers/ProductsController.cs`
- [Customer reviews](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Controllers/ReviewsController.cs): `ShopEgypt/Controllers/ReviewsController.cs`
- [Wishlist](https://github.com/mostafahendy3/mvc_shopegypt/tree/main/ShopEgypt.Infrastructure/Services/WishlistItemService): `ShopEgypt.Infrastructure/Services/WishlistItemService`

### Checkout and orders

- [Cart](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Controllers/Cart/CartController.cs): `ShopEgypt/Controllers/Cart/CartController.cs`
- [Checkout and orders](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Controllers/ShopOrdersController.cs): `ShopEgypt/Controllers/ShopOrdersController.cs`

### Admin operations

- [Admin products](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/AdminProductsController.cs): `ShopEgypt/Areas/Adminn/Controllers/AdminProductsController.cs`
- [Admin reviews](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/AdminReviewsController.cs): `ShopEgypt/Areas/Adminn/Controllers/AdminReviewsController.cs`
- [Admin dashboard](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/DashboardController.cs): `ShopEgypt/Areas/Adminn/Controllers/DashboardController.cs`
- [Admin orders](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/OrderController.cs): `ShopEgypt/Areas/Adminn/Controllers/OrderController.cs`
- [Customer administration](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/CustomersController.cs): `ShopEgypt/Areas/Adminn/Controllers/CustomersController.cs`
- [Category administration](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/AdminCategoriesController.cs): `ShopEgypt/Areas/Adminn/Controllers/AdminCategoriesController.cs`
- [Store settings](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt/Areas/Adminn/Controllers/SettingsController.cs): `ShopEgypt/Areas/Adminn/Controllers/SettingsController.cs`

### Application services

- [Product catalog](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/Services/ProductService/ProductService.cs): `ShopEgypt.Infrastructure/Services/ProductService/ProductService.cs`
- [Categories](https://github.com/mostafahendy3/mvc_shopegypt/tree/main/ShopEgypt.Infrastructure/Services/CategoryService): `ShopEgypt.Infrastructure/Services/CategoryService`
- [Review management](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/Services/ReviewService/ReviewService.cs): `ShopEgypt.Infrastructure/Services/ReviewService/ReviewService.cs`
- [Cart operations](https://github.com/mostafahendy3/mvc_shopegypt/tree/main/ShopEgypt.Infrastructure/Services/CartService): `ShopEgypt.Infrastructure/Services/CartService`
- [Addresses](https://github.com/mostafahendy3/mvc_shopegypt/tree/main/ShopEgypt.Infrastructure/Services/AddressService): `ShopEgypt.Infrastructure/Services/AddressService`
- [Order processing](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/Services/OrderService/OrderService.cs): `ShopEgypt.Infrastructure/Services/OrderService/OrderService.cs`
- [Stripe payments](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/ExternalServices/StripeService/StripeService.cs): `ShopEgypt.Infrastructure/ExternalServices/StripeService/StripeService.cs`
- [Unit of Work](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/UnitOfWork/UnitOfWork.cs): `ShopEgypt.Infrastructure/UnitOfWork/UnitOfWork.cs`
- [Image storage](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/Services/CloudinaryService/CloudinaryImageStorageService.cs): `ShopEgypt.Infrastructure/Services/CloudinaryService/CloudinaryImageStorageService.cs`

### Persistence and identity

- [Identity accounts](https://github.com/mostafahendy3/mvc_shopegypt/tree/main/ShopEgypt/Areas/Identity): `ShopEgypt/Areas/Identity`
- [EF data context](https://github.com/mostafahendy3/mvc_shopegypt/blob/main/ShopEgypt.Infrastructure/Data/Context/ApplicationDbContext.cs): `ShopEgypt.Infrastructure/Data/Context/ApplicationDbContext.cs`

### Other components

- **Customer**
- **Admin**
- **Stripe**
- **SQL Server**
- **Cloudinary images**
- **SendGrid email**

## Connections

- Customer → Product browsing: browses
- Product browsing → Product catalog: requests catalog (evidence: `ShopEgypt/Controllers/ProductsController.cs`)
- Product browsing → Categories: loads categories (evidence: `ShopEgypt/Controllers/ProductsController.cs`)
- Customer → Cart: manages cart
- Cart → Cart operations: updates cart (evidence: `ShopEgypt/Controllers/Cart/CartController.cs`)
- Customer → Checkout and orders: checks out
- Checkout and orders → Addresses: handles address (evidence: `ShopEgypt/Controllers/ShopOrdersController.cs`)
- Checkout and orders → Cart operations: uses cart (evidence: `ShopEgypt/Controllers/ShopOrdersController.cs`)
- Checkout and orders → Order processing: creates order (evidence: `ShopEgypt/Controllers/ShopOrdersController.cs`)
- Checkout and orders → Stripe payments: starts payment
- Stripe payments → Stripe: creates intent (evidence: `ShopEgypt.Infrastructure/ExternalServices/StripeService/StripeService.cs`)
- Checkout and orders → Customer: confirms order
- Customer → Customer reviews: reviews products
- Customer reviews → Review management: manages reviews (evidence: `ShopEgypt/Controllers/ReviewsController.cs`)
- Customer → Wishlist: manages wishlist
- Admin → Admin products: manages products
- Admin products → Product catalog: edits catalog (evidence: `ShopEgypt/Areas/Adminn/Controllers/AdminProductsController.cs`)
- Admin → Admin reviews: moderates reviews
- Admin reviews → Review management: loads reviews (evidence: `ShopEgypt/Areas/Adminn/Controllers/AdminReviewsController.cs`)
- Admin → Admin dashboard: views dashboard
- Admin → Admin orders: manages orders
- Admin → Customer administration: manages customers
- Admin → Category administration: manages categories
- Admin → Store settings: updates settings
- Customer → Identity accounts: authenticates
- Identity accounts → Cart operations: merges session cart
- Product catalog → EF data context: queries catalog (evidence: `ShopEgypt.Infrastructure/Services/ProductService/ProductService.cs`)
- Review management → EF data context: reads and writes (evidence: `ShopEgypt.Infrastructure/Services/ReviewService/ReviewService.cs`)
- Order processing → Unit of Work: uses repositories (evidence: `ShopEgypt.Infrastructure/Services/OrderService/OrderService.cs`)
- Unit of Work → EF data context: persists changes (evidence: `ShopEgypt.Infrastructure/UnitOfWork/UnitOfWork.cs`)
- EF data context → SQL Server: stores records
- Admin dashboard → EF data context: queries metrics (evidence: `ShopEgypt/Areas/Adminn/Controllers/DashboardController.cs`)
- Admin products → Image storage: uploads images
- Image storage → Cloudinary images: stores images
- Identity accounts → SendGrid email: sends email
