# milanmagrati/e-commerce-project architecture

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

- Interactive diagram: https://gitdiagram.com/milanmagrati/e-commerce-project
- Repository: https://github.com/milanmagrati/e-commerce-project

## Overview

This is a Django operations and commerce platform: customers place store orders, while staff manage orders, inventory, delivery, billing, and related business workflows. Its separate apps also cover HR, rewards, chat/CRM, Google Sheets synchronization, and Sentinel Vault auditing. The tree and source index establish these product areas; sampled excerpts support only the specific service-to-model and webhook relationships shown below. The README is empty, and unsampled app internals and most routing relationships are not verified.

Main entry points: [`myproject/dashboard/models.py`](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/dashboard/models.py) (Orders and products), [`myproject/ncm/webhook_handler.py`](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/ncm/webhook_handler.py) (NCM webhook handler), [`myproject/sentinel/services.py`](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/sentinel/services.py) (Sentinel Vault), [`myproject/services/ncm_service.py`](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/services/ncm_service.py) (NCM logistics sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commerce["Commerce and inventory"]
  node_storefront["Online storefront<br/>[views.py]"]
  node_store_orders[("Store orders<br/>[models.py]")]
  node_stock["Stock reservations<br/>[services.py]"]
end

subgraph group_operations["Business operations"]
  node_dashboard["Operations dashboard<br/>[views.py]"]
  node_dashboard_data[("Orders and products<br/>[models.py]")]
  node_hrm["HR and payroll<br/>[views.py]"]
  node_rewards["Bill rewards<br/>[ocr_service.py]"]
  node_product_match["Product matching"]
end

subgraph group_integrations["External integrations"]
  node_sheets["Sheets synchronization<br/>[services.py]"]
  node_ncm_sync["NCM logistics sync<br/>[ncm_service.py]"]
  node_ncm_webhook["NCM webhook handler<br/>[webhook_handler.py]"]
  node_ncm_data[("NCM records<br/>[models.py]")]
  node_sms["SMS notifications<br/>[sms_service.py]"]
  node_woocommerce["WooCommerce sync<br/>[services.py]"]
  node_woo_data[("WooCommerce orders<br/>[models.py]")]
  node_delivery["Pick and Drop service"]
end

subgraph group_people["People and engagement"]
  node_chat["Chat<br/>[views.py]"]
  node_crm["TrendyCRM<br/>[views.py]"]
end

subgraph group_platform["Access and auditing"]
  node_accounts["Accounts<br/>[views.py]"]
  node_sentinel["Sentinel Vault<br/>[services.py]"]
  node_sentinel_context["Audit context<br/>[context.py]"]
  node_sentinel_registry["Audit registry<br/>[registry.py]"]
  node_sentinel_data[("Audit records<br/>[models.py]")]
  node_sentinel_utils["Audit utilities<br/>[utils.py]"]
end

node_customer(("Customer"))
node_ncm_api(("NCM API<br/>external system"))
node_delivery_api(("Delivery API<br/>external system"))

node_customer -.->|"browses"| node_storefront
node_storefront -.->|"records orders"| node_store_orders
node_stock -->|"reserves stock"| node_store_orders
node_stock -->|"updates reservations"| node_dashboard_data
node_product_match -->|"matches products"| node_dashboard_data
node_product_match -.->|"supports bill matching"| node_rewards
node_sheets -->|"reads or writes"| node_dashboard_data
node_sheets -.->|"reads or writes"| node_store_orders
node_sheets -.->|"reads or writes"| node_woo_data
node_ncm_webhook -->|"updates orders"| node_dashboard_data
node_ncm_webhook -->|"records webhook"| node_ncm_data
node_ncm_webhook -->|"sends notifications"| node_sms
node_ncm_webhook -->|"uses service"| node_ncm_sync
node_ncm_webhook -->|"uses timezone utilities"| node_dashboard_data
node_ncm_webhook -->|"checks status overrides"| node_dashboard_data
node_ncm_sync -->|"uses order data"| node_dashboard_data
node_ncm_sync -->|"uses timezone utilities"| node_dashboard_data
node_ncm_sync -->|"calls API"| node_ncm_api
node_ncm_api -.->|"posts events"| node_ncm_webhook
node_woocommerce -->|"upserts orders"| node_store_orders
node_woocommerce -->|"upserts records"| node_woo_data
node_delivery -->|"calls API"| node_delivery_api
node_sentinel -->|"uses context"| node_sentinel_context
node_sentinel -->|"uses registry"| node_sentinel_registry
node_sentinel -->|"records audit data"| node_sentinel_data
node_sentinel -->|"uses utilities"| node_sentinel_utils
node_sentinel -->|"uses timezone utilities"| node_dashboard_data

click node_storefront "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/store/views.py"
click node_store_orders "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/store/models.py"
click node_stock "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/inventory/services.py"
click node_dashboard "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/dashboard/views.py"
click node_dashboard_data "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/dashboard/models.py"
click node_hrm "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/hrm/views.py"
click node_rewards "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/bill_rewards/ocr_service.py"
click node_product_match "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/bill_rewards/matching_service.py"
click node_sheets "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/google_sheets/services.py"
click node_ncm_sync "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/services/ncm_service.py"
click node_ncm_webhook "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/ncm/webhook_handler.py"
click node_ncm_data "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/ncm/models.py"
click node_sms "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/services/sms_service.py"
click node_woocommerce "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/integrations/services.py"
click node_woo_data "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/integrations/models.py"
click node_delivery "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/services/pick_and_drop_service.py"
click node_chat "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/chat/views.py"
click node_crm "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/trendycrm/views.py"
click node_accounts "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/accounts/views.py"
click node_sentinel "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/sentinel/services.py"
click node_sentinel_context "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/sentinel/context.py"
click node_sentinel_registry "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/sentinel/registry.py"
click node_sentinel_data "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/sentinel/models.py"
click node_sentinel_utils "https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/sentinel/utils.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_storefront,node_store_orders,node_stock toneBlue
class node_dashboard,node_dashboard_data,node_hrm,node_rewards,node_product_match toneAmber
class node_sheets,node_ncm_sync,node_ncm_webhook,node_ncm_data,node_sms,node_woocommerce,node_woo_data,node_delivery,node_ncm_api,node_delivery_api toneMint
class node_chat,node_crm toneRose
class node_accounts,node_sentinel,node_sentinel_context,node_sentinel_registry,node_sentinel_data,node_sentinel_utils,node_customer toneIndigo
```

## Components

### Commerce and inventory

- [Online storefront](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/store/views.py): `myproject/store/views.py`
- [Store orders](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/store/models.py): `myproject/store/models.py`
- [Stock reservations](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/inventory/services.py): `myproject/inventory/services.py`

### Business operations

- [Operations dashboard](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/dashboard/views.py): `myproject/dashboard/views.py`
- [Orders and products](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/dashboard/models.py): `myproject/dashboard/models.py`
- [HR and payroll](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/hrm/views.py): `myproject/hrm/views.py`
- [Bill rewards](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/bill_rewards/ocr_service.py): `myproject/bill_rewards/ocr_service.py`
- [Product matching](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/bill_rewards/matching_service.py): `myproject/bill_rewards/matching_service.py`

### External integrations

- [Sheets synchronization](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/google_sheets/services.py): `myproject/google_sheets/services.py`
- [NCM logistics sync](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/services/ncm_service.py): `myproject/services/ncm_service.py`
- [NCM webhook handler](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/ncm/webhook_handler.py): `myproject/ncm/webhook_handler.py`
- [NCM records](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/ncm/models.py): `myproject/ncm/models.py`
- [SMS notifications](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/services/sms_service.py): `myproject/services/sms_service.py`
- [WooCommerce sync](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/integrations/services.py): `myproject/integrations/services.py`
- [WooCommerce orders](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/integrations/models.py): `myproject/integrations/models.py`
- [Pick and Drop service](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/services/pick_and_drop_service.py): `myproject/services/pick_and_drop_service.py`

### People and engagement

- [Chat](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/chat/views.py): `myproject/chat/views.py`
- [TrendyCRM](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/trendycrm/views.py): `myproject/trendycrm/views.py`

### Access and auditing

- [Accounts](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/accounts/views.py): `myproject/accounts/views.py`
- [Sentinel Vault](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/sentinel/services.py): `myproject/sentinel/services.py`
- [Audit context](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/sentinel/context.py): `myproject/sentinel/context.py`
- [Audit registry](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/sentinel/registry.py): `myproject/sentinel/registry.py`
- [Audit records](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/sentinel/models.py): `myproject/sentinel/models.py`
- [Audit utilities](https://github.com/milanmagrati/e-commerce-project/blob/main/myproject/sentinel/utils.py): `myproject/sentinel/utils.py`

### Other components

- **Customer**
- **NCM API**: external system
- **Delivery API**: external system

## Connections

- Customer → Online storefront: browses
- Online storefront → Store orders: records orders
- Stock reservations → Store orders: reserves stock (evidence: `myproject/inventory/services.py`)
- Stock reservations → Orders and products: updates reservations (evidence: `myproject/inventory/services.py`)
- Product matching → Orders and products: matches products (evidence: `myproject/bill_rewards/matching_service.py`)
- Product matching → Bill rewards: supports bill matching
- Sheets synchronization → Orders and products: reads or writes (evidence: `myproject/google_sheets/services.py`)
- Sheets synchronization → Store orders: reads or writes
- Sheets synchronization → WooCommerce orders: reads or writes
- NCM webhook handler → Orders and products: updates orders (evidence: `myproject/ncm/webhook_handler.py`)
- NCM webhook handler → NCM records: records webhook (evidence: `myproject/ncm/webhook_handler.py`)
- NCM webhook handler → SMS notifications: sends notifications (evidence: `myproject/ncm/webhook_handler.py`)
- NCM webhook handler → NCM logistics sync: uses service (evidence: `myproject/ncm/webhook_handler.py`)
- NCM webhook handler → Orders and products: uses timezone utilities (evidence: `myproject/ncm/webhook_handler.py`)
- NCM webhook handler → Orders and products: checks status overrides (evidence: `myproject/ncm/webhook_handler.py`)
- NCM logistics sync → Orders and products: uses order data (evidence: `myproject/services/ncm_service.py`)
- NCM logistics sync → Orders and products: uses timezone utilities (evidence: `myproject/services/ncm_service.py`)
- NCM logistics sync → NCM API: calls API (evidence: `myproject/services/ncm_service.py`)
- NCM API → NCM webhook handler: posts events
- WooCommerce sync → Store orders: upserts orders (evidence: `myproject/integrations/services.py`)
- WooCommerce sync → WooCommerce orders: upserts records (evidence: `myproject/integrations/services.py`)
- Pick and Drop service → Delivery API: calls API (evidence: `myproject/services/pick_and_drop_service.py`)
- Sentinel Vault → Audit context: uses context (evidence: `myproject/sentinel/services.py`)
- Sentinel Vault → Audit registry: uses registry (evidence: `myproject/sentinel/services.py`)
- Sentinel Vault → Audit records: records audit data (evidence: `myproject/sentinel/services.py`)
- Sentinel Vault → Audit utilities: uses utilities (evidence: `myproject/sentinel/services.py`)
- Sentinel Vault → Orders and products: uses timezone utilities (evidence: `myproject/sentinel/services.py`)
