diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..d4af14e --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,333 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +HZHub (汇智中台) is an enterprise-level business platform built on HZHub-AI, integrating AI capabilities with ERP data adaptation. It consists of multiple frontend portals, a backend AI service, an ERP service, and a gateway, orchestrated via Docker Compose. + +## Commands + +### Docker Deployment (Production-like) + +```bash +# Start all services (recommended for integration testing) +cd hzhub-deploy +docker-compose up -d + +# View service status +docker-compose ps + +# View logs +docker-compose logs -f hzhub-ai +docker-compose logs -f hzhub-admin + +# Restart services +docker-compose restart hzhub-ai + +# Stop all services +docker-compose down +``` + +### Backend Development (Spring Boot) + +```bash +# Run AI service locally +cd hzhub-ai/hzhub-admin +mvn spring-boot:run -Dspring-boot.run.profiles=dev + +# Build all modules +cd hzhub-ai +mvn clean package + +# Build specific module +cd hzhub-ai/hzhub-modules/hzhub-chat +mvn clean package + +# Run tests +mvn test +``` + +### Frontend Development (Vue 3 + Vben Admin) + +```bash +# Admin portal development +cd hzhub-admin +pnpm install # Install dependencies +pnpm dev # Start dev server +pnpm build # Build all packages +pnpm --filter=@vben/web-antd build:prod # Build admin frontend + +# Company portal development +cd hzhub-portal-company +pnpm install +pnpm dev + +# Dealer portal development +cd hzhub-portal-dealer +pnpm install +pnpm dev +``` + +## Architecture + +### Multi-Service Structure + +``` +┌─────────────────────────────────────────┐ +│ Frontend Layer │ +│ hzhub-admin | hzhub-portal-company │ +│ | hzhub-portal-dealer │ +└────────────┬────────────────────────────┘ + │ + ┌────────┴────────┐ + │ hzhub-gateway │ (API Gateway - planned) + │ Spring Cloud │ Auth, routing, rate limiting + └────────┬────────┘ + │ + ┌────────┴────────┬────────────┐ + │ hzhub-ai │ hzhub-erp │ + │ (AI Service) │ (Planned) │ + │ Spring Boot │ JDBC to │ + │ 3.5.8 │ SQL Server│ + └─────────────────┴────────────┘ +``` + +### Backend Module Organization + +**hzhub-ai** is organized as a multi-module Maven project: + +- **hzhub-admin**: Main application entry point (`HZHubAIApplication.java`), configuration files +- **hzhub-common**: Shared utilities (core, redis, mybatis, security, satoken, oss, chat, etc.) +- **hzhub-modules**: Business modules + - **hzhub-chat**: Chat/AI conversation functionality + - **hzhub-system**: System management, users, roles, permissions + - **hzhub-workflow**: Workflow engine (Flowable-based) + - **hzhub-aiflow**: AI workflow orchestration + - **hzhub-generator**: Code generator +- **hzhub-extend**: Extensions (monitoring, job scheduling) + +### Frontend Architecture + +**hzhub-admin** uses a monorepo structure with pnpm + turbo: + +``` +hzhub-admin/ +├── apps/ +│ └── web-antd/ # Main admin application (Ant Design Vue) +│ ├── src/ +│ │ ├── api/ # API calls +│ │ ├── views/ # Page components +│ │ ├── router/ # Vue Router config +│ │ └── store/ # Pinia stores +│ └── package.json +├── packages/ # Shared packages +└── package.json # Root monorepo config +``` + +**Portal applications** (hzhub-portal-company, hzhub-portal-dealer) are Vue 3 apps with: +- Composition API (`