diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..40648ee --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,104 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +DesignHub is a full-stack Designer Task Management Platform (设计师任务抢单管理系统) - a task distribution and management system with a point-based incentive mechanism. + +**Tech Stack:** +- **Frontend**: Vue 3 + TypeScript + Ant Design Vue + Pinia + Vite +- **Backend**: Spring Boot 3.x (Java 17) + MySQL + MyBatis Plus + Redis +- **Authentication**: JWT tokens with RBAC (7 roles) + +## Common Commands + +### Frontend (cd frontend) +```bash +pnpm install # Install dependencies +pnpm dev # Start dev server (port 3000) +pnpm build # Build for production +pnpm lint # Lint and fix code +pnpm format # Format with Prettier +``` + +### Backend (cd backend) +```bash +mvn clean install -DskipTests # Build project +mvn spring-boot:run # Start dev server (port 8080) +java -jar target/designhub-backend-*.jar # Run compiled JAR +``` + +### Database +```bash +mysql -u root -p < database/schema.sql +mysql -u root -p < database/init-data.sql +``` + +## Architecture + +### Backend Structure +``` +backend/src/main/java/com/designhub/ +├── annotation/ # Custom annotations (@RequirePermission, @RequireRole) +├── common/ # Result wrapper, ResultCode enums +├── config/ # Spring configs (Cors, MyBatis, Swagger, Web) +├── controller/ # REST APIs (38 controllers) +├── dto/ # Request DTOs +├── entity/ # JPA entities (53 tables) +├── exception/ # Business exceptions +├── interceptor/ # Auth interceptor +├── mapper/ # MyBatis mappers +├── service/ # Business logic (41 services) +├── util/ # JwtUtil, ExcelExportUtil, etc. +└── vo/ # Response View Objects +``` + +### Frontend Structure +``` +frontend/src/ +├── api/ # Axios API modules (task.ts, user.ts, auth.ts, etc.) +├── components/ # Reusable components (TaskCard, Navbar, etc.) +├── composables/ # Vue composables +├── layouts/ # Layout wrappers +├── router/ # Vue Router config +├── stores/ # Pinia stores (auth, config, siteSettings) +├── types/ # TypeScript interfaces +├── utils/ # Utility functions +└── views/ # Page components (27 views) +``` + +### API Documentation +- Swagger UI: http://localhost:8080/doc.html (when backend running) +- Frontend dev server proxies `/api` to `http://localhost:8080` + +## Key Conventions + +### Backend +- Custom permission annotations: `@RequirePermission`, `@RequireRole` on controller methods +- Response format: `Result` wrapper with `ResultCode` enum for status codes +- JWT tokens stored in `Authorization` header (Bearer scheme) + +### Frontend +- Auto-imported Vue components via `unplugin-vue-components` +- API calls use axios with JWT in localStorage +- Vue Composition API (`