# khurt-code/alvanz_stock_captone-project architecture

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

- Interactive diagram: https://gitdiagram.com/khurt-code/alvanz_stock_captone-project
- Repository: https://github.com/khurt-code/alvanz_stock_captone-project

## Overview

AlvanzStock is a Django inventory and point-of-sale application. Staff sign in, manage the product catalog and stock movements, or cashiers complete a sale that records receipt line items and decrements stock; managers review sales and inventory reports. The graph separates authentication, inventory operations, checkout, and reporting, with models as the internal data layer. README capabilities such as low-stock alerts, real-time stock, and reports are represented; routes and views not excerpted are linked only where the README or source index supports them.

Main entry points: [`inventory/models.py`](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/models.py) (Products & stock records), [`pos/views.py`](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py) (Checkout validation), [`pos/models.py`](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/models.py) (Sales & line items), [`inventory/views.py`](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/views.py) (Catalog management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Accounts &amp; access"]
  node_login["Sign in<br/>[views.py]"]
  node_users["Roles &amp; users<br/>[models.py]"]
end

subgraph group_inventory["Inventory operations"]
  node_catalog["Catalog management<br/>[views.py]"]
  node_catalog_forms["Product &amp; category forms<br/>[forms.py]"]
  node_stock_ops["Stock movements<br/>[views.py]"]
  node_inventory_data[("Products &amp; stock records<br/>[models.py]")]
end

subgraph group_checkout["Point of sale"]
  node_pos_screen["POS screen<br/>[views.py]"]
  node_checkout_handler["Checkout validation<br/>[views.py]"]
  node_sale_recording["Sale recording<br/>[models.py]"]
  node_sales_data[("Sales &amp; line items<br/>[models.py]")]
  node_receipt["Receipt<br/>[views.py]"]
end

subgraph group_insight["Monitoring &amp; reports"]
  node_live_stock["Real-time stock<br/>[views.py]"]
  node_low_stock["Low-stock alerts<br/>[views.py]"]
  node_dashboard["Dashboard<br/>[views.py]"]
  node_sales_history["Sales history<br/>[views.py]"]
  node_sales_report["Sales report<br/>[views.py]"]
  node_inventory_report["Inventory report<br/>[views.py]"]
end

node_staff(("Store staff"))

node_staff -->|"signs in"| node_login
node_login -.->|"authenticates"| node_users
node_staff -.->|"manages catalog"| node_catalog
node_catalog -->|"validates input"| node_catalog_forms
node_catalog -->|"reads and writes"| node_inventory_data
node_staff -.->|"records movement"| node_stock_ops
node_stock_ops -->|"validates input"| node_catalog_forms
node_stock_ops -->|"creates movements"| node_inventory_data
node_inventory_data -->|"updates quantity"| node_inventory_data
node_staff -.->|"opens POS"| node_pos_screen
node_pos_screen -->|"loads products"| node_inventory_data
node_pos_screen -.->|"submits cart"| node_checkout_handler
node_checkout_handler -->|"checks stock"| node_inventory_data
node_checkout_handler -->|"records sale"| node_sale_recording
node_sale_recording -->|"creates sale items"| node_sales_data
node_sale_recording -->|"records stock-out"| node_inventory_data
node_checkout_handler -->|"returns receipt ID"| node_receipt
node_staff -.->|"monitors stock"| node_live_stock
node_live_stock -->|"reads quantities"| node_inventory_data
node_staff -.->|"checks alerts"| node_low_stock
node_low_stock -->|"finds low stock"| node_inventory_data
node_staff -.->|"views overview"| node_dashboard
node_dashboard -->|"aggregates stock"| node_inventory_data
node_dashboard -->|"reads sales"| node_sales_data
node_staff -.->|"reviews sales"| node_sales_history
node_sales_history -->|"filters sales"| node_sales_data
node_staff -.->|"requests report"| node_sales_report
node_sales_report -->|"aggregates sales"| node_sales_data
node_staff -.->|"requests valuation"| node_inventory_report
node_inventory_report -->|"values inventory"| node_inventory_data

click node_login "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/accounts/views.py"
click node_users "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/accounts/models.py"
click node_catalog "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/views.py"
click node_catalog_forms "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/forms.py"
click node_stock_ops "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/views.py"
click node_inventory_data "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/models.py"
click node_pos_screen "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py"
click node_checkout_handler "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py"
click node_sale_recording "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/models.py"
click node_sales_data "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/models.py"
click node_receipt "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py"
click node_live_stock "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/views.py"
click node_low_stock "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/views.py"
click node_dashboard "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/views.py"
click node_sales_history "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py"
click node_sales_report "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py"
click node_inventory_report "https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py"

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_login,node_users toneBlue
class node_catalog,node_catalog_forms,node_stock_ops,node_inventory_data toneAmber
class node_pos_screen,node_checkout_handler,node_sale_recording,node_sales_data,node_receipt toneMint
class node_live_stock,node_low_stock,node_dashboard,node_sales_history,node_sales_report,node_inventory_report toneRose
class node_staff toneIndigo
```

## Components

### Accounts & access

- [Sign in](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/accounts/views.py): `accounts/views.py`
- [Roles & users](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/accounts/models.py): `accounts/models.py`

### Inventory operations

- [Catalog management](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/views.py): `inventory/views.py`
- [Product & category forms](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/forms.py): `inventory/forms.py`
- [Stock movements](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/views.py): `inventory/views.py`
- [Products & stock records](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/models.py): `inventory/models.py`

### Point of sale

- [POS screen](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py): `pos/views.py`
- [Checkout validation](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py): `pos/views.py`
- [Sale recording](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/models.py): `pos/models.py`
- [Sales & line items](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/models.py): `pos/models.py`
- [Receipt](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py): `pos/views.py`

### Monitoring & reports

- [Real-time stock](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/views.py): `inventory/views.py`
- [Low-stock alerts](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/views.py): `inventory/views.py`
- [Dashboard](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/inventory/views.py): `inventory/views.py`
- [Sales history](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py): `pos/views.py`
- [Sales report](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py): `pos/views.py`
- [Inventory report](https://github.com/khurt-code/alvanz_stock_captone-project/blob/main/pos/views.py): `pos/views.py`

### Other components

- **Store staff**

## Connections

- Store staff → Sign in: signs in (evidence: `README.md`)
- Sign in → Roles & users: authenticates
- Store staff → Catalog management: manages catalog
- Catalog management → Product & category forms: validates input (evidence: `inventory/views.py`)
- Catalog management → Products & stock records: reads and writes (evidence: `inventory/views.py`)
- Store staff → Stock movements: records movement
- Stock movements → Product & category forms: validates input (evidence: `inventory/views.py`)
- Stock movements → Products & stock records: creates movements (evidence: `inventory/views.py`)
- Products & stock records → Products & stock records: updates quantity (evidence: `inventory/models.py`)
- Store staff → POS screen: opens POS
- POS screen → Products & stock records: loads products (evidence: `pos/views.py`)
- POS screen → Checkout validation: submits cart (evidence: `pos/views.py`)
- Checkout validation → Products & stock records: checks stock (evidence: `pos/views.py`)
- Checkout validation → Sale recording: records sale (evidence: `pos/views.py`)
- Sale recording → Sales & line items: creates sale items (evidence: `pos/models.py`)
- Sale recording → Products & stock records: records stock-out (evidence: `pos/models.py`)
- Checkout validation → Receipt: returns receipt ID (evidence: `pos/views.py`)
- Store staff → Real-time stock: monitors stock
- Real-time stock → Products & stock records: reads quantities (evidence: `inventory/views.py`)
- Store staff → Low-stock alerts: checks alerts
- Low-stock alerts → Products & stock records: finds low stock (evidence: `inventory/views.py`)
- Store staff → Dashboard: views overview
- Dashboard → Products & stock records: aggregates stock (evidence: `inventory/views.py`)
- Dashboard → Sales & line items: reads sales (evidence: `inventory/views.py`)
- Store staff → Sales history: reviews sales
- Sales history → Sales & line items: filters sales (evidence: `pos/views.py`)
- Store staff → Sales report: requests report
- Sales report → Sales & line items: aggregates sales (evidence: `pos/views.py`)
- Store staff → Inventory report: requests valuation
- Inventory report → Products & stock records: values inventory (evidence: `pos/views.py`)
