# jhelnv3/freshcart-imdbsys32 architecture

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

- Interactive diagram: https://gitdiagram.com/jhelnv3/freshcart-imdbsys32
- Repository: https://github.com/jhelnv3/freshcart-imdbsys32

## Overview

FreshCart is an ASP.NET MVC shopping application. Customers browse and filter products, manage a database-backed cart, place orders, and follow order status through customer-confirmed receipt; account recovery uses simulated email. Staff and administrators manage catalog, users, and orders, with dashboard summaries. The graph separates MVC entry points, application services, domain records, and persistence. The source index and sampled service/controller code support the main calls; README documents capabilities whose detailed implementation was not sampled, so those relationships are marked as documented rather than inferred.

Main entry points: [`FreshCart/FreshCart/Data/ApplicationDbContext.cs`](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Data/ApplicationDbContext.cs) (Application database), [`FreshCart/FreshCart/Services/OrderService.cs`](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/OrderService.cs) (Order workflow), [`FreshCart/FreshCart/Services/AuthService.cs`](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/AuthService.cs) (Session auth), [`FreshCart/FreshCart/Services/CartService.cs`](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/CartService.cs) (Cart operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["MVC workflows"]
  node_account["Account endpoints"]
  node_catalog["Catalog endpoints"]
  node_home["Home endpoints<br/>[HomeController.cs]"]
  node_cart["Cart endpoints<br/>[CartController.cs]"]
  node_orders["Order endpoints<br/>[OrderController.cs]"]
  node_admin["Admin operations<br/>[AdminController.cs]"]
end

subgraph group_services["Application services"]
  node_auth["Session auth<br/>[AuthService.cs]"]
  node_products["Product search<br/>[ProductService.cs]"]
  node_cartservice["Cart operations<br/>[CartService.cs]"]
  node_orderservice["Order workflow<br/>[OrderService.cs]"]
  node_email["Simulated email<br/>[EmailService.cs]"]
end

subgraph group_domain["Commerce domain"]
  node_users["User records<br/>[User.cs]"]
  node_productsdata["Product records<br/>[Product.cs]"]
  node_categories["Category records<br/>[Category.cs]"]
  node_cartitems["Cart records<br/>[CartItem.cs]"]
  node_orderdata["Order records<br/>[Order.cs]"]
  node_orderdetails["Order line records<br/>[OrderDetail.cs]"]
end

subgraph group_persistence["Persistence"]
  node_database[("Application database")]
  node_email_log["Email log<br/>[email_log.txt]"]
end

node_customer(("Customer"))
node_staff(("Staff / admin"))

node_customer -->|"manages account"| node_account
node_customer -->|"browses products"| node_catalog
node_customer -->|"shops with"| node_cart
node_customer -->|"tracks orders"| node_orders
node_staff -->|"manages store"| node_admin
node_account -->|"authenticates"| node_auth
node_account -->|"sends recovery code"| node_email
node_catalog -->|"searches catalog"| node_products
node_home -->|"loads products"| node_products
node_catalog -->|"adds items"| node_cartservice
node_cart -->|"manages cart"| node_cartservice
node_cart -->|"submits checkout"| node_orderservice
node_cart -->|"requests confirmation"| node_email
node_orders -->|"tracks status"| node_orderservice
node_admin -->|"checks roles"| node_auth
node_admin -->|"manages orders"| node_orderservice
node_admin -->|"reads catalog"| node_products
node_auth -->|"reads users"| node_database
node_auth -->|"loads user"| node_users
node_products -->|"queries catalog"| node_database
node_cartservice -->|"gets current user"| node_auth
node_cartservice -->|"reads and writes cart"| node_database
node_orderservice -->|"gets current user"| node_auth
node_orderservice -->|"uses and clears cart"| node_cartservice
node_orderservice -->|"creates and updates orders"| node_database
node_email -->|"appends messages"| node_email_log
node_database -->|"maps records"| node_users
node_database -->|"maps records"| node_productsdata
node_database -->|"maps records"| node_categories
node_database -->|"maps records"| node_cartitems
node_database -->|"maps records"| node_orderdata
node_database -->|"maps records"| node_orderdetails
node_orderservice -->|"sets six statuses"| node_orderdata

click node_account "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Controllers/AccountController.cs"
click node_catalog "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Controllers/ProductController.cs"
click node_home "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Controllers/HomeController.cs"
click node_cart "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Controllers/CartController.cs"
click node_orders "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Controllers/OrderController.cs"
click node_admin "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Controllers/AdminController.cs"
click node_auth "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/AuthService.cs"
click node_products "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/ProductService.cs"
click node_cartservice "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/CartService.cs"
click node_orderservice "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/OrderService.cs"
click node_email "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/EmailService.cs"
click node_users "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Models/Entities/User.cs"
click node_productsdata "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Models/Entities/Product.cs"
click node_categories "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Models/Entities/Category.cs"
click node_cartitems "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Models/Entities/CartItem.cs"
click node_orderdata "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Models/Entities/Order.cs"
click node_orderdetails "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Models/Entities/OrderDetail.cs"
click node_database "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Data/ApplicationDbContext.cs"
click node_email_log "https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/wwwroot/logs/email_log.txt"

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_account,node_catalog,node_home,node_cart,node_orders,node_admin toneBlue
class node_auth,node_products,node_cartservice,node_orderservice,node_email toneAmber
class node_users,node_productsdata,node_categories,node_cartitems,node_orderdata,node_orderdetails toneMint
class node_database,node_email_log toneRose
class node_customer,node_staff toneIndigo
```

## Components

### MVC workflows

- [Account endpoints](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Controllers/AccountController.cs): `FreshCart/FreshCart/Controllers/AccountController.cs`
- [Catalog endpoints](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Controllers/ProductController.cs): `FreshCart/FreshCart/Controllers/ProductController.cs`
- [Home endpoints](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Controllers/HomeController.cs): `FreshCart/FreshCart/Controllers/HomeController.cs`
- [Cart endpoints](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Controllers/CartController.cs): `FreshCart/FreshCart/Controllers/CartController.cs`
- [Order endpoints](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Controllers/OrderController.cs): `FreshCart/FreshCart/Controllers/OrderController.cs`
- [Admin operations](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Controllers/AdminController.cs): `FreshCart/FreshCart/Controllers/AdminController.cs`

### Application services

- [Session auth](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/AuthService.cs): `FreshCart/FreshCart/Services/AuthService.cs`
- [Product search](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/ProductService.cs): `FreshCart/FreshCart/Services/ProductService.cs`
- [Cart operations](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/CartService.cs): `FreshCart/FreshCart/Services/CartService.cs`
- [Order workflow](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/OrderService.cs): `FreshCart/FreshCart/Services/OrderService.cs`
- [Simulated email](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Services/EmailService.cs): `FreshCart/FreshCart/Services/EmailService.cs`

### Commerce domain

- [User records](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Models/Entities/User.cs): `FreshCart/FreshCart/Models/Entities/User.cs`
- [Product records](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Models/Entities/Product.cs): `FreshCart/FreshCart/Models/Entities/Product.cs`
- [Category records](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Models/Entities/Category.cs): `FreshCart/FreshCart/Models/Entities/Category.cs`
- [Cart records](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Models/Entities/CartItem.cs): `FreshCart/FreshCart/Models/Entities/CartItem.cs`
- [Order records](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Models/Entities/Order.cs): `FreshCart/FreshCart/Models/Entities/Order.cs`
- [Order line records](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Models/Entities/OrderDetail.cs): `FreshCart/FreshCart/Models/Entities/OrderDetail.cs`

### Persistence

- [Application database](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/Data/ApplicationDbContext.cs): `FreshCart/FreshCart/Data/ApplicationDbContext.cs`
- [Email log](https://github.com/jhelnv3/freshcart-imdbsys32/blob/main/FreshCart/FreshCart/wwwroot/logs/email_log.txt): `FreshCart/FreshCart/wwwroot/logs/email_log.txt`

### Other components

- **Customer**
- **Staff / admin**

## Connections

- Customer → Account endpoints: manages account (evidence: `README.md`)
- Customer → Catalog endpoints: browses products (evidence: `README.md`)
- Customer → Cart endpoints: shops with (evidence: `README.md`)
- Customer → Order endpoints: tracks orders (evidence: `README.md`)
- Staff / admin → Admin operations: manages store (evidence: `README.md`)
- Account endpoints → Session auth: authenticates (evidence: `FreshCart/FreshCart/Controllers/AccountController.cs`)
- Account endpoints → Simulated email: sends recovery code (evidence: `FreshCart/FreshCart/Controllers/AccountController.cs`)
- Catalog endpoints → Product search: searches catalog (evidence: `FreshCart/FreshCart/Controllers/ProductController.cs`)
- Home endpoints → Product search: loads products (evidence: `FreshCart/FreshCart/Controllers/HomeController.cs`)
- Catalog endpoints → Cart operations: adds items (evidence: `FreshCart/FreshCart/Controllers/ProductController.cs`)
- Cart endpoints → Cart operations: manages cart (evidence: `FreshCart/FreshCart/Controllers/CartController.cs`)
- Cart endpoints → Order workflow: submits checkout (evidence: `FreshCart/FreshCart/Controllers/CartController.cs`)
- Cart endpoints → Simulated email: requests confirmation (evidence: `FreshCart/FreshCart/Controllers/CartController.cs`)
- Order endpoints → Order workflow: tracks status (evidence: `FreshCart/FreshCart/Controllers/OrderController.cs`)
- Admin operations → Session auth: checks roles (evidence: `FreshCart/FreshCart/Controllers/AdminController.cs`)
- Admin operations → Order workflow: manages orders (evidence: `FreshCart/FreshCart/Controllers/AdminController.cs`)
- Admin operations → Product search: reads catalog (evidence: `FreshCart/FreshCart/Controllers/AdminController.cs`)
- Session auth → Application database: reads users (evidence: `FreshCart/FreshCart/Services/AuthService.cs`)
- Session auth → User records: loads user (evidence: `FreshCart/FreshCart/Services/AuthService.cs`)
- Product search → Application database: queries catalog (evidence: `FreshCart/FreshCart/Services/ProductService.cs`)
- Cart operations → Session auth: gets current user (evidence: `FreshCart/FreshCart/Services/CartService.cs`)
- Cart operations → Application database: reads and writes cart (evidence: `FreshCart/FreshCart/Services/CartService.cs`)
- Order workflow → Session auth: gets current user (evidence: `FreshCart/FreshCart/Services/OrderService.cs`)
- Order workflow → Cart operations: uses and clears cart (evidence: `FreshCart/FreshCart/Services/OrderService.cs`)
- Order workflow → Application database: creates and updates orders (evidence: `FreshCart/FreshCart/Services/OrderService.cs`)
- Simulated email → Email log: appends messages (evidence: `FreshCart/FreshCart/Services/EmailService.cs`)
- Application database → User records: maps records (evidence: `FreshCart/FreshCart/Data/ApplicationDbContext.cs`)
- Application database → Product records: maps records (evidence: `FreshCart/FreshCart/Data/ApplicationDbContext.cs`)
- Application database → Category records: maps records (evidence: `FreshCart/FreshCart/Data/ApplicationDbContext.cs`)
- Application database → Cart records: maps records (evidence: `FreshCart/FreshCart/Data/ApplicationDbContext.cs`)
- Application database → Order records: maps records (evidence: `FreshCart/FreshCart/Data/ApplicationDbContext.cs`)
- Application database → Order line records: maps records (evidence: `FreshCart/FreshCart/Data/ApplicationDbContext.cs`)
- Order workflow → Order records: sets six statuses (evidence: `FreshCart/FreshCart/Services/OrderService.cs`)
