# codespheretechnologies/spicevendor architecture

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

- Interactive diagram: https://gitdiagram.com/codespheretechnologies/spicevendor
- Repository: https://github.com/codespheretechnologies/spicevendor

## Overview

SpiceVendor DMS is a multi-tenant field-sales and distribution management application, with Laravel web and API entry points and a mobile client indicated by the Windows Flutter launcher. The main sales workflow captures an order, applies lifecycle rules, and persists it; the application also covers customers, catalog and pricing, commissions, reporting, data transfer, and administration. Sampled controller and service code supports the customer, order, and webhook links shown. Other capability branches reflect the source tree; their internal wiring is not established by the excerpts.

Main entry points: [`backend/app/Services/WebhookService.php`](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/WebhookService.php) (Webhook management), [`backend/app/Http/Controllers/Web`](https://github.com/codespheretechnologies/spicevendor/tree/main/backend/app/Http/Controllers/Web) (Web controllers), [`backend/app/Http/Controllers/Api`](https://github.com/codespheretechnologies/spicevendor/tree/main/backend/app/Http/Controllers/Api) (API controllers), [`backend/app/Services/CustomerService.php`](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/CustomerService.php) (Customer management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_api_routes["API routes<br/>[api.php]"]
  node_web_controllers["Web controllers"]
  node_api_controllers["API controllers"]
end

subgraph group_sales["Sales operations"]
  node_customers["Customer management"]
  node_orders["Order lifecycle<br/>[OrderService.php]"]
  node_pricing["Product pricing<br/>[PricingService.php]"]
  node_catalog["Catalog management<br/>[ProductService.php]"]
  node_commissions["Commissions"]
end

subgraph group_insights["Insights and data"]
  node_dashboard["Dashboard"]
  node_reports["Reports<br/>[ReportService.php]"]
  node_imports["Data imports"]
  node_exports["Data exports"]
end

subgraph group_admin["Administration"]
  node_tenants_users["Tenant and user admin<br/>[TenantService.php]"]
  node_settings["Settings and access<br/>[SettingService.php]"]
  node_webhooks["Webhook management<br/>[WebhookService.php]"]
  node_audit["Activity and audit"]
end

subgraph group_runtime["Persistence and delivery"]
  node_repos["Repository layer"]
  node_models[("Domain records")]
  node_webhook_job["Webhook delivery job"]
end

node_user(("Staff user"))
node_mobile["Mobile client<br/>[main.cpp]"]
node_endpoint(("Webhook receiver"))

node_user -->|"uses"| node_web_routes
node_user -->|"uses"| node_api_routes
node_mobile -.->|"sends requests"| node_api_routes
node_web_controllers -->|"calls"| node_customers
node_api_controllers -->|"calls"| node_orders
node_api_controllers -->|"calls"| node_webhooks
node_web_controllers -->|"calls"| node_webhooks
node_orders -->|"persists through"| node_repos
node_customers -->|"persists through"| node_repos
node_webhooks -.->|"dispatches"| node_webhook_job
node_webhook_job -->|"posts payload"| node_endpoint

click node_mobile "https://github.com/codespheretechnologies/spicevendor/blob/main/mobile/windows/runner/main.cpp"
click node_web_routes "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/routes/web.php"
click node_api_routes "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/routes/api.php"
click node_web_controllers "https://github.com/codespheretechnologies/spicevendor/tree/main/backend/app/Http/Controllers/Web"
click node_api_controllers "https://github.com/codespheretechnologies/spicevendor/tree/main/backend/app/Http/Controllers/Api"
click node_customers "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/CustomerService.php"
click node_orders "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/OrderService.php"
click node_pricing "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/PricingService.php"
click node_catalog "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/ProductService.php"
click node_commissions "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/CommissionService.php"
click node_dashboard "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/DashboardService.php"
click node_reports "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/ReportService.php"
click node_imports "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/DataImportService.php"
click node_exports "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/DataExportService.php"
click node_tenants_users "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/TenantService.php"
click node_settings "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/SettingService.php"
click node_webhooks "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/WebhookService.php"
click node_audit "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/ActivityLogService.php"
click node_repos "https://github.com/codespheretechnologies/spicevendor/tree/main/backend/app/Repositories/Implementations"
click node_models "https://github.com/codespheretechnologies/spicevendor/tree/main/backend/app/Models"
click node_webhook_job "https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Jobs/DispatchWebhook.php"

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_web_routes,node_api_routes,node_web_controllers,node_api_controllers,node_user,node_mobile toneBlue
class node_customers,node_orders,node_pricing,node_catalog,node_commissions toneAmber
class node_dashboard,node_reports,node_imports,node_exports,node_endpoint toneMint
class node_tenants_users,node_settings,node_webhooks,node_audit toneRose
class node_repos,node_models,node_webhook_job toneIndigo
```

## Components

### Application entry

- [Web routes](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/routes/web.php): `backend/routes/web.php`
- [API routes](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [Web controllers](https://github.com/codespheretechnologies/spicevendor/tree/main/backend/app/Http/Controllers/Web): `backend/app/Http/Controllers/Web`
- [API controllers](https://github.com/codespheretechnologies/spicevendor/tree/main/backend/app/Http/Controllers/Api): `backend/app/Http/Controllers/Api`

### Sales operations

- [Customer management](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/CustomerService.php): `backend/app/Services/CustomerService.php`
- [Order lifecycle](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/OrderService.php): `backend/app/Services/OrderService.php`
- [Product pricing](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/PricingService.php): `backend/app/Services/PricingService.php`
- [Catalog management](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/ProductService.php): `backend/app/Services/ProductService.php`
- [Commissions](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/CommissionService.php): `backend/app/Services/CommissionService.php`

### Insights and data

- [Dashboard](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/DashboardService.php): `backend/app/Services/DashboardService.php`
- [Reports](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/ReportService.php): `backend/app/Services/ReportService.php`
- [Data imports](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/DataImportService.php): `backend/app/Services/DataImportService.php`
- [Data exports](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/DataExportService.php): `backend/app/Services/DataExportService.php`

### Administration

- [Tenant and user admin](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/TenantService.php): `backend/app/Services/TenantService.php`
- [Settings and access](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/SettingService.php): `backend/app/Services/SettingService.php`
- [Webhook management](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/WebhookService.php): `backend/app/Services/WebhookService.php`
- [Activity and audit](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Services/ActivityLogService.php): `backend/app/Services/ActivityLogService.php`

### Persistence and delivery

- [Repository layer](https://github.com/codespheretechnologies/spicevendor/tree/main/backend/app/Repositories/Implementations): `backend/app/Repositories/Implementations`
- [Domain records](https://github.com/codespheretechnologies/spicevendor/tree/main/backend/app/Models): `backend/app/Models`
- [Webhook delivery job](https://github.com/codespheretechnologies/spicevendor/blob/main/backend/app/Jobs/DispatchWebhook.php): `backend/app/Jobs/DispatchWebhook.php`

### Other components

- **Staff user**
- [Mobile client](https://github.com/codespheretechnologies/spicevendor/blob/main/mobile/windows/runner/main.cpp): `mobile/windows/runner/main.cpp`
- **Webhook receiver**

## Connections

- Staff user → Web routes: uses
- Staff user → API routes: uses
- Mobile client → API routes: sends requests
- Web controllers → Customer management: calls
- API controllers → Order lifecycle: calls
- API controllers → Webhook management: calls
- Web controllers → Webhook management: calls
- Order lifecycle → Repository layer: persists through
- Customer management → Repository layer: persists through
- Webhook management → Webhook delivery job: dispatches
- Webhook delivery job → Webhook receiver: posts payload
