# ecnalyr/pos architecture

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

- Interactive diagram: https://gitdiagram.com/ecnalyr/pos
- Repository: https://github.com/ecnalyr/pos

## Overview

POS is an MVC point-of-sale application organized around establishments, product catalogs, shopping carts, checkout orders, and staff accounts. The main customer workflow is to browse establishment products, add items from one establishment to a cart, submit shipping details, and create an order; separate management and reporting routes serve staff. The source excerpts show the cart-to-order processing and product persistence implementations. Several controller and membership connections are indicated by the source index but not demonstrated in excerpts, so those links are marked unverified rather than asserted as observed calls.

Main entry points: [`POS.Domain/ApplicationService/CartApplicationService.cs`](https://github.com/ecnalyr/pos/blob/master/POS.Domain/ApplicationService/CartApplicationService.cs) (Order preparation), [`POS/Controllers/CartController.cs`](https://github.com/ecnalyr/pos/blob/master/POS/Controllers/CartController.cs) (Cart and checkout), [`POS.Infrastructure/Membership/CodeFirstMembershipProvider.cs`](https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/Membership/CodeFirstMembershipProvider.cs) (Membership provider), [`POS.Infrastructure/EfProductRepository.cs`](https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/EfProductRepository.cs) (Product repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_catalog_ui["Product browsing"]
  node_establishment_ui["Establishments"]
  node_cart_ui["Cart and checkout<br/>[CartController.cs]"]
  node_admin_ui["Catalog administration<br/>[AdminController.cs]"]
  node_order_details["Order details"]
  node_reports["Server reports"]
  node_account["Account access"]
  node_membership_ui["Membership"]
  node_membership_model["Membership model<br/>[Membership.cs]"]
end

subgraph group_domain["POS domain"]
  node_cart["Shopping cart<br/>[Cart.cs]"]
  node_cart_service["Order preparation"]
  node_shipping["Shipping details<br/>[ShippingDetails.cs]"]
  node_order["Orders<br/>[Order.cs]"]
  node_product["Products<br/>[Product.cs]"]
  node_categories["Product categories<br/>[Category.cs]"]
  node_parent_categories["Parent categories<br/>[ParentCategory.cs]"]
  node_establishment["Establishment model<br/>[Establishment.cs]"]
  node_user["Users and roles<br/>[User.cs]"]
end

subgraph group_infra["Persistence and identity"]
  node_product_repo["Product repository"]
  node_establishment_repo["Establishment repository"]
  node_order_repo["Order repository"]
  node_db[("Entity Framework store<br/>[EfDbContext.cs]")]
  node_membership_provider["Membership provider"]
  node_security["Web security<br/>[WebSecurity.cs]"]
end

node_customer(("Customer"))
node_staff(("Staff"))

node_customer -->|"browses"| node_catalog_ui
node_catalog_ui -.->|"queries catalog"| node_product_repo
node_customer -->|"manages cart"| node_cart_ui
node_cart_ui -.->|"loads products"| node_product_repo
node_cart_ui -.->|"updates cart"| node_cart
node_cart_ui -.->|"submits order"| node_cart_service
node_cart_service -->|"builds order"| node_order
node_cart_service -->|"creates order"| node_order_repo
node_cart_service -->|"clears cart"| node_cart
node_cart_service -->|"uses details"| node_shipping
node_cart -->|"contains items"| node_product
node_admin_ui -.->|"manages catalog"| node_product_repo
node_establishment_ui -.->|"manages locations"| node_establishment_repo
node_order_details -.->|"reads order data"| node_db
node_reports -.->|"queries orders"| node_order_repo
node_staff -->|"manages catalog"| node_admin_ui
node_staff -->|"manages locations"| node_establishment_ui
node_staff -->|"views reports"| node_reports
node_account -.->|"authenticates"| node_membership_provider
node_membership_ui -.->|"manages membership"| node_membership_provider
node_membership_provider -->|"uses model"| node_membership_model
node_membership_provider -->|"uses security"| node_security
node_product_repo -->|"reads and writes"| node_db
node_establishment_repo -->|"uses context"| node_db
node_order_repo -->|"uses context"| node_db
node_product -->|"belongs to"| node_categories
node_product -->|"sold at"| node_establishment
node_categories -->|"groups under"| node_parent_categories

click node_catalog_ui "https://github.com/ecnalyr/pos/blob/master/POS/Controllers/ProductController.cs"
click node_establishment_ui "https://github.com/ecnalyr/pos/blob/master/POS/Controllers/EstablishmentController.cs"
click node_cart_ui "https://github.com/ecnalyr/pos/blob/master/POS/Controllers/CartController.cs"
click node_admin_ui "https://github.com/ecnalyr/pos/blob/master/POS/Controllers/AdminController.cs"
click node_order_details "https://github.com/ecnalyr/pos/blob/master/POS/Controllers/OrderDetailsController.cs"
click node_reports "https://github.com/ecnalyr/pos/blob/master/POS/Controllers/ServerReportController.cs"
click node_account "https://github.com/ecnalyr/pos/blob/master/POS/Controllers/AccountController.cs"
click node_membership_ui "https://github.com/ecnalyr/pos/blob/master/POS/Controllers/MembershipController.cs"
click node_cart "https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/Cart.cs"
click node_cart_service "https://github.com/ecnalyr/pos/blob/master/POS.Domain/ApplicationService/CartApplicationService.cs"
click node_shipping "https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/ShippingDetails.cs"
click node_order "https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/Order.cs"
click node_product "https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/Product.cs"
click node_categories "https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/Category.cs"
click node_parent_categories "https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/ParentCategory.cs"
click node_establishment "https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/Establishment.cs"
click node_user "https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/User.cs"
click node_product_repo "https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/EfProductRepository.cs"
click node_establishment_repo "https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/EfEstablishmentRepository.cs"
click node_order_repo "https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/EfOrderRepository.cs"
click node_db "https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/EfDbContext.cs"
click node_membership_provider "https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/Membership/CodeFirstMembershipProvider.cs"
click node_security "https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/Membership/WebSecurity.cs"
click node_membership_model "https://github.com/ecnalyr/pos/blob/master/POS/Models/Membership.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_ui,node_establishment_ui,node_cart_ui,node_admin_ui,node_order_details,node_reports,node_account,node_membership_ui,node_membership_model toneBlue
class node_cart,node_cart_service,node_shipping,node_order,node_product,node_categories,node_parent_categories,node_establishment,node_user toneAmber
class node_product_repo,node_establishment_repo,node_order_repo,node_db,node_membership_provider,node_security toneMint
class node_customer,node_staff toneIndigo
```

## Components

### Web application

- [Product browsing](https://github.com/ecnalyr/pos/blob/master/POS/Controllers/ProductController.cs): `POS/Controllers/ProductController.cs`
- [Establishments](https://github.com/ecnalyr/pos/blob/master/POS/Controllers/EstablishmentController.cs): `POS/Controllers/EstablishmentController.cs`
- [Cart and checkout](https://github.com/ecnalyr/pos/blob/master/POS/Controllers/CartController.cs): `POS/Controllers/CartController.cs`
- [Catalog administration](https://github.com/ecnalyr/pos/blob/master/POS/Controllers/AdminController.cs): `POS/Controllers/AdminController.cs`
- [Order details](https://github.com/ecnalyr/pos/blob/master/POS/Controllers/OrderDetailsController.cs): `POS/Controllers/OrderDetailsController.cs`
- [Server reports](https://github.com/ecnalyr/pos/blob/master/POS/Controllers/ServerReportController.cs): `POS/Controllers/ServerReportController.cs`
- [Account access](https://github.com/ecnalyr/pos/blob/master/POS/Controllers/AccountController.cs): `POS/Controllers/AccountController.cs`
- [Membership](https://github.com/ecnalyr/pos/blob/master/POS/Controllers/MembershipController.cs): `POS/Controllers/MembershipController.cs`
- [Membership model](https://github.com/ecnalyr/pos/blob/master/POS/Models/Membership.cs): `POS/Models/Membership.cs`

### POS domain

- [Shopping cart](https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/Cart.cs): `POS.Domain/Model/Cart.cs`
- [Order preparation](https://github.com/ecnalyr/pos/blob/master/POS.Domain/ApplicationService/CartApplicationService.cs): `POS.Domain/ApplicationService/CartApplicationService.cs`
- [Shipping details](https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/ShippingDetails.cs): `POS.Domain/Model/ShippingDetails.cs`
- [Orders](https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/Order.cs): `POS.Domain/Model/Order.cs`
- [Products](https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/Product.cs): `POS.Domain/Model/Product.cs`
- [Product categories](https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/Category.cs): `POS.Domain/Model/Category.cs`
- [Parent categories](https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/ParentCategory.cs): `POS.Domain/Model/ParentCategory.cs`
- [Establishment model](https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/Establishment.cs): `POS.Domain/Model/Establishment.cs`
- [Users and roles](https://github.com/ecnalyr/pos/blob/master/POS.Domain/Model/User.cs): `POS.Domain/Model/User.cs`

### Persistence and identity

- [Product repository](https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/EfProductRepository.cs): `POS.Infrastructure/EfProductRepository.cs`
- [Establishment repository](https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/EfEstablishmentRepository.cs): `POS.Infrastructure/EfEstablishmentRepository.cs`
- [Order repository](https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/EfOrderRepository.cs): `POS.Infrastructure/EfOrderRepository.cs`
- [Entity Framework store](https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/EfDbContext.cs): `POS.Infrastructure/EfDbContext.cs`
- [Membership provider](https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/Membership/CodeFirstMembershipProvider.cs): `POS.Infrastructure/Membership/CodeFirstMembershipProvider.cs`
- [Web security](https://github.com/ecnalyr/pos/blob/master/POS.Infrastructure/Membership/WebSecurity.cs): `POS.Infrastructure/Membership/WebSecurity.cs`

### Other components

- **Customer**
- **Staff**

## Connections

- Customer → Product browsing: browses
- Product browsing → Product repository: queries catalog
- Customer → Cart and checkout: manages cart
- Cart and checkout → Product repository: loads products
- Cart and checkout → Shopping cart: updates cart (evidence: `POS/Controllers/CartController.cs`)
- Cart and checkout → Order preparation: submits order
- Order preparation → Orders: builds order (evidence: `POS.Domain/ApplicationService/CartApplicationService.cs`)
- Order preparation → Order repository: creates order (evidence: `POS.Domain/ApplicationService/CartApplicationService.cs`)
- Order preparation → Shopping cart: clears cart (evidence: `POS.Domain/ApplicationService/CartApplicationService.cs`)
- Order preparation → Shipping details: uses details (evidence: `POS.Domain/ApplicationService/CartApplicationService.cs`)
- Shopping cart → Products: contains items (evidence: `POS.Domain/Model/Cart.cs`)
- Catalog administration → Product repository: manages catalog
- Establishments → Establishment repository: manages locations
- Order details → Entity Framework store: reads order data (evidence: `POS/Controllers/OrderDetailsController.cs`)
- Server reports → Order repository: queries orders
- Staff → Catalog administration: manages catalog
- Staff → Establishments: manages locations
- Staff → Server reports: views reports
- Account access → Membership provider: authenticates
- Membership → Membership provider: manages membership
- Membership provider → Membership model: uses model (evidence: `POS.Infrastructure/Membership/CodeFirstMembershipProvider.cs`)
- Membership provider → Web security: uses security (evidence: `POS.Infrastructure/Membership/CodeFirstMembershipProvider.cs`)
- Product repository → Entity Framework store: reads and writes (evidence: `POS.Infrastructure/EfProductRepository.cs`)
- Establishment repository → Entity Framework store: uses context (evidence: `POS.Infrastructure/EfEstablishmentRepository.cs`)
- Order repository → Entity Framework store: uses context (evidence: `POS.Infrastructure/EfOrderRepository.cs`)
- Products → Product categories: belongs to (evidence: `POS.Domain/Model/Product.cs`)
- Products → Establishment model: sold at (evidence: `POS.Domain/Model/Product.cs`)
- Product categories → Parent categories: groups under (evidence: `POS.Domain/Model/Category.cs`)
