# raouf-b-dev/ecommerce-admin-dashboard architecture

> Architecture diagram of the GitHub repository raouf-b-dev/ecommerce-admin-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raouf-b-dev/ecommerce-admin-dashboard
- Repository: https://github.com/raouf-b-dev/ecommerce-admin-dashboard

## Overview

This is a browser-based e-commerce operator console: operators sign in, pass session and permission gates, then view or manage dashboard metrics, catalog, inventory, orders, users, and roles through the store API. The README describes the API as the source of business rules and lists the major screens; the router excerpt and source index show selected route and component relationships. Several feature data-flow internals were not sampled, so those connections are not inferred.

Main entry points: [`src/components/layout/app-layout.tsx`](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/components/layout/app-layout.tsx) (Admin layout), [`src/lib/api/client.ts`](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/lib/api/client.ts) (HTTP client), [`src/main.tsx`](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/main.tsx) (React entry), [`src/app/router.tsx`](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/app/router.tsx) (Route map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_entry["React entry<br/>[main.tsx]"]
  node_routing["Route map<br/>[router.tsx]"]
  node_layout["Admin layout<br/>[app-layout.tsx]"]
  node_theme["Theme provider<br/>[theme-provider.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Session context<br/>[auth-context.tsx]"]
  node_access["Route guards"]
  node_login["Sign-in<br/>[login-page.tsx]"]
end

subgraph group_commerce["Commerce operations"]
  node_dashboard["Dashboard<br/>[dashboard-page.tsx]"]
  node_products["Products and categories<br/>[products-page.tsx]"]
  node_inventory["Inventory"]
  node_orders["Orders<br/>[orders-page.tsx]"]
end

subgraph group_people["People administration"]
  node_users["User administration"]
  node_roles["Roles and permissions"]
end

subgraph group_platform["API and realtime"]
  node_api_client["HTTP client<br/>[client.ts]"]
  node_api["Store API"]
  node_websocket["WebSocket service"]
  node_mock["Browser API mock<br/>[browser.ts]"]
end

node_operator(("Operator"))

node_operator -->|"opens console"| node_entry
node_entry -->|"mounts router"| node_routing
node_entry -->|"provides session"| node_auth
node_entry -->|"provides theme"| node_theme
node_entry -->|"mounts provider"| node_websocket
node_entry -.->|"starts optionally"| node_mock
node_routing -->|"routes to"| node_login
node_routing -->|"routes through"| node_layout
node_routing -->|"guards routes"| node_access
node_access -.->|"checks permissions"| node_auth
node_operator -->|"signs in"| node_auth
node_layout -.->|"hosts screen"| node_dashboard
node_layout -.->|"hosts screen"| node_products
node_layout -.->|"hosts screen"| node_inventory
node_layout -.->|"hosts screen"| node_orders
node_layout -.->|"hosts screen"| node_users
node_layout -.->|"hosts screen"| node_roles
node_dashboard -.->|"loads data"| node_api_client
node_products -.->|"reads and mutates"| node_api_client
node_inventory -.->|"reads and mutates"| node_api_client
node_orders -.->|"reads and mutates"| node_api_client
node_users -.->|"reads and mutates"| node_api_client
node_roles -.->|"reads and mutates"| node_api_client
node_api_client -->|"sends HTTP"| node_api

click node_entry "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/main.tsx"
click node_routing "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/app/router.tsx"
click node_layout "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/components/layout/app-layout.tsx"
click node_auth "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/lib/auth/auth-context.tsx"
click node_access "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/lib/auth/permission-route.tsx"
click node_login "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/auth/pages/login-page.tsx"
click node_dashboard "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/dashboard/pages/dashboard-page.tsx"
click node_products "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/products/pages/products-page.tsx"
click node_inventory "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/inventory/pages/inventory-detail-page.tsx"
click node_orders "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/orders/pages/orders-page.tsx"
click node_users "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/users/pages/user-detail-page.tsx"
click node_roles "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/roles/pages/roles-settings-page.tsx"
click node_api_client "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/lib/api/client.ts"
click node_websocket "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/lib/ws/websocket-service.ts"
click node_theme "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/components/theme/theme-provider.tsx"
click node_mock "https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/lib/mock/browser.ts"

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_entry,node_routing,node_layout,node_theme toneBlue
class node_auth,node_access,node_login toneAmber
class node_dashboard,node_products,node_inventory,node_orders toneMint
class node_users,node_roles toneRose
class node_api_client,node_api,node_websocket,node_mock,node_operator toneIndigo
```

## Components

### Application shell

- [React entry](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/main.tsx): `src/main.tsx`
- [Route map](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/app/router.tsx): `src/app/router.tsx`
- [Admin layout](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/components/layout/app-layout.tsx): `src/components/layout/app-layout.tsx`
- [Theme provider](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/components/theme/theme-provider.tsx): `src/components/theme/theme-provider.tsx`

### Identity and access

- [Session context](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/lib/auth/auth-context.tsx): `src/lib/auth/auth-context.tsx`
- [Route guards](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/lib/auth/permission-route.tsx): `src/lib/auth/permission-route.tsx`
- [Sign-in](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/auth/pages/login-page.tsx): `src/features/auth/pages/login-page.tsx`

### Commerce operations

- [Dashboard](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/dashboard/pages/dashboard-page.tsx): `src/features/dashboard/pages/dashboard-page.tsx`
- [Products and categories](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/products/pages/products-page.tsx): `src/features/products/pages/products-page.tsx`
- [Inventory](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/inventory/pages/inventory-detail-page.tsx): `src/features/inventory/pages/inventory-detail-page.tsx`
- [Orders](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/orders/pages/orders-page.tsx): `src/features/orders/pages/orders-page.tsx`

### People administration

- [User administration](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/users/pages/user-detail-page.tsx): `src/features/users/pages/user-detail-page.tsx`
- [Roles and permissions](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/features/roles/pages/roles-settings-page.tsx): `src/features/roles/pages/roles-settings-page.tsx`

### API and realtime

- [HTTP client](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/lib/api/client.ts): `src/lib/api/client.ts`
- **Store API**
- [WebSocket service](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/lib/ws/websocket-service.ts): `src/lib/ws/websocket-service.ts`
- [Browser API mock](https://github.com/raouf-b-dev/ecommerce-admin-dashboard/blob/master/src/lib/mock/browser.ts): `src/lib/mock/browser.ts`

### Other components

- **Operator**

## Connections

- Operator → React entry: opens console (evidence: `README.md`)
- React entry → Route map: mounts router (evidence: `src/main.tsx`)
- React entry → Session context: provides session (evidence: `src/main.tsx`)
- React entry → Theme provider: provides theme (evidence: `src/main.tsx`)
- React entry → WebSocket service: mounts provider (evidence: `src/main.tsx`)
- React entry → Browser API mock: starts optionally (evidence: `src/main.tsx`)
- Route map → Sign-in: routes to (evidence: `src/app/router.tsx`)
- Route map → Admin layout: routes through (evidence: `src/app/router.tsx`)
- Route map → Route guards: guards routes (evidence: `src/app/router.tsx`)
- Route guards → Session context: checks permissions
- Operator → Session context: signs in (evidence: `README.md`)
- Admin layout → Dashboard: hosts screen
- Admin layout → Products and categories: hosts screen
- Admin layout → Inventory: hosts screen
- Admin layout → Orders: hosts screen
- Admin layout → User administration: hosts screen
- Admin layout → Roles and permissions: hosts screen
- Dashboard → HTTP client: loads data
- Products and categories → HTTP client: reads and mutates
- Inventory → HTTP client: reads and mutates
- Orders → HTTP client: reads and mutates
- User administration → HTTP client: reads and mutates
- Roles and permissions → HTTP client: reads and mutates
- HTTP client → Store API: sends HTTP (evidence: `README.md`)
