5.1 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
小蚂蚁云 (EasyGoAdmin) — a Chinese-language enterprise admin platform. A monolith assembled from a Maven multi-module backend (Java 17, Spring Boot 3.3.0) plus a Vue 3 SPA frontend in xiaomayi-ui/. Despite module names suggesting microservices, all services are packaged as library jars into single deployable apps (xiaomayi-admin, xiaomayi-web, xiaomayi-uniapp) that component-scan com.xiaomayi.*.
Code comments, commit messages, and UI text are in Chinese.
Commands
Backend (Maven, run from repo root)
mvn clean install # build all modules
mvn clean package -P prod # build with profile: local (default) | dev | test | uat | prod
mvn -pl xiaomayi-modules/xiaomayi-admin -am spring-boot:run # run admin app
The admin app can also be started from the IDE via com.xiaomayi.admin.XMAdminApplication. It listens on port 8081 with context path /api. There are no backend tests in the repo.
Frontend (xiaomayi-ui/, uses pnpm)
pnpm install # or: pnpm bootstrap
pnpm dev # dev server on port 8001, proxies /api -> http://127.0.0.1:8081/api
pnpm build # production build (same as build:prod)
pnpm build:test # test-env build
pnpm type:check # vue-tsc type check
pnpm lint:eslint # eslint --fix on src/
pnpm lint:stylelint # stylelint --fix
pnpm lint:prettier # prettier --write
Lint tooling: ESLint + Prettier + Stylelint + commitlint (conventional) + husky/lint-staged. There is no test suite.
Backend Architecture
Module layout (parent pom.xml at root, version managed via flatten-maven-plugin + ${revision}):
xiaomayi-common/— ~35 independent starter-style libs, one directory per capability (xiaomayi-security,xiaomayi-redis,xiaomayi-mybatis,xiaomayi-oss,xiaomayi-sms,xiaomayi-tenant,xiaomayi-datasource, …).xiaomayi-allis the BOM aggregating them. Feature starters follow Spring Boot auto-configuration conventions.xiaomayi-services/— business domains:system,cms,product,order,member,logistics,invoice,quartz(scheduling),generator(code generator). Each followscontroller / service / mapper / entity / dto / voundercom.xiaomayi.<domain>, with MyBatis mapper XML insrc/main/resources/mapper/.xiaomayi-modules/— deployable applications that wire services + starters together:xiaomayi-admin— the admin backend (main entry:XMAdminApplication)xiaomayi-web— public website backendxiaomayi-uniapp— mobile/API backend
xiaomayi-visual/—xiaomayi-monitor(Spring Boot Admin-style monitoring).
Configuration layering (important)
XMAdminApplication excludes the default DataSource/Druid/MyBatis-Plus/Security auto-config; these are wired manually via the common starters. Config resolution:
xiaomayi-modules/xiaomayi-admin/src/main/resources/application.yml— imports shared feature configs fromconfigs/application-*.yml(mybatis, security, tenant, springdoc, knife4j, payment, …).- Maven profile (
-P local|dev|test|uat|prod) setspackage.environment→spring.profiles.active→ loadsapplication-{env}.yml. - Each env yml imports env-specific overrides from
configs/{env}/(redis, minio, aliyun OSS/SMS, email, token, elastic, dingtalk). Datasource config lives inapplication-{env}.yml.
To change behavior for one environment only, edit configs/{env}/…; for a cross-cutting feature, edit the shared configs/application-*.yml.
Database: MySQL, dynamic-datasource (multi-datasource capable, Druid pool), default easygoadmin.web at localhost:3306 (root/root in dev). Init SQL: document/easygoadmin.web.sql.
Frontend Architecture (xiaomayi-ui/)
Vue 3 + TypeScript + Vite 3 + Element Plus + Pinia + vue-router 4 + TailwindCSS. Path alias @ → src/.
- Dynamic routes: menus and routes come from the backend menu API (
src/api/system/menu), formatted byrouterGeneratorinsrc/router/generator-routers.ts.LAYOUT/IFRAMEare virtual components mapped inrouter-guards.ts. Adding a new admin page requires a menu record in the DB (component path points at the view file undersrc/views/), not just a router entry. - HTTP: centralized Axios wrapper in
src/utils/http/axios/(transform hooks, cancel, error handling). API modules undersrc/api/mirror the backend domains and the page folders insrc/views/. - Env vars:
.env(base),.env.development,.env.test,.env.production.VITE_PROXYin.env.developmentcontrols the dev proxy. - Build:
build/holds Vite plugin factory, proxy helper, and a post-build script (build/script/postBuild.ts); output goes todist/.
Deployment
Dockerfile (root) runs xiaomayi-elevue.jar on OpenJDK 17 alpine, port 8081. docker-compose.yml builds it with network_mode: host, mounting ./logs → /data/java/logs and ./upload → /data/java/uploads (file uploads land in upload/).