# abdellahmdi/khmis-sanad architecture

> Architecture diagram of the GitHub repository abdellahmdi/khmis-sanad, 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/abdellahmdi/khmis-sanad
- Repository: https://github.com/abdellahmdi/khmis-sanad

## Overview

Khmis-Sanad is a multi-vendor artisan marketplace: buyers browse products, manage a cart, and initiate order discussions with sellers; artisans maintain cooperative storefronts and inventory. The React SPA is documented as a client of a Laravel REST API, with Laravel controllers handling authentication, catalog, cart/orders, reviews, and seller operations. The README also describes moderation and email alerts, but sampled source does not establish their implementation or wiring. Some frontend and API behavior is inferred from the tree and README, so uncertain links are omitted.

Main entry points: [`Backend/routes/api.php`](https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/routes/api.php) (API routes), [`Backend/app/Models`](https://github.com/abdellahmdi/khmis-sanad/tree/main/Backend/app/Models) (Domain models), [`Frontend/src/App.jsx`](https://github.com/abdellahmdi/khmis-sanad/blob/main/Frontend/src/App.jsx) (React SPA), [`Frontend/src/pages/HomePage.jsx`](https://github.com/abdellahmdi/khmis-sanad/blob/main/Frontend/src/pages/HomePage.jsx) (Marketplace UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Buyer experience"]
  node_spa["React SPA<br/>[App.jsx]"]
  node_home["Marketplace UI<br/>[HomePage.jsx]"]
  node_http["API client<br/>[axiosClient.js]"]
end

subgraph group_api["Laravel API"]
  node_api_entry["API routes<br/>[api.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
end

subgraph group_commerce["Marketplace operations"]
  node_catalog["Product catalog"]
  node_categories["Categories"]
  node_cart["Cart management<br/>[CartController.php]"]
  node_orders["Buyer orders"]
  node_shops["Storefronts<br/>[ShopController.php]"]
  node_shop_products["Seller inventory"]
  node_shop_orders["Seller orders"]
  node_reviews["Reviews"]
end

subgraph group_data["Persistent data"]
  node_models["Domain models"]
  node_database[("Application database<br/>[database.php]")]
end

node_buyer(("Buyer"))
node_artisan(("Artisan"))
node_whatsapp["WhatsApp"]

node_buyer -->|"uses"| node_spa
node_artisan -->|"uses"| node_spa
node_spa -->|"renders"| node_home
node_home -->|"requests API"| node_http
node_http -->|"sends requests"| node_api_entry
node_api_entry -->|"dispatches"| node_auth
node_api_entry -->|"dispatches"| node_catalog
node_api_entry -->|"dispatches"| node_categories
node_api_entry -->|"dispatches"| node_cart
node_api_entry -->|"dispatches"| node_orders
node_api_entry -->|"dispatches"| node_shops
node_api_entry -->|"dispatches"| node_shop_products
node_api_entry -->|"dispatches"| node_shop_orders
node_api_entry -->|"dispatches"| node_reviews
node_spa -->|"opens order chat"| node_whatsapp
node_auth -->|"reads/writes"| node_models
node_catalog -->|"reads"| node_models
node_categories -->|"reads"| node_models
node_cart -->|"reads/writes"| node_models
node_orders -->|"reads/writes"| node_models
node_shops -->|"reads/writes"| node_models
node_shop_products -->|"reads/writes"| node_models
node_shop_orders -->|"reads/writes"| node_models
node_reviews -->|"reads/writes"| node_models
node_models -->|"persists"| node_database

click node_spa "https://github.com/abdellahmdi/khmis-sanad/blob/main/Frontend/src/App.jsx"
click node_home "https://github.com/abdellahmdi/khmis-sanad/blob/main/Frontend/src/pages/HomePage.jsx"
click node_http "https://github.com/abdellahmdi/khmis-sanad/blob/main/Frontend/src/api/axiosClient.js"
click node_api_entry "https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/routes/api.php"
click node_auth "https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/AuthController.php"
click node_catalog "https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/ProductController.php"
click node_categories "https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/CategoryController.php"
click node_cart "https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/CartController.php"
click node_orders "https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/OrderController.php"
click node_shops "https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/ShopController.php"
click node_shop_products "https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/ShopProductController.php"
click node_shop_orders "https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/ShopOrderController.php"
click node_reviews "https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/ReviewController.php"
click node_models "https://github.com/abdellahmdi/khmis-sanad/tree/main/Backend/app/Models"
click node_database "https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/config/database.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_spa,node_home,node_http toneBlue
class node_api_entry,node_auth toneAmber
class node_catalog,node_categories,node_cart,node_orders,node_shops,node_shop_products,node_shop_orders,node_reviews toneMint
class node_models,node_database toneRose
class node_buyer,node_artisan,node_whatsapp toneIndigo
```

## Components

### Buyer experience

- [React SPA](https://github.com/abdellahmdi/khmis-sanad/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Marketplace UI](https://github.com/abdellahmdi/khmis-sanad/blob/main/Frontend/src/pages/HomePage.jsx): `Frontend/src/pages/HomePage.jsx`
- [API client](https://github.com/abdellahmdi/khmis-sanad/blob/main/Frontend/src/api/axiosClient.js): `Frontend/src/api/axiosClient.js`

### Laravel API

- [API routes](https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/routes/api.php): `Backend/routes/api.php`
- [Authentication](https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/AuthController.php): `Backend/app/Http/Controllers/Api/AuthController.php`

### Marketplace operations

- [Product catalog](https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/ProductController.php): `Backend/app/Http/Controllers/Api/ProductController.php`
- [Categories](https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/CategoryController.php): `Backend/app/Http/Controllers/Api/CategoryController.php`
- [Cart management](https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/CartController.php): `Backend/app/Http/Controllers/Api/CartController.php`
- [Buyer orders](https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/OrderController.php): `Backend/app/Http/Controllers/Api/OrderController.php`
- [Storefronts](https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/ShopController.php): `Backend/app/Http/Controllers/Api/ShopController.php`
- [Seller inventory](https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/ShopProductController.php): `Backend/app/Http/Controllers/Api/ShopProductController.php`
- [Seller orders](https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/ShopOrderController.php): `Backend/app/Http/Controllers/Api/ShopOrderController.php`
- [Reviews](https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/app/Http/Controllers/Api/ReviewController.php): `Backend/app/Http/Controllers/Api/ReviewController.php`

### Persistent data

- [Domain models](https://github.com/abdellahmdi/khmis-sanad/tree/main/Backend/app/Models): `Backend/app/Models`
- [Application database](https://github.com/abdellahmdi/khmis-sanad/blob/main/Backend/config/database.php): `Backend/config/database.php`

### Other components

- **Buyer**
- **Artisan**
- **WhatsApp**

## Connections

- Buyer → React SPA: uses
- Artisan → React SPA: uses
- React SPA → Marketplace UI: renders
- Marketplace UI → API client: requests API
- API client → API routes: sends requests
- API routes → Authentication: dispatches
- API routes → Product catalog: dispatches
- API routes → Categories: dispatches
- API routes → Cart management: dispatches
- API routes → Buyer orders: dispatches
- API routes → Storefronts: dispatches
- API routes → Seller inventory: dispatches
- API routes → Seller orders: dispatches
- API routes → Reviews: dispatches
- React SPA → WhatsApp: opens order chat
- Authentication → Domain models: reads/writes
- Product catalog → Domain models: reads
- Categories → Domain models: reads
- Cart management → Domain models: reads/writes
- Buyer orders → Domain models: reads/writes
- Storefronts → Domain models: reads/writes
- Seller inventory → Domain models: reads/writes
- Seller orders → Domain models: reads/writes
- Reviews → Domain models: reads/writes
- Domain models → Application database: persists
