Przeglądaj źródła

📝 docs(claude): 更新开发环境文档和项目说明

- 移除原有的开发命令和架构概述内容
- 添加多八多云端开发容器环境说明
- 补充Node.js、MySQL、Redis和MinIO等服务信息
- 更新Claude Code使用指南,包含pnpm使用、类型检查和测试相关说明
- 添加数据库访问方式和vitest调试注意事项
- 明确前端使用hono/client hc rpc而非直接fetch
- 补充bmad-core目录位置信息
yourname 2 miesięcy temu
rodzic
commit
f86a6193f5
1 zmienionych plików z 18 dodań i 53 usunięć
  1. 18 53
      CLAUDE.md

+ 18 - 53
CLAUDE.md

@@ -2,51 +2,14 @@
 
 This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
 
-## Development Commands
-
-### Build Commands
-- `npm run build` - Build both client and server
-- `npm run build:client` - Build client only
-- `npm run build:server` - Build server only
-
-### Development Commands
-- `npm run dev` - Start development server (port 8080)
-- `npm run dev:stock` - Development with backend debug logging
-- `npm run dev:socket` - Development with socket debug logging
-- `npm run start` - Start production server
-
-## Architecture Overview
-
-This is a full-stack TypeScript application using:
-- **Frontend**: React 19 + Vite + Tailwind CSS
-- **Backend**: Hono.js framework with Express-style routing
-- **Database**: TypeORM with MySQL
-- **Real-time**: Socket.IO for WebSocket communication
-- **Authentication**: JWT-based auth with middleware
-
-### Key Directories
-- `src/client/` - Frontend React components and pages
-- `src/server/` - Backend API routes, middleware, and services
-- `src/server/api/` - Hono.js API route definitions
-- `src/server/modules/` - Business logic modules (users, auth, etc.)
-- `src/server/middleware/` - Authentication and custom middleware
-- `src/share/` - Shared types and utilities
-
-### Database & ORM
-- Uses TypeORM with MySQL2 driver
-- Entity files in `src/server/modules/*/*.entity.ts`
-- Database configuration in `src/server/data-source.ts`
-
-### Real-time Features
-- Socket.IO integration for real-time communication
-- Socket middleware for authentication
-- Socket handlers in `src/server/socket/`
-
-### Authentication System
-- JWT-based authentication
-- User roles: TEACHER, STUDENT, TRAINEE
-- Trainee expiration system with automatic status updates
-- Middleware in `src/server/middleware/`
+### 开发环境说明
+- 多八多云端开发容器环境
+- Node.js 20.19.2
+- MySQL 8 (默认数据库: d8dai)
+- Redis 7
+- MinIO(默认存储桶: d8dai)
+- 所有服务使用默认参数连接,正式环境参数相同
+- 默认开放8080端口供外网访问
 
 ## Project Standards & Rules
 - @.roo/rules/01-general.md - 通用开发规范
@@ -68,12 +31,14 @@ This is a full-stack TypeScript application using:
 - @.roo/rules/14-crud-filtering.md - CRUD筛选规范
 - @.roo/rules/15-user-tracking.md - 用户追踪规范
 
-## Development Notes
-- Uses pnpm as package manager
-- Vite for both dev server and production builds
-- SSR (Server-Side Rendering) setup with Hono.js
-- Environment variables via `.env` file
-- Port 8080 for development and production
-
 ## Claude Code
-- Always response in Chinese
+- use pnpm
+- 检查类型错误直接用pnpm typecheck检查整个项目,不要单独检查单个文件
+- 数据库在同一容器组的另一个容器中,需要运行 mysql -h 127.0.0.1 -u root 来访问
+- vitest中,只有console.debug会显示,其他的都屏蔽了
+- vitest中,用import 来配合 vi.mocked,而不是require
+- e2e测试平常只运行 pnpm test:e2e:chromium 就行
+- e2e测试失败时先查看页面结构 test-results/**/error-context.md
+- 前端是 hono/client  hc  rpc 的,不是直接fetch
+- bmad-core dir is in .bmad-core
+- 必须用中文回答