# abdulbosidcoder/sanad architecture

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

- Interactive diagram: https://gitdiagram.com/abdulbosidcoder/sanad
- Repository: https://github.com/abdulbosidcoder/sanad

## Overview

Sanad is a multilingual, multi-vendor marketplace with buyer, seller, administration, and support capabilities. The visible buyer and seller pages are currently lightweight landing/dashboard shells; the documented backend is a FastAPI modular monolith exposing the domain modules. The admin system map fetches health and module metadata. Module-level business interactions and most domain implementations were not sampled, so domain nodes are preserved from the source tree but their internal call relationships are omitted.

Main entry points: [`backend/app/modules/__init__.py`](https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/modules/__init__.py) (Module registry), [`backend/app/main.py`](https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/main.py) (FastAPI application), [`frontend/apps/admin/app/page.tsx`](https://github.com/abdulbosidcoder/sanad/blob/main/frontend/apps/admin/app/page.tsx) (Admin console), [`backend/app/system.py`](https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/system.py) (System status API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experiences["Marketplace experiences"]
  node_web_app["Buyer storefront<br/>[page.tsx]"]
  node_seller_app["Seller dashboard<br/>[page.tsx]"]
  node_admin_app["Admin console<br/>[page.tsx]"]
  node_system_overview["System overview"]
end

subgraph group_backend["API and runtime"]
  node_backend_app["FastAPI application<br/>[main.py]"]
  node_module_registry["Module registry<br/>[__init__.py]"]
  node_system_api["System status API<br/>[system.py]"]
  node_request_context["Request context<br/>[context.py]"]
  node_logging["Structured logging<br/>[logging.py]"]
  node_middleware["Request middleware<br/>[middleware.py]"]
  node_errors["Error handling<br/>[errors.py]"]
  node_database[("SQL database<br/>[db.py]")]
  node_redis[("Redis<br/>[redis.py]")]
end

subgraph group_commerce["Commerce domains"]
  node_stores["Stores"]
  node_media["Media"]
  node_catalog["Catalog"]
  node_inventory["Inventory"]
  node_search["Search"]
  node_cart["Cart"]
  node_payments["Payments"]
  node_orders["Orders"]
  node_reviews["Reviews"]
  node_engagement["Engagement"]
  node_recommendations["Recommendations"]
end

subgraph group_operations["Platform capabilities"]
  node_identity["Identity"]
  node_analytics["Analytics"]
  node_support["Support"]
end

subgraph group_shared["Shared frontend packages"]
  node_api_client["API client<br/>[index.ts]"]
  node_i18n_package["Localization<br/>[index.ts]"]
  node_ui_package["UI and theme<br/>[Button.tsx]"]
  node_design_tokens["Design tokens<br/>[tokens.ts]"]
end

node_buyer(("Buyer"))
node_seller_user(("Seller"))
node_operator(("Administrator"))

node_buyer -->|"browses"| node_web_app
node_seller_user -->|"manages store"| node_seller_app
node_operator -->|"administers"| node_admin_app
node_admin_app -->|"renders"| node_system_overview
node_admin_app -->|"translates UI"| node_i18n_package
node_web_app -->|"translates UI"| node_i18n_package
node_seller_app -->|"translates UI"| node_i18n_package
node_system_overview -->|"fetches health and modules"| node_api_client
node_system_overview -->|"requests system map"| node_backend_app
node_web_app -->|"renders components"| node_ui_package
node_seller_app -->|"renders components"| node_ui_package
node_admin_app -->|"renders components"| node_ui_package
node_ui_package -->|"uses tokens"| node_design_tokens
node_backend_app -->|"mounts module routers"| node_module_registry
node_backend_app -->|"mounts system router"| node_system_api
node_module_registry -->|"registers"| node_identity
node_module_registry -->|"registers"| node_stores
node_module_registry -->|"registers"| node_media
node_module_registry -->|"registers"| node_catalog
node_module_registry -->|"registers"| node_inventory
node_module_registry -->|"registers"| node_search
node_module_registry -->|"registers"| node_cart
node_module_registry -->|"registers"| node_payments
node_module_registry -->|"registers"| node_orders
node_module_registry -->|"registers"| node_reviews
node_module_registry -->|"registers"| node_engagement
node_module_registry -->|"registers"| node_recommendations
node_module_registry -->|"registers"| node_analytics
node_module_registry -->|"registers"| node_support
node_system_api -->|"checks"| node_database
node_system_api -->|"checks"| node_redis
node_system_api -->|"reports modules"| node_module_registry
node_backend_app -->|"installs"| node_middleware
node_backend_app -->|"registers handlers"| node_errors
node_middleware -->|"sets request context"| node_request_context
node_middleware -->|"logs requests"| node_logging
node_middleware -->|"uses error handling"| node_errors
node_logging -->|"reads context"| node_request_context

click node_web_app "https://github.com/abdulbosidcoder/sanad/blob/main/frontend/apps/web/app/page.tsx"
click node_seller_app "https://github.com/abdulbosidcoder/sanad/blob/main/frontend/apps/seller/app/page.tsx"
click node_admin_app "https://github.com/abdulbosidcoder/sanad/blob/main/frontend/apps/admin/app/page.tsx"
click node_system_overview "https://github.com/abdulbosidcoder/sanad/blob/main/frontend/apps/admin/app/system-overview.tsx"
click node_api_client "https://github.com/abdulbosidcoder/sanad/blob/main/frontend/packages/api-client/src/index.ts"
click node_i18n_package "https://github.com/abdulbosidcoder/sanad/blob/main/frontend/packages/i18n/src/index.ts"
click node_ui_package "https://github.com/abdulbosidcoder/sanad/blob/main/frontend/packages/ui/src/components/Button.tsx"
click node_design_tokens "https://github.com/abdulbosidcoder/sanad/blob/main/frontend/packages/ui/src/tokens.ts"
click node_backend_app "https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/main.py"
click node_module_registry "https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/modules/__init__.py"
click node_system_api "https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/system.py"
click node_request_context "https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/core/context.py"
click node_logging "https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/core/logging.py"
click node_middleware "https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/core/middleware.py"
click node_errors "https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/core/errors.py"
click node_database "https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/core/db.py"
click node_redis "https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/core/redis.py"
click node_identity "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/identity"
click node_stores "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/stores"
click node_media "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/media"
click node_catalog "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/catalog"
click node_inventory "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/inventory"
click node_search "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/search"
click node_cart "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/cart"
click node_payments "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/payments"
click node_orders "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/orders"
click node_reviews "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/reviews"
click node_engagement "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/engagement"
click node_recommendations "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/recommendations"
click node_analytics "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/analytics"
click node_support "https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/support"

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_app,node_seller_app,node_admin_app,node_system_overview toneBlue
class node_backend_app,node_module_registry,node_system_api,node_request_context,node_logging,node_middleware,node_errors,node_database,node_redis toneAmber
class node_stores,node_media,node_catalog,node_inventory,node_search,node_cart,node_payments,node_orders,node_reviews,node_engagement,node_recommendations toneMint
class node_identity,node_analytics,node_support toneRose
class node_api_client,node_i18n_package,node_ui_package,node_design_tokens,node_buyer,node_seller_user,node_operator toneIndigo
```

## Components

### Marketplace experiences

- [Buyer storefront](https://github.com/abdulbosidcoder/sanad/blob/main/frontend/apps/web/app/page.tsx): `frontend/apps/web/app/page.tsx`
- [Seller dashboard](https://github.com/abdulbosidcoder/sanad/blob/main/frontend/apps/seller/app/page.tsx): `frontend/apps/seller/app/page.tsx`
- [Admin console](https://github.com/abdulbosidcoder/sanad/blob/main/frontend/apps/admin/app/page.tsx): `frontend/apps/admin/app/page.tsx`
- [System overview](https://github.com/abdulbosidcoder/sanad/blob/main/frontend/apps/admin/app/system-overview.tsx): `frontend/apps/admin/app/system-overview.tsx`

### API and runtime

- [FastAPI application](https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/main.py): `backend/app/main.py`
- [Module registry](https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/modules/__init__.py): `backend/app/modules/__init__.py`
- [System status API](https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/system.py): `backend/app/system.py`
- [Request context](https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/core/context.py): `backend/app/core/context.py`
- [Structured logging](https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/core/logging.py): `backend/app/core/logging.py`
- [Request middleware](https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/core/middleware.py): `backend/app/core/middleware.py`
- [Error handling](https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/core/errors.py): `backend/app/core/errors.py`
- [SQL database](https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/core/db.py): `backend/app/core/db.py`
- [Redis](https://github.com/abdulbosidcoder/sanad/blob/main/backend/app/core/redis.py): `backend/app/core/redis.py`

### Commerce domains

- [Stores](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/stores): `backend/app/modules/stores`
- [Media](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/media): `backend/app/modules/media`
- [Catalog](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/catalog): `backend/app/modules/catalog`
- [Inventory](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/inventory): `backend/app/modules/inventory`
- [Search](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/search): `backend/app/modules/search`
- [Cart](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/cart): `backend/app/modules/cart`
- [Payments](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/payments): `backend/app/modules/payments`
- [Orders](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/orders): `backend/app/modules/orders`
- [Reviews](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/reviews): `backend/app/modules/reviews`
- [Engagement](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/engagement): `backend/app/modules/engagement`
- [Recommendations](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/recommendations): `backend/app/modules/recommendations`

### Platform capabilities

- [Identity](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/identity): `backend/app/modules/identity`
- [Analytics](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/analytics): `backend/app/modules/analytics`
- [Support](https://github.com/abdulbosidcoder/sanad/tree/main/backend/app/modules/support): `backend/app/modules/support`

### Shared frontend packages

- [API client](https://github.com/abdulbosidcoder/sanad/blob/main/frontend/packages/api-client/src/index.ts): `frontend/packages/api-client/src/index.ts`
- [Localization](https://github.com/abdulbosidcoder/sanad/blob/main/frontend/packages/i18n/src/index.ts): `frontend/packages/i18n/src/index.ts`
- [UI and theme](https://github.com/abdulbosidcoder/sanad/blob/main/frontend/packages/ui/src/components/Button.tsx): `frontend/packages/ui/src/components/Button.tsx`
- [Design tokens](https://github.com/abdulbosidcoder/sanad/blob/main/frontend/packages/ui/src/tokens.ts): `frontend/packages/ui/src/tokens.ts`

### Other components

- **Buyer**
- **Seller**
- **Administrator**

## Connections

- Buyer → Buyer storefront: browses (evidence: `README.md`)
- Seller → Seller dashboard: manages store (evidence: `README.md`)
- Administrator → Admin console: administers (evidence: `README.md`)
- Admin console → System overview: renders (evidence: `frontend/apps/admin/app/page.tsx`)
- Admin console → Localization: translates UI (evidence: `frontend/apps/admin/app/page.tsx`)
- Buyer storefront → Localization: translates UI (evidence: `frontend/apps/web/app/page.tsx`)
- Seller dashboard → Localization: translates UI (evidence: `frontend/apps/seller/app/page.tsx`)
- System overview → API client: fetches health and modules (evidence: `frontend/apps/admin/app/system-overview.tsx`)
- System overview → FastAPI application: requests system map (evidence: `README.md`)
- Buyer storefront → UI and theme: renders components (evidence: `frontend/apps/web/app/page.tsx`)
- Seller dashboard → UI and theme: renders components (evidence: `frontend/apps/seller/app/page.tsx`)
- Admin console → UI and theme: renders components (evidence: `frontend/apps/admin/app/page.tsx`)
- UI and theme → Design tokens: uses tokens
- FastAPI application → Module registry: mounts module routers (evidence: `backend/app/main.py`)
- FastAPI application → System status API: mounts system router (evidence: `backend/app/main.py`)
- Module registry → Identity: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Stores: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Media: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Catalog: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Inventory: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Search: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Cart: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Payments: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Orders: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Reviews: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Engagement: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Recommendations: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Analytics: registers (evidence: `backend/app/modules/__init__.py`)
- Module registry → Support: registers (evidence: `backend/app/modules/__init__.py`)
- System status API → SQL database: checks (evidence: `backend/app/system.py`)
- System status API → Redis: checks (evidence: `backend/app/system.py`)
- System status API → Module registry: reports modules (evidence: `backend/app/system.py`)
- FastAPI application → Request middleware: installs (evidence: `backend/app/main.py`)
- FastAPI application → Error handling: registers handlers (evidence: `backend/app/main.py`)
- Request middleware → Request context: sets request context (evidence: `backend/app/core/middleware.py`)
- Request middleware → Structured logging: logs requests (evidence: `backend/app/core/middleware.py`)
- Request middleware → Error handling: uses error handling (evidence: `backend/app/core/middleware.py`)
- Structured logging → Request context: reads context (evidence: `backend/app/core/logging.py`)
