# mtahafarrukh/daraz-multi-store-app architecture

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

- Interactive diagram: https://gitdiagram.com/mtahafarrukh/daraz-multi-store-app
- Repository: https://github.com/mtahafarrukh/daraz-multi-store-app

## Overview

Daraz Multi-Store Manager is a workspace-based dashboard and API for connecting Daraz seller stores and managing their commerce operations. Users authenticate, connect stores, then work with orders and shipping labels, products and inventory, and store performance, analytics, and finance. The React application calls the FastAPI service; backend domain modules and the repository support these operations. The excerpts show frontend auth/API behavior and selected finance, print, and product endpoints; other capability links reflect README and module names, so uncertain internal wiring is omitted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/App.tsx) (React dashboard), [`src/app.py`](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/app.py) (API and OAuth), [`frontend/src/lib/api/client.ts`](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/lib/api/client.ts) (API client), [`src/finance_sync.py`](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/finance_sync.py) (Finance sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_webapp["React dashboard<br/>[App.tsx]"]
  node_apiclient["API client<br/>[client.ts]"]
  node_login["Sign in<br/>[AuthPages.tsx]"]
end

subgraph group_workspace["Workspace access"]
  node_authui["Auth state<br/>[useAuth.tsx]"]
  node_storesui["Store connections<br/>[StoresPage.tsx]"]
end

subgraph group_commerce["Commerce operations"]
  node_ordersui["Orders and shipping<br/>[OrdersPage.tsx]"]
  node_productsui["Products<br/>[ProductsPage.tsx]"]
  node_inventoryui["Inventory<br/>[InventoryPage.tsx]"]
  node_shippingui["Shipping<br/>[ShippingPage.tsx]"]
end

subgraph group_insights["Business insights"]
  node_performanceui["Performance"]
  node_analyticsui["Analytics<br/>[AnalyticsPage.tsx]"]
  node_financeui["Finance<br/>[FinancePage.tsx]"]
end

subgraph group_backend["Backend services"]
  node_fastapi["API and OAuth<br/>[app.py]"]
  node_connections["Store connections"]
  node_orders["Order processing<br/>[orders.py]"]
  node_labels["Label processing<br/>[label_processor.py]"]
  node_products["Product workflows<br/>[product_add.py]"]
  node_inventory["Inventory service<br/>[inventory.py]"]
  node_performance["Performance sync"]
  node_analytics["Analytics service"]
  node_finance["Finance sync<br/>[finance_sync.py]"]
  node_repo[("Workspace data<br/>[repo.py]")]
end

node_seller(("Store manager"))
node_daraz{{"Daraz platform"}}
node_supabase{{"Supabase auth"}}

node_seller -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_login
node_webapp -->|"routes to"| node_storesui
node_webapp -->|"routes to"| node_ordersui
node_webapp -->|"routes to"| node_productsui
node_webapp -->|"routes to"| node_inventoryui
node_webapp -->|"routes to"| node_shippingui
node_webapp -->|"routes to"| node_performanceui
node_webapp -->|"routes to"| node_analyticsui
node_webapp -->|"routes to"| node_financeui
node_authui -->|"gets session"| node_supabase
node_authui -->|"loads workspace"| node_apiclient
node_login -->|"signs in"| node_authui
node_storesui -->|"requests data"| node_apiclient
node_ordersui -->|"requests data"| node_apiclient
node_productsui -->|"requests data"| node_apiclient
node_inventoryui -->|"requests data"| node_apiclient
node_shippingui -->|"requests data"| node_apiclient
node_performanceui -->|"requests data"| node_apiclient
node_analyticsui -->|"requests data"| node_apiclient
node_financeui -->|"requests data"| node_apiclient
node_apiclient -->|"HTTP requests"| node_fastapi
node_fastapi -->|"handles connections"| node_connections
node_fastapi -->|"handles orders"| node_orders
node_fastapi -->|"starts label jobs"| node_labels
node_fastapi -->|"handles products"| node_products
node_fastapi -->|"handles inventory"| node_inventory
node_fastapi -->|"serves performance"| node_performance
node_fastapi -->|"serves analytics"| node_analytics
node_fastapi -->|"calls finance summary"| node_finance
node_fastapi -->|"reads and writes"| node_repo
node_connections -->|"OAuth connection"| node_daraz
node_orders -->|"orders and labels"| node_daraz
node_products -->|"product operations"| node_daraz
node_inventory -->|"inventory operations"| node_daraz
node_performance -->|"syncs metrics"| node_daraz
node_finance -->|"syncs finance"| node_daraz
node_finance -->|"reads transactions"| node_repo

click node_webapp "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/hooks/useAuth.tsx"
click node_apiclient "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/lib/api/client.ts"
click node_login "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/AuthPages.tsx"
click node_storesui "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/StoresPage.tsx"
click node_ordersui "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/OrdersPage.tsx"
click node_productsui "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/ProductsPage.tsx"
click node_inventoryui "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/InventoryPage.tsx"
click node_shippingui "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/ShippingPage.tsx"
click node_performanceui "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/PerformancePage.tsx"
click node_analyticsui "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/AnalyticsPage.tsx"
click node_financeui "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/FinancePage.tsx"
click node_fastapi "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/app.py"
click node_connections "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/workspace_connections.py"
click node_orders "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/orders.py"
click node_labels "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/label_processor.py"
click node_products "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/product_add.py"
click node_inventory "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/inventory.py"
click node_performance "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/performance_sync.py"
click node_analytics "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/analytics_service.py"
click node_finance "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/finance_sync.py"
click node_repo "https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/db/repo.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_webapp,node_apiclient,node_login toneBlue
class node_authui,node_storesui toneAmber
class node_ordersui,node_productsui,node_inventoryui,node_shippingui toneMint
class node_performanceui,node_analyticsui,node_financeui toneRose
class node_fastapi,node_connections,node_orders,node_labels,node_products,node_inventory,node_performance,node_analytics,node_finance,node_repo,node_seller,node_daraz,node_supabase toneIndigo
```

## Components

### Web application

- [React dashboard](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/lib/api/client.ts): `frontend/src/lib/api/client.ts`
- [Sign in](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/AuthPages.tsx): `frontend/src/pages/AuthPages.tsx`

### Workspace access

- [Auth state](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/hooks/useAuth.tsx): `frontend/src/hooks/useAuth.tsx`
- [Store connections](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/StoresPage.tsx): `frontend/src/pages/StoresPage.tsx`

### Commerce operations

- [Orders and shipping](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/OrdersPage.tsx): `frontend/src/pages/OrdersPage.tsx`
- [Products](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/ProductsPage.tsx): `frontend/src/pages/ProductsPage.tsx`
- [Inventory](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/InventoryPage.tsx): `frontend/src/pages/InventoryPage.tsx`
- [Shipping](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/ShippingPage.tsx): `frontend/src/pages/ShippingPage.tsx`

### Business insights

- [Performance](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/PerformancePage.tsx): `frontend/src/pages/PerformancePage.tsx`
- [Analytics](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/AnalyticsPage.tsx): `frontend/src/pages/AnalyticsPage.tsx`
- [Finance](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/frontend/src/pages/FinancePage.tsx): `frontend/src/pages/FinancePage.tsx`

### Backend services

- [API and OAuth](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/app.py): `src/app.py`
- [Store connections](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/workspace_connections.py): `src/workspace_connections.py`
- [Order processing](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/orders.py): `src/orders.py`
- [Label processing](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/label_processor.py): `src/label_processor.py`
- [Product workflows](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/product_add.py): `src/product_add.py`
- [Inventory service](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/inventory.py): `src/inventory.py`
- [Performance sync](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/performance_sync.py): `src/performance_sync.py`
- [Analytics service](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/analytics_service.py): `src/analytics_service.py`
- [Finance sync](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/finance_sync.py): `src/finance_sync.py`
- [Workspace data](https://github.com/mtahafarrukh/daraz-multi-store-app/blob/main/src/db/repo.py): `src/db/repo.py`

### Other components

- **Store manager**
- **Daraz platform**
- **Supabase auth**

## Connections

- Store manager → React dashboard: uses
- React dashboard → Sign in: routes to
- React dashboard → Store connections: routes to
- React dashboard → Orders and shipping: routes to
- React dashboard → Products: routes to
- React dashboard → Inventory: routes to
- React dashboard → Shipping: routes to
- React dashboard → Performance: routes to
- React dashboard → Analytics: routes to
- React dashboard → Finance: routes to
- Auth state → Supabase auth: gets session
- Auth state → API client: loads workspace
- Sign in → Auth state: signs in
- Store connections → API client: requests data
- Orders and shipping → API client: requests data
- Products → API client: requests data
- Inventory → API client: requests data
- Shipping → API client: requests data
- Performance → API client: requests data
- Analytics → API client: requests data
- Finance → API client: requests data
- API client → API and OAuth: HTTP requests
- API and OAuth → Store connections: handles connections
- API and OAuth → Order processing: handles orders
- API and OAuth → Label processing: starts label jobs
- API and OAuth → Product workflows: handles products
- API and OAuth → Inventory service: handles inventory
- API and OAuth → Performance sync: serves performance
- API and OAuth → Analytics service: serves analytics
- API and OAuth → Finance sync: calls finance summary
- API and OAuth → Workspace data: reads and writes
- Store connections → Daraz platform: OAuth connection
- Order processing → Daraz platform: orders and labels
- Product workflows → Daraz platform: product operations
- Inventory service → Daraz platform: inventory operations
- Performance sync → Daraz platform: syncs metrics
- Finance sync → Daraz platform: syncs finance
- Finance sync → Workspace data: reads transactions
