CLAUDE.md
jeecgboot-vue3/CLAUDE.mdCLAUDE.md
Quality
97/100
Scores the file, not the repository.Length
985 words
25 headings · 2 code blocksRepository
47k
— · pushed 4 days agoLast changed
3 days ago
First indexed 3 days ago.1# CLAUDE.md23This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.45## Project Overview67JeecgBoot Vue3 frontend — an enterprise low-code platform built with Vue 3 + Vite 6 + Ant Design Vue 4 + TypeScript. Uses pnpm as package manager. Node 18 or 20+ required (`engines: "^18 || >=20"`).89## Common Commands1011```bash12pnpm dev # Start dev server (port 3100, mock enabled)13pnpm build # Production build (output: dist/)14pnpm build:docker # Docker production build15pnpm build:dockercloud # Docker cloud production build16pnpm build:report # Build with bundle visualizer17pnpm preview # Build + preview1819# Linting (no unified "lint" script — run individually)20npx eslint src/path/to/file.vue # Lint specific file21npx stylelint "src/**/*.{vue,less,css}" # Stylelint22pnpm batch:prettier # Format all src files2324# Testing (Jest configured but not integrated into npm scripts)25# Tests exist in tests/ directory but no test script in package.json26# Run manually if needed: npx jest2728pnpm clean:cache # Clear Vite cache29pnpm gen:icon # Regenerate icon data30pnpm reinstall # Clean reinstall all dependencies31```3233## Path Aliases3435- `/@/` and `@/` → `src/`36- `/#/` and `#/` → `types/`37- `~icons/{collection}/{name}` → unplugin-icons (compile-time icon imports)3839The `/@/` prefix (with leading slash) is the project's conventional alias — prefer it for consistency.4041## Architecture4243### Bootstrap Sequence (src/main.ts)4445`createApp` → createRouter → setupStore (pinia) → setupProps → i18n → initAppConfigStore → registerPackages (@jeecg/online) → registerGlobComp (core Ant Design components) → SSO login → registerSuper (dynamic module discovery) → setupRouter → guards → directives → error handler → registerThirdComp (vxe-table, emoji, dayjs) → setupElectron → router.isReady() → mount4647### Routing & Permissions4849- **Permission mode: BACK** — routes and menus are fetched from the backend API via `getBackMenuAndPerms()`50- Dynamic routes added at runtime in `src/store/modules/permission.ts`51- Static routes: login, oauth2-login, token-login, error pages, AI dashboard52- Router mode: HTML5 history (hash mode when running in Electron)53- Super modules discovered dynamically via `import.meta.glob('./**/register.ts')` in `src/views/super/registerSuper.ts`5455### State Management (Pinia)5657Key stores in `src/store/modules/`:58- `user.ts` (app-user) — auth token, user info, roles, tenant, dict items59- `permission.ts` (app-permission) — dynamic routes, permission codes, backend menus60- `app.ts` (app) — project config, theme, layout settings61- `locale.ts` (app-locale) — i18n locale62- `multipleTab.ts` (app-multiple-tab) — tab state6364Auth persisted in localStorage via `src/utils/auth/index.ts`.6566### API Layer6768- Custom Axios wrapper: `src/utils/http/axios/` — configured instance exported as `defHttp`69- All requests signed with MD5 via `signMd5Utils`70- Tenant ID injected as header when `VITE_GLOB_TENANT_MODE` is enabled71- Response format: `{ code, result, message, success }` where `code === 200` is success7273### Component Registration7475- **Auto-import**: `unplugin-vue-components` with `AntDesignVueResolver` auto-imports all Ant Design Vue components (no manual import needed in templates)76- **Global manual**: `registerGlobComp.ts` registers Icon, AIcon, JUploadButton, Button, TinyMCE Editor77- **Third-party**: `registerThirdComp.ts` registers vxe-table (full import), custom vxe cell components, emoji picker, dayjs plugins78- **Async loading**: Heavy components use `src/utils/factory/createAsyncComponent.tsx`7980### Icon System8182Three icon approaches:831. **Iconify runtime** — `<Icon icon="mdi:home" />` via `@iconify/iconify` CDN lazy-load842. **SVG sprites** — `<Icon icon="icon-name|svg" />` via `vite-plugin-svg-icons`853. **unplugin-icons** — `import IconName from '~icons/collection/name'` for compile-time tree-shaken icons8687### Theme System8889- Less variables generated by `build/generate/generateModifyVars.ts`90- Dark mode via Ant Design Vue `theme.darkAlgorithm`91- CSS variable `--j-global-primary-color` set dynamically from theme color92- CSS class prefix: `jeecg` (defined in `src/settings/designSetting.ts`)9394### External Packages9596- `@jeecg/online` and `@jeecg/aiflow` are external monorepo packages excluded from Vite optimizeDeps (CJS compatibility issues)97- Registered via `registerPackages(app)` in main.ts9899### Performance Optimization Patterns100101**Critical: Use dynamic imports for non-critical modules**102- Static `import` at top of file causes the entire dependency chain to load on initial page103- Use `await import('module')` or `import('path/to/module').then()` for lazy loading104- Key files using dynamic imports:105 - `src/settings/registerThirdComp.ts` — vxe-table, emoji picker (loaded after mount)106 - `src/views/super/registerSuper.ts` — dynamic module discovery107 - Non-critical Ant Design Vue components loaded asynchronously108109**Vite optimizeDeps**110- Pre-bundled dependencies in `vite.config.ts` include: dayjs, axios, pinia, nprogress, qs, crypto-js, md5, sortablejs, xe-utils, vue-i18n, lodash-es, xss, mockjs111- External packages (`@jeecg/*`) excluded due to CJS issues112113### Micro-Frontend (Qiankun)114115- Can run as master (hosting sub-apps) or child (embedded in parent)116- Config in `src/qiankun/`, sub-apps via `VITE_APP_SUB_*` env vars117- Child mode activated when `VITE_GLOB_QIANKUN_MICRO_APP_NAME` is set118119### Electron Support120121- `src/electron/` — uses hash router mode122- Platform detected via `VITE_GLOB_RUN_PLATFORM === 'electron'`123124## Key Configuration125126### Environment Variables127128- `.env` — base config (port 3100, app title, SSO/qiankun flags)129- `.env.development` — mock enabled, proxy to `localhost:8080/jeecg-boot`130- `.env.production` — mock disabled, gzip compression131- `.env.docker` — Docker production build config132- `.env.dockercloud` — Docker cloud production build config133- `.env.prod_electron` — Electron production build config134- `VITE_GLOB_*` vars are injected at runtime via `dist/_app.config.js` (changeable post-build)135136### Build137138- Manual chunks: `vue-vendor`, `antd-vue-vendor`, `vxe-table-vendor`, `emoji-mart-vue-fast`, `china-area-data-vendor`139- Post-build: `build/script/postBuild.ts` generates runtime config; `copyChat.ts` copies chat assets140- Console/debugger stripped in production via esbuild141142## Code Style143144- **Prettier**: 150 char width, single quotes, trailing commas (es5), 2-space indent, `endOfLine: 'auto'`, `vueIndentScriptAndStyle: true` (indent inside `<script>`/`<style>`), `htmlWhitespaceSensitivity: 'strict'`145- **ESLint**: Vue3 recommended + TypeScript recommended + Prettier. `any` is allowed. Unused vars prefixed with `_` are ignored. Note: `prettier/prettier` rule is `'off'` — Prettier is not enforced via ESLint, run it separately146- **Commits**: Conventional commits enforced via commitlint. Types: feat, fix, perf, style, docs, test, refactor, build, ci, chore, revert, wip, workflow, types, release. Max header: 108 chars147- **i18n**: Chinese (zh-CN) and English supported. Locale files in `src/locales/lang/`148149## Important Directories150151```152build/ # Vite plugins, build scripts, theme generation153src/api/ # API definitions (sys/, common/, demo/)154src/components/jeecg/ # Jeecg-specific components (JVxeTable, OnLine, etc.)155src/layouts/default/ # Main app layout (header, sider, tabs, menu)156src/settings/ # Project settings (design, components, locale, encryption)157src/utils/http/axios/ # HTTP client configuration158src/views/system/ # System management pages (user, role, menu, dict, etc.)159src/views/super/ # Dynamically-discovered extension modules160types/ # Global TypeScript declarations161```162
Also in jeecgboot/JeecgBoot
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| jeecgboot/JeecgBootjeecg-boot/CLAUDE.md · 47k | CLAUDE.md | buildteststylearch+3 | 89/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| dotCMS/corecore-web/CLAUDE.md · 950 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| microsoft/playwrightCLAUDE.md · 94k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 3 days ago | |
| filamentphp/filamentCLAUDE.md · 32k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| dotCMS/coreCLAUDE.md · 950 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | 3 days ago | |
| lollipopkit/flutter_server_boxCLAUDE.md · 8.3k | CLAUDE.md | buildteststylearch+2 | 98/100 | 3 days ago |
