Skip to content

Frontend Overview

Built on SoybeanAdmin: Vue3 + Vite7 + TypeScript + Pinia + UnoCSS + Naive UI. /web/ is a pnpm workspace; business code in web/src/, internal subpackages in web/packages/.

Tech stack

TechVersionPurpose
Vue3.5UI framework
Vite7Build
TypeScript5.9Types
Naive UI2.44Components
Pinia3State
UnoCSS66+Atomic CSS
AlovaHTTP client (business requests)
vue-router4Dynamic routing (server-issued)
vue-i18n11i18n
Elegant RouterAuto-generates routes from views/
unplugin-iconsOn-demand icon registration

Layout

web/
├── src/
│   ├── views/                # Pages (Elegant Router scans this)
│   ├── service/              # HTTP layer (factory + API functions)
│   │   ├── api/              # fetchXxx, one file per backend module
│   │   └── request/          # interceptors / codes / token refresh
│   ├── typings/              # TS types
│   │   ├── api/              # interfaces matching backend schemas
│   │   ├── app.d.ts
│   │   └── router.d.ts
│   ├── store/                # Pinia
│   │   └── modules/{auth,route,tab,theme,...}/
│   ├── router/               # vue-router wrapper
│   │   ├── elegant/          # auto-generation + transform
│   │   ├── guard/            # guard chain (auth / dynamic / permission)
│   │   └── routes/builtin.ts # public routes (login / error pages)
│   ├── hooks/                # composables (useTable / useAuth / ...)
│   ├── components/           # global components
│   ├── layouts/              # layout components
│   ├── theme/                # theme source (settings.ts / types / utils)
│   ├── locales/              # i18n (zh-CN / en-US)
│   └── assets/svg-icon/      # local SVG icons
├── packages/                 # internal subpackages
│   ├── alova/
│   ├── axios/
│   ├── hooks/
│   ├── utils/
│   ├── color/
│   └── uno-preset/
└── vite.config.ts

Dev commands

bash
cd web
pnpm install      # install deps
pnpm dev          # dev server (:9527)
pnpm build        # production build
pnpm lint         # ESLint + oxlint
pnpm typecheck    # vue-tsc

Or use root make web-dev / web-build / web-lint / web-typecheck or make dev to start backend + frontend together. See Commands.

Relationship with the backend

The frontend does not define permissions or visible routes — both come from the backend per-role:

DataSource
Current user's roles / button permissionsGET /api/v1/auth/user-info
Public routes (login / error pages)GET /api/v1/route/constant-routes
Menu tree visible to the current userGET /api/v1/route/user-routes
Dictionary optionsGET /api/v1/system-manage/dictionaries/{type}/options

See Dynamic routes and backend RBAC.

Subtopic entrypoints

TopicStart
RoutingIntroStructureDynamic
RequestIntroUsageConnect backend
ThemeIntroConfigUnoCSS
IconsIntroUsage
HooksuseTable

Style & conventions

SFC structure, naming, etc. — see Vue style and Naming.

基于 MIT 协议发布