# shiponislam818-cmyk/smart_dokan architecture

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

- Interactive diagram: https://gitdiagram.com/shiponislam818-cmyk/smart_dokan
- Repository: https://github.com/shiponislam818-cmyk/smart_dokan

## Overview

Dokan is a shop-management frontend whose documented workflow covers sign-in, sales and purchases that update stock, and customer credit and payments that update balances. The React store loads and mutates API data; adapters translate API records for the UI. The README also documents dashboard, inventory, reporting, alerts and settings capabilities, but their route implementations are not present in the supplied tree, so those branches are shown at the available `src` directory level. Edges reflect sampled calls or README statements; unsampled route wiring is omitted.

Main entry points: [`src/context/AuthContext.jsx`](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/context/AuthContext.jsx) (Authentication state), [`src/context/StoreContext.jsx`](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/context/StoreContext.jsx) (Shop data store), [`src/components/layout/Sidebar.jsx`](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/components/layout/Sidebar.jsx) (Navigation), [`src/components/layout/Topbar.jsx`](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/components/layout/Topbar.jsx) (Top bar)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_shell["App shell<br/>[AppLayout.jsx]"]
  node_sidebar["Navigation<br/>[Sidebar.jsx]"]
  node_topbar["Top bar<br/>[Topbar.jsx]"]
  node_login["Sign in"]
  node_invoice["Invoice modal<br/>[InvoiceModal.jsx]"]
  node_modal["Modal UI<br/>[Modal.jsx]"]
end

subgraph group_commerce["Shop workflows"]
  node_dashboard["Dashboard"]
  node_inventory["Inventory"]
  node_sales["Sales and invoices"]
  node_purchases["Purchases"]
  node_credit["Customer credit"]
  node_alerts["Notifications"]
  node_settings["Shop settings"]
end

subgraph group_foundation["Data and services"]
  node_auth["Authentication state<br/>[AuthContext.jsx]"]
  node_store["Shop data store<br/>[StoreContext.jsx]"]
  node_adapters["API adapters<br/>[adapters.js]"]
  node_api["API client<br/>[api.js]"]
  node_toasts["Toast feedback<br/>[ToastContext.jsx]"]
end

node_operator(("Shop operator"))
node_backend["Dokan API"]

node_operator -->|"signs in"| node_login
node_login -.->|"authenticates"| node_auth
node_auth -->|"requests auth"| node_api
node_auth -->|"maps user"| node_adapters
node_auth -->|"reports session end"| node_toasts
node_shell -->|"renders"| node_sidebar
node_shell -->|"renders"| node_topbar
node_sidebar -->|"reads session"| node_auth
node_sidebar -->|"reads shop state"| node_store
node_topbar -->|"reads session"| node_auth
node_topbar -->|"searches shop data"| node_store
node_store -->|"loads and mutates"| node_api
node_store -->|"maps records"| node_adapters
node_api -->|"sends requests"| node_backend
node_operator -->|"views metrics"| node_dashboard
node_operator -->|"manages stock"| node_inventory
node_operator -->|"records sales"| node_sales
node_operator -->|"records purchases"| node_purchases
node_operator -->|"settles dues"| node_credit
node_operator -->|"reviews alerts"| node_alerts
node_operator -->|"configures shop"| node_settings
node_operator -->|"prints invoice"| node_invoice
node_invoice -->|"uses"| node_modal
node_invoice -->|"reads settings"| node_store

click node_shell "https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/components/layout/AppLayout.jsx"
click node_sidebar "https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/components/layout/Sidebar.jsx"
click node_topbar "https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/components/layout/Topbar.jsx"
click node_login "https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src"
click node_dashboard "https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src"
click node_inventory "https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src"
click node_sales "https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src"
click node_purchases "https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src"
click node_credit "https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src"
click node_alerts "https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src"
click node_settings "https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src"
click node_auth "https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/context/AuthContext.jsx"
click node_store "https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/context/StoreContext.jsx"
click node_adapters "https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/lib/adapters.js"
click node_api "https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/lib/api.js"
click node_toasts "https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/context/ToastContext.jsx"
click node_invoice "https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/components/ui/InvoiceModal.jsx"
click node_modal "https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/components/ui/Modal.jsx"

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_shell,node_sidebar,node_topbar,node_login,node_invoice,node_modal toneBlue
class node_dashboard,node_inventory,node_sales,node_purchases,node_credit,node_alerts,node_settings toneAmber
class node_auth,node_store,node_adapters,node_api,node_toasts,node_backend toneMint
class node_operator toneIndigo
```

## Components

### App experience

- [App shell](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/components/layout/AppLayout.jsx): `src/components/layout/AppLayout.jsx`
- [Navigation](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/components/layout/Sidebar.jsx): `src/components/layout/Sidebar.jsx`
- [Top bar](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/components/layout/Topbar.jsx): `src/components/layout/Topbar.jsx`
- [Sign in](https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src): `src`
- [Invoice modal](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/components/ui/InvoiceModal.jsx): `src/components/ui/InvoiceModal.jsx`
- [Modal UI](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/components/ui/Modal.jsx): `src/components/ui/Modal.jsx`

### Shop workflows

- [Dashboard](https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src): `src`
- [Inventory](https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src): `src`
- [Sales and invoices](https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src): `src`
- [Purchases](https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src): `src`
- [Customer credit](https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src): `src`
- [Notifications](https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src): `src`
- [Shop settings](https://github.com/shiponislam818-cmyk/smart_dokan/tree/main/src): `src`

### Data and services

- [Authentication state](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Shop data store](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/context/StoreContext.jsx): `src/context/StoreContext.jsx`
- [API adapters](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/lib/adapters.js): `src/lib/adapters.js`
- [API client](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/lib/api.js): `src/lib/api.js`
- [Toast feedback](https://github.com/shiponislam818-cmyk/smart_dokan/blob/main/src/context/ToastContext.jsx): `src/context/ToastContext.jsx`

### Other components

- **Shop operator**
- **Dokan API**

## Connections

- Shop operator → Sign in: signs in (evidence: `README.md`)
- Sign in → Authentication state: authenticates (evidence: `src/context/StoreContext.jsx`)
- Authentication state → API client: requests auth (evidence: `src/context/AuthContext.jsx`)
- Authentication state → API adapters: maps user (evidence: `src/context/AuthContext.jsx`)
- Authentication state → Toast feedback: reports session end (evidence: `src/context/AuthContext.jsx`)
- App shell → Navigation: renders (evidence: `src/components/layout/AppLayout.jsx`)
- App shell → Top bar: renders (evidence: `src/components/layout/AppLayout.jsx`)
- Navigation → Authentication state: reads session (evidence: `src/components/layout/Sidebar.jsx`)
- Navigation → Shop data store: reads shop state (evidence: `src/components/layout/Sidebar.jsx`)
- Top bar → Authentication state: reads session (evidence: `src/components/layout/Topbar.jsx`)
- Top bar → Shop data store: searches shop data (evidence: `src/components/layout/Topbar.jsx`)
- Shop data store → API client: loads and mutates (evidence: `src/context/StoreContext.jsx`)
- Shop data store → API adapters: maps records (evidence: `src/context/StoreContext.jsx`)
- API client → Dokan API: sends requests (evidence: `README.md`)
- Shop operator → Dashboard: views metrics (evidence: `README.md`)
- Shop operator → Inventory: manages stock (evidence: `README.md`)
- Shop operator → Sales and invoices: records sales (evidence: `README.md`)
- Shop operator → Purchases: records purchases (evidence: `README.md`)
- Shop operator → Customer credit: settles dues (evidence: `README.md`)
- Shop operator → Notifications: reviews alerts (evidence: `README.md`)
- Shop operator → Shop settings: configures shop (evidence: `README.md`)
- Shop operator → Invoice modal: prints invoice (evidence: `src/components/ui/InvoiceModal.jsx`)
- Invoice modal → Modal UI: uses (evidence: `src/components/ui/InvoiceModal.jsx`)
- Invoice modal → Shop data store: reads settings (evidence: `src/components/ui/InvoiceModal.jsx`)
