# sabzidev/visionui-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/sabzidev/visionui-dashboard
- Repository: https://github.com/sabzidev/visionui-dashboard

## Overview

VISION UI is a React dashboard for signing in and viewing dashboard, profile, and table pages. The user enters through the app shell and router; private routes check authentication, and page components render domain-specific sections backed by query hooks and API modules. The README also documents bilingual UI, charting, skeleton states, responsive layout, and PWA/offline support. Edges follow shown imports and calls; some feature internals and service-worker behavior are unsampled, so those relationships are omitted where not evidenced.

Main entry points: [`src/routes.jsx`](https://github.com/sabzidev/visionui-dashboard/blob/main/src/routes.jsx) (Route map), [`src/main.jsx`](https://github.com/sabzidev/visionui-dashboard/blob/main/src/main.jsx) (React entry), [`src/contexts/Auth/Auth.jsx`](https://github.com/sabzidev/visionui-dashboard/blob/main/src/contexts/Auth/Auth.jsx) (Auth context), [`src/services/features/admin/hooks/useAdmin/useAdmin.js`](https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/admin/hooks/useAdmin/useAdmin.js) (Admin queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_entry["React entry<br/>[main.jsx]"]
  node_providers["App providers<br/>[AppProviders.jsx]"]
  node_app["Router host<br/>[App.jsx]"]
end

subgraph group_access["Access and routing"]
  node_routes["Route map<br/>[routes.jsx]"]
  node_guard["Private route<br/>[PrivateRoute.jsx]"]
  node_auth["Auth context<br/>[Auth.jsx]"]
  node_cookie["Cookie state<br/>[useCookie.js]"]
  node_signin["Sign-in page<br/>[page.jsx]"]
  node_form["Sign-in form logic<br/>[useAuthForm.js]"]
end

subgraph group_product["Dashboard pages"]
  node_dashboard["Dashboard page<br/>[page.jsx]"]
  node_dashsections["Dashboard sections"]
  node_profile["Profile page<br/>[page.jsx]"]
  node_profiles["Profile sections"]
  node_tables["Tables page<br/>[page.jsx]"]
  node_authors["Authors table<br/>[section.jsx]"]
  node_projects["Projects table<br/>[section.jsx]"]
end

subgraph group_data["Data and services"]
  node_query["Query client<br/>[queryClient.js]"]
  node_admin["Admin queries<br/>[useAdmin.js]"]
  node_adminapi["Admin API<br/>[admin.api.js]"]
  node_authorhook["Authors query<br/>[useAuthors.js]"]
  node_authorapi["Authors API<br/>[authors.api.js]"]
  node_projecthook["Projects query<br/>[useProjects.js]"]
  node_projectapi["Projects API<br/>[projects.api.js]"]
  node_stats["Stats query<br/>[useStats.js]"]
  node_statsapi["Stats API<br/>[stats.api.js]"]
end

subgraph group_experience["Shared experience"]
  node_i18n["Localization setup<br/>[index.js]"]
  node_english["English messages<br/>[en.js]"]
  node_persian["Persian messages<br/>[fa.js]"]
  node_seo["Route metadata<br/>[Head.jsx]"]
  node_sw["Service worker<br/>[sw.js]"]
end

node_user(("Dashboard user"))

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_entry -->|"wraps with"| node_providers
node_entry -->|"wraps with"| node_auth
node_entry -->|"registers"| node_sw
node_app -->|"hosts router"| node_routes
node_routes -->|"routes through"| node_guard
node_routes -->|"routes to"| node_signin
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_profile
node_routes -->|"routes to"| node_tables
node_routes -->|"prefetches"| node_admin
node_routes -->|"uses"| node_query
node_guard -->|"checks identity"| node_auth
node_guard -->|"checks admin"| node_admin
node_auth -->|"persists identity"| node_cookie
node_signin -->|"renders"| node_form
node_signin -->|"reads session"| node_auth
node_signin -->|"loads admin"| node_admin
node_form -->|"sets identity"| node_auth
node_form -->|"loads admin"| node_admin
node_dashboard -->|"renders sections"| node_dashsections
node_profile -->|"renders sections"| node_profiles
node_tables -->|"renders"| node_authors
node_tables -->|"renders"| node_projects
node_admin -->|"calls"| node_adminapi
node_authorhook -->|"calls"| node_authorapi
node_projecthook -->|"calls"| node_projectapi
node_stats -->|"calls"| node_statsapi
node_query -->|"translates notices"| node_i18n
node_i18n -->|"loads messages"| node_english
node_i18n -->|"loads messages"| node_persian
node_routes -->|"provides route data"| node_seo

click node_entry "https://github.com/sabzidev/visionui-dashboard/blob/main/src/main.jsx"
click node_providers "https://github.com/sabzidev/visionui-dashboard/blob/main/src/AppProviders.jsx"
click node_app "https://github.com/sabzidev/visionui-dashboard/blob/main/src/App.jsx"
click node_routes "https://github.com/sabzidev/visionui-dashboard/blob/main/src/routes.jsx"
click node_guard "https://github.com/sabzidev/visionui-dashboard/blob/main/src/layouts/PrivateRoute.jsx"
click node_auth "https://github.com/sabzidev/visionui-dashboard/blob/main/src/contexts/Auth/Auth.jsx"
click node_cookie "https://github.com/sabzidev/visionui-dashboard/blob/main/src/hooks/useCookie.js"
click node_signin "https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/auth/Signin/page.jsx"
click node_form "https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/auth/Signin/hooks/useAuthForm/useAuthForm.js"
click node_dashboard "https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/private/Dashboard/page.jsx"
click node_dashsections "https://github.com/sabzidev/visionui-dashboard/tree/main/src/pages/private/Dashboard/sections"
click node_profile "https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/private/Profile/page.jsx"
click node_profiles "https://github.com/sabzidev/visionui-dashboard/tree/main/src/pages/private/Profile/sections"
click node_tables "https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/private/Tables/page.jsx"
click node_authors "https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/private/Tables/sections/AuthorsTableSection/section.jsx"
click node_projects "https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/private/sections/ProjectsTableSection/section.jsx"
click node_query "https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/queryClient.js"
click node_admin "https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/admin/hooks/useAdmin/useAdmin.js"
click node_adminapi "https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/admin/admin.api.js"
click node_authorhook "https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/authors/hooks/useAuthors/useAuthors.js"
click node_authorapi "https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/authors/authors.api.js"
click node_projecthook "https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/projects/hooks/useProjects/useProjects.js"
click node_projectapi "https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/projects/projects.api.js"
click node_stats "https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/stats/hooks/useStats/useStats.js"
click node_statsapi "https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/stats/stats.api.js"
click node_i18n "https://github.com/sabzidev/visionui-dashboard/blob/main/src/i18n/index.js"
click node_english "https://github.com/sabzidev/visionui-dashboard/blob/main/src/i18n/en.js"
click node_persian "https://github.com/sabzidev/visionui-dashboard/blob/main/src/i18n/fa.js"
click node_seo "https://github.com/sabzidev/visionui-dashboard/blob/main/src/layouts/components/Head.jsx"
click node_sw "https://github.com/sabzidev/visionui-dashboard/blob/main/public/sw.js"

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_providers,node_app,node_user toneBlue
class node_routes,node_guard,node_auth,node_cookie,node_signin,node_form toneAmber
class node_dashboard,node_dashsections,node_profile,node_profiles,node_tables,node_authors,node_projects toneMint
class node_query,node_admin,node_adminapi,node_authorhook,node_authorapi,node_projecthook,node_projectapi,node_stats,node_statsapi toneRose
class node_i18n,node_english,node_persian,node_seo,node_sw toneIndigo
```

## Components

### App shell

- [React entry](https://github.com/sabzidev/visionui-dashboard/blob/main/src/main.jsx): `src/main.jsx`
- [App providers](https://github.com/sabzidev/visionui-dashboard/blob/main/src/AppProviders.jsx): `src/AppProviders.jsx`
- [Router host](https://github.com/sabzidev/visionui-dashboard/blob/main/src/App.jsx): `src/App.jsx`

### Access and routing

- [Route map](https://github.com/sabzidev/visionui-dashboard/blob/main/src/routes.jsx): `src/routes.jsx`
- [Private route](https://github.com/sabzidev/visionui-dashboard/blob/main/src/layouts/PrivateRoute.jsx): `src/layouts/PrivateRoute.jsx`
- [Auth context](https://github.com/sabzidev/visionui-dashboard/blob/main/src/contexts/Auth/Auth.jsx): `src/contexts/Auth/Auth.jsx`
- [Cookie state](https://github.com/sabzidev/visionui-dashboard/blob/main/src/hooks/useCookie.js): `src/hooks/useCookie.js`
- [Sign-in page](https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/auth/Signin/page.jsx): `src/pages/auth/Signin/page.jsx`
- [Sign-in form logic](https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/auth/Signin/hooks/useAuthForm/useAuthForm.js): `src/pages/auth/Signin/hooks/useAuthForm/useAuthForm.js`

### Dashboard pages

- [Dashboard page](https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/private/Dashboard/page.jsx): `src/pages/private/Dashboard/page.jsx`
- [Dashboard sections](https://github.com/sabzidev/visionui-dashboard/tree/main/src/pages/private/Dashboard/sections): `src/pages/private/Dashboard/sections`
- [Profile page](https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/private/Profile/page.jsx): `src/pages/private/Profile/page.jsx`
- [Profile sections](https://github.com/sabzidev/visionui-dashboard/tree/main/src/pages/private/Profile/sections): `src/pages/private/Profile/sections`
- [Tables page](https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/private/Tables/page.jsx): `src/pages/private/Tables/page.jsx`
- [Authors table](https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/private/Tables/sections/AuthorsTableSection/section.jsx): `src/pages/private/Tables/sections/AuthorsTableSection/section.jsx`
- [Projects table](https://github.com/sabzidev/visionui-dashboard/blob/main/src/pages/private/sections/ProjectsTableSection/section.jsx): `src/pages/private/sections/ProjectsTableSection/section.jsx`

### Data and services

- [Query client](https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/queryClient.js): `src/services/queryClient.js`
- [Admin queries](https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/admin/hooks/useAdmin/useAdmin.js): `src/services/features/admin/hooks/useAdmin/useAdmin.js`
- [Admin API](https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/admin/admin.api.js): `src/services/features/admin/admin.api.js`
- [Authors query](https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/authors/hooks/useAuthors/useAuthors.js): `src/services/features/authors/hooks/useAuthors/useAuthors.js`
- [Authors API](https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/authors/authors.api.js): `src/services/features/authors/authors.api.js`
- [Projects query](https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/projects/hooks/useProjects/useProjects.js): `src/services/features/projects/hooks/useProjects/useProjects.js`
- [Projects API](https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/projects/projects.api.js): `src/services/features/projects/projects.api.js`
- [Stats query](https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/stats/hooks/useStats/useStats.js): `src/services/features/stats/hooks/useStats/useStats.js`
- [Stats API](https://github.com/sabzidev/visionui-dashboard/blob/main/src/services/features/stats/stats.api.js): `src/services/features/stats/stats.api.js`

### Shared experience

- [Localization setup](https://github.com/sabzidev/visionui-dashboard/blob/main/src/i18n/index.js): `src/i18n/index.js`
- [English messages](https://github.com/sabzidev/visionui-dashboard/blob/main/src/i18n/en.js): `src/i18n/en.js`
- [Persian messages](https://github.com/sabzidev/visionui-dashboard/blob/main/src/i18n/fa.js): `src/i18n/fa.js`
- [Route metadata](https://github.com/sabzidev/visionui-dashboard/blob/main/src/layouts/components/Head.jsx): `src/layouts/components/Head.jsx`
- [Service worker](https://github.com/sabzidev/visionui-dashboard/blob/main/public/sw.js): `public/sw.js`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → React entry: opens app
- React entry → Router host: renders (evidence: `src/main.jsx`)
- React entry → App providers: wraps with (evidence: `src/main.jsx`)
- React entry → Auth context: wraps with (evidence: `src/main.jsx`)
- React entry → Service worker: registers (evidence: `src/main.jsx`)
- Router host → Route map: hosts router (evidence: `src/App.jsx`)
- Route map → Private route: routes through (evidence: `src/routes.jsx`)
- Route map → Sign-in page: routes to (evidence: `src/routes.jsx`)
- Route map → Dashboard page: routes to (evidence: `src/routes.jsx`)
- Route map → Profile page: routes to (evidence: `src/routes.jsx`)
- Route map → Tables page: routes to (evidence: `src/routes.jsx`)
- Route map → Admin queries: prefetches (evidence: `src/routes.jsx`)
- Route map → Query client: uses (evidence: `src/routes.jsx`)
- Private route → Auth context: checks identity (evidence: `src/layouts/PrivateRoute.jsx`)
- Private route → Admin queries: checks admin (evidence: `src/layouts/PrivateRoute.jsx`)
- Auth context → Cookie state: persists identity (evidence: `src/contexts/Auth/Auth.jsx`)
- Sign-in page → Sign-in form logic: renders (evidence: `src/pages/auth/Signin/page.jsx`)
- Sign-in page → Auth context: reads session (evidence: `src/pages/auth/Signin/page.jsx`)
- Sign-in page → Admin queries: loads admin (evidence: `src/pages/auth/Signin/page.jsx`)
- Sign-in form logic → Auth context: sets identity (evidence: `src/pages/auth/Signin/hooks/useAuthForm/useAuthForm.js`)
- Sign-in form logic → Admin queries: loads admin (evidence: `src/pages/auth/Signin/hooks/useAuthForm/useAuthForm.js`)
- Dashboard page → Dashboard sections: renders sections (evidence: `src/pages/private/Dashboard/page.jsx`)
- Profile page → Profile sections: renders sections (evidence: `src/pages/private/Profile/page.jsx`)
- Tables page → Authors table: renders (evidence: `src/pages/private/Tables/page.jsx`)
- Tables page → Projects table: renders (evidence: `src/pages/private/Tables/page.jsx`)
- Admin queries → Admin API: calls (evidence: `src/services/features/admin/hooks/useAdmin/useAdmin.js`)
- Authors query → Authors API: calls (evidence: `src/services/features/authors/hooks/useAuthors/useAuthors.js`)
- Projects query → Projects API: calls (evidence: `src/services/features/projects/hooks/useProjects/useProjects.js`)
- Stats query → Stats API: calls (evidence: `src/services/features/stats/hooks/useStats/useStats.js`)
- Query client → Localization setup: translates notices (evidence: `src/services/queryClient.js`)
- Localization setup → English messages: loads messages (evidence: `src/i18n/index.js`)
- Localization setup → Persian messages: loads messages (evidence: `src/i18n/index.js`)
- Route map → Route metadata: provides route data (evidence: `src/routes.jsx`)
