# mahaqj/software-engineering-project architecture

> Architecture diagram of the GitHub repository mahaqj/software-engineering-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/mahaqj/software-engineering-project
- Repository: https://github.com/mahaqj/software-engineering-project

## Overview

SupplyCraft is a Django warehouse-to-restaurant inventory application. Restaurant managers sign up for warehouse approval, browse food stock, build and place orders, and track fulfillment and bills; warehouse managers maintain catalog batches and prices, restock inventory, process orders, and review reports. Notifications support manager communication. The sampled views call service functions, which implement business operations over Django models; URL routing and templates form the web interface. Some feature routes are documented in the URL map, but their detailed view/service interactions were not sampled.

Main entry points: [`backend/warehouse_inventory/views.py`](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/views.py) (Request handlers), [`backend/warehouse_inventory/services.py`](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/services.py) (Order processing), [`backend/warehouse_inventory/models.py`](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/models.py) (Food items and batches), [`backend/warehouse_inventory/urls.py`](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/urls.py) (App routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_routes["App routes<br/>[urls.py]"]
  node_views["Request handlers<br/>[views.py]"]
  node_templates["Page templates"]
  node_forms["Input forms<br/>[forms.py]"]
end

subgraph group_accounts["Manager accounts"]
  node_roles["Role guards<br/>[decorators.py]"]
  node_identity["Manager accounts<br/>[services.py]"]
end

subgraph group_inventory["Inventory operations"]
  node_inventory_ops["Catalog and stock<br/>[services.py]"]
  node_catalog[("Food items and batches<br/>[models.py]")]
end

subgraph group_commerce["Orders and billing"]
  node_order_ops["Order processing<br/>[services.py]"]
  node_orders[("Orders and lines<br/>[models.py]")]
  node_billing[("Payments and fees<br/>[models.py]")]
end

subgraph group_communications["Reports and messaging"]
  node_reports["Billing reports<br/>[services.py]"]
  node_messaging["Notifications<br/>[services.py]"]
  node_messages[("Manager messages<br/>[models.py]")]
end

node_browser(("Managers"))

node_browser -->|"requests pages"| node_routes
node_routes -->|"routes requests"| node_views
node_views -->|"renders pages"| node_templates
node_views -->|"uses forms"| node_forms
node_views -->|"checks roles"| node_roles
node_views -->|"creates accounts"| node_identity
node_views -->|"manages stock"| node_inventory_ops
node_views -->|"handles orders"| node_order_ops
node_views -->|"requests reports"| node_reports
node_views -->|"sends notices"| node_messaging
node_identity -->|"persists managers"| node_catalog
node_inventory_ops -->|"reads and writes"| node_catalog
node_order_ops -->|"creates and updates"| node_orders
node_order_ops -->|"allocates stock"| node_catalog
node_order_ops -->|"creates payments"| node_billing
node_reports -->|"queries payments"| node_billing
node_messaging -->|"stores messages"| node_messages

click node_routes "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/urls.py"
click node_views "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/views.py"
click node_templates "https://github.com/mahaqj/software-engineering-project/tree/main/backend/warehouse_inventory/templates/warehouse_inventory"
click node_forms "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/forms.py"
click node_roles "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/decorators.py"
click node_identity "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/services.py"
click node_inventory_ops "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/services.py"
click node_catalog "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/models.py"
click node_order_ops "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/services.py"
click node_orders "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/models.py"
click node_billing "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/models.py"
click node_reports "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/services.py"
click node_messaging "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/services.py"
click node_messages "https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/models.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_routes,node_views,node_templates,node_forms toneBlue
class node_roles,node_identity toneAmber
class node_inventory_ops,node_catalog toneMint
class node_order_ops,node_orders,node_billing toneRose
class node_reports,node_messaging,node_messages,node_browser toneIndigo
```

## Components

### Web interface

- [App routes](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/urls.py): `backend/warehouse_inventory/urls.py`
- [Request handlers](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/views.py): `backend/warehouse_inventory/views.py`
- [Page templates](https://github.com/mahaqj/software-engineering-project/tree/main/backend/warehouse_inventory/templates/warehouse_inventory): `backend/warehouse_inventory/templates/warehouse_inventory`
- [Input forms](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/forms.py): `backend/warehouse_inventory/forms.py`

### Manager accounts

- [Role guards](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/decorators.py): `backend/warehouse_inventory/decorators.py`
- [Manager accounts](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/services.py): `backend/warehouse_inventory/services.py`

### Inventory operations

- [Catalog and stock](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/services.py): `backend/warehouse_inventory/services.py`
- [Food items and batches](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/models.py): `backend/warehouse_inventory/models.py`

### Orders and billing

- [Order processing](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/services.py): `backend/warehouse_inventory/services.py`
- [Orders and lines](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/models.py): `backend/warehouse_inventory/models.py`
- [Payments and fees](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/models.py): `backend/warehouse_inventory/models.py`

### Reports and messaging

- [Billing reports](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/services.py): `backend/warehouse_inventory/services.py`
- [Notifications](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/services.py): `backend/warehouse_inventory/services.py`
- [Manager messages](https://github.com/mahaqj/software-engineering-project/blob/main/backend/warehouse_inventory/models.py): `backend/warehouse_inventory/models.py`

### Other components

- **Managers**

## Connections

- Managers → App routes: requests pages (evidence: `README.md`)
- App routes → Request handlers: routes requests (evidence: `backend/warehouse_inventory/urls.py`)
- Request handlers → Page templates: renders pages (evidence: `backend/warehouse_inventory/views.py`)
- Request handlers → Input forms: uses forms (evidence: `backend/warehouse_inventory/views.py`)
- Request handlers → Role guards: checks roles (evidence: `backend/warehouse_inventory/views.py`)
- Request handlers → Manager accounts: creates accounts (evidence: `backend/warehouse_inventory/views.py`)
- Request handlers → Catalog and stock: manages stock (evidence: `backend/warehouse_inventory/views.py`)
- Request handlers → Order processing: handles orders (evidence: `backend/warehouse_inventory/views.py`)
- Request handlers → Billing reports: requests reports (evidence: `backend/warehouse_inventory/views.py`)
- Request handlers → Notifications: sends notices (evidence: `backend/warehouse_inventory/views.py`)
- Manager accounts → Food items and batches: persists managers (evidence: `backend/warehouse_inventory/services.py`)
- Catalog and stock → Food items and batches: reads and writes (evidence: `backend/warehouse_inventory/services.py`)
- Order processing → Orders and lines: creates and updates (evidence: `backend/warehouse_inventory/services.py`)
- Order processing → Food items and batches: allocates stock (evidence: `backend/warehouse_inventory/services.py`)
- Order processing → Payments and fees: creates payments (evidence: `backend/warehouse_inventory/services.py`)
- Billing reports → Payments and fees: queries payments (evidence: `backend/warehouse_inventory/services.py`)
- Notifications → Manager messages: stores messages (evidence: `backend/warehouse_inventory/services.py`)
