# wangxuancheng-dev/goravel-admin architecture

> Architecture diagram of the GitHub repository wangxuancheng-dev/goravel-admin, 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/wangxuancheng-dev/goravel-admin
- Repository: https://github.com/wangxuancheng-dev/goravel-admin

## Overview

Goravel Admin is a Go/Goravel administration product with Vue and React clients, shared admin APIs, and an optional database-per-tenant platform console. The main workflow is an administrator using the UI to authenticate, manage records, and view results returned by backend APIs. The README documents additional modules including RBAC, exports, notifications, AI, monitoring, and optional search, queues, and sharding. Source excerpts confirm search-driver and storage behavior, but most endpoint-to-service wiring was not sampled; those links are shown only at the broad documented API boundary.

Main entry points: [`app/http/controllers/admin/admin_controller.go`](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/http/controllers/admin/admin_controller.go) (Admin controllers), [`app/http/kernel.go`](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/http/kernel.go) (HTTP API), [`app/models/order.go`](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/models/order.go) (Domain records), [`app/services/order_service.go`](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/order_service.go) (Orders and payments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Admin clients"]
  node_ui["Admin interfaces<br/>[App.tsx]"]
  node_platformui["Platform console<br/>[Layout.tsx]"]
end

subgraph group_http["HTTP and access"]
  node_httpapi["HTTP API<br/>[kernel.go]"]
  node_middleware["Auth and permissions<br/>[middleware.go]"]
  node_adminctrl["Admin controllers"]
  node_platformctrl["Platform controllers"]
end

subgraph group_domains["Admin domains"]
  node_auth["Identity and RBAC<br/>[auth_service.go]"]
  node_adminsvc["Admin management<br/>[user_service.go]"]
  node_commerce["Orders and payments<br/>[order_service.go]"]
  node_content["Content and configuration<br/>[article_service.go]"]
  node_tenant["Tenant operations"]
end

subgraph group_runtime["Runtime services"]
  node_records["Domain records<br/>[order.go]"]
  node_database[("Relational database")]
  node_jobs["Background jobs<br/>[export_orders.go]"]
  node_files["File storage<br/>[storage_disk.go]"]
  node_notifications["Live notifications<br/>[hub.go]"]
end

subgraph group_optional["Optional capabilities"]
  node_search["Order search<br/>[service.go]"]
  node_searchengine["Search engine<br/>[engine.go]"]
  node_ai["AI Lab<br/>[ai_service.go]"]
  node_telemetry["Monitoring"]
end

node_admin(("Administrator"))
node_redis[("Redis")]
node_searchbackend[("Search backend")]
node_aiapi{{"AI provider"}}
node_staff(("Platform operator"))

node_admin -->|"uses"| node_ui
node_ui -->|"calls admin API"| node_httpapi
node_httpapi -->|"applies access"| node_middleware
node_httpapi -->|"dispatches"| node_adminctrl
node_adminctrl -->|"authenticates"| node_auth
node_adminctrl -->|"manages"| node_adminsvc
node_adminctrl -->|"handles commerce"| node_commerce
node_adminctrl -->|"manages content"| node_content
node_adminctrl -->|"serves AI Lab"| node_ai
node_adminsvc -->|"reads and writes"| node_records
node_commerce -->|"reads and writes"| node_records
node_content -->|"reads and writes"| node_records
node_tenant -->|"isolates tenant data"| node_database
node_records -->|"persists"| node_database
node_commerce -.->|"queues work"| node_jobs
node_jobs -->|"stores exports"| node_files
node_ui -->|"receives updates"| node_notifications
node_commerce -.->|"indexes orders"| node_search
node_search -.->|"queries and indexes"| node_searchengine
node_searchengine -.->|"uses driver"| node_searchbackend
node_ai -.->|"requests AI"| node_aiapi
node_staff -->|"uses"| node_platformui
node_platformui -->|"calls API"| node_httpapi
node_httpapi -->|"dispatches"| node_platformctrl
node_platformctrl -->|"manages tenants"| node_tenant
node_telemetry -->|"reads metrics data"| node_records
node_jobs -.->|"uses queue"| node_redis

click node_ui "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/html-react/src/App.tsx"
click node_platformui "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/html-react/src/pages/platform/Layout.tsx"
click node_httpapi "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/http/kernel.go"
click node_middleware "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/http/middleware/middleware.go"
click node_adminctrl "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/http/controllers/admin/admin_controller.go"
click node_platformctrl "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/http/controllers/platform/tenant_controller.go"
click node_auth "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/auth_service.go"
click node_adminsvc "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/user_service.go"
click node_commerce "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/order_service.go"
click node_content "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/article_service.go"
click node_tenant "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/tenant_admin_service.go"
click node_records "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/models/order.go"
click node_jobs "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/jobs/export_orders.go"
click node_files "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/utils/storage_disk.go"
click node_notifications "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/websocket/notifications/hub.go"
click node_search "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/search/orders/service.go"
click node_searchengine "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/search/engine.go"
click node_ai "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/ai_service.go"
click node_telemetry "https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/observability_service.go"

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_ui,node_platformui toneBlue
class node_httpapi,node_middleware,node_adminctrl,node_platformctrl,node_redis,node_searchbackend toneAmber
class node_auth,node_adminsvc,node_commerce,node_content,node_tenant toneMint
class node_records,node_database,node_jobs,node_files,node_notifications toneRose
class node_search,node_searchengine,node_ai,node_telemetry,node_admin,node_aiapi,node_staff toneIndigo
```

## Components

### Admin clients

- [Admin interfaces](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/html-react/src/App.tsx): `html-react/src/App.tsx`
- [Platform console](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/html-react/src/pages/platform/Layout.tsx): `html-react/src/pages/platform/Layout.tsx`

### HTTP and access

- [HTTP API](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/http/kernel.go): `app/http/kernel.go`
- [Auth and permissions](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/http/middleware/middleware.go): `app/http/middleware/middleware.go`
- [Admin controllers](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/http/controllers/admin/admin_controller.go): `app/http/controllers/admin/admin_controller.go`
- [Platform controllers](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/http/controllers/platform/tenant_controller.go): `app/http/controllers/platform/tenant_controller.go`

### Admin domains

- [Identity and RBAC](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/auth_service.go): `app/services/auth_service.go`
- [Admin management](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/user_service.go): `app/services/user_service.go`
- [Orders and payments](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/order_service.go): `app/services/order_service.go`
- [Content and configuration](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/article_service.go): `app/services/article_service.go`
- [Tenant operations](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/tenant_admin_service.go): `app/services/tenant_admin_service.go`

### Runtime services

- [Domain records](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/models/order.go): `app/models/order.go`
- **Relational database**
- [Background jobs](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/jobs/export_orders.go): `app/jobs/export_orders.go`
- [File storage](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/utils/storage_disk.go): `app/utils/storage_disk.go`
- [Live notifications](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/websocket/notifications/hub.go): `app/websocket/notifications/hub.go`

### Optional capabilities

- [Order search](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/search/orders/service.go): `app/search/orders/service.go`
- [Search engine](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/search/engine.go): `app/search/engine.go`
- [AI Lab](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/ai_service.go): `app/services/ai_service.go`
- [Monitoring](https://github.com/wangxuancheng-dev/goravel-admin/blob/main/app/services/observability_service.go): `app/services/observability_service.go`

### Other components

- **Administrator**
- **Redis**
- **Search backend**
- **AI provider**
- **Platform operator**

## Connections

- Administrator → Admin interfaces: uses
- Admin interfaces → HTTP API: calls admin API
- HTTP API → Auth and permissions: applies access
- HTTP API → Admin controllers: dispatches
- Admin controllers → Identity and RBAC: authenticates
- Admin controllers → Admin management: manages
- Admin controllers → Orders and payments: handles commerce
- Admin controllers → Content and configuration: manages content
- Admin controllers → AI Lab: serves AI Lab
- Admin management → Domain records: reads and writes
- Orders and payments → Domain records: reads and writes
- Content and configuration → Domain records: reads and writes
- Tenant operations → Relational database: isolates tenant data
- Domain records → Relational database: persists
- Orders and payments → Background jobs: queues work
- Background jobs → File storage: stores exports
- Admin interfaces → Live notifications: receives updates
- Orders and payments → Order search: indexes orders
- Order search → Search engine: queries and indexes
- Search engine → Search backend: uses driver
- AI Lab → AI provider: requests AI
- Platform operator → Platform console: uses
- Platform console → HTTP API: calls API
- HTTP API → Platform controllers: dispatches
- Platform controllers → Tenant operations: manages tenants
- Monitoring → Domain records: reads metrics data
- Background jobs → Redis: uses queue
