# 开发指南 ## 项目启动 ### 1. 环境准备 确保已安装以下环境: - Node.js >= 16 - Go >= 1.21 - MySQL >= 8.0 ### 2. 快速安装 运行安装脚本: **Windows:** ```bash install.bat ``` **Linux/macOS:** ```bash chmod +x install.sh ./install.sh ``` ### 3. 数据库配置 创建数据库: ```sql CREATE DATABASE task_track CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ``` 修改 `backend/config.yaml`: ```yaml database: host: "localhost" port: "3306" username: "your_username" # 替换为你的用户名 password: "your_password" # 替换为你的密码 database: "task_track" ``` ### 4. 启动服务 **启动后端(在 backend 目录下):** ```bash cd backend go run main.go ``` **启动前端(在 frontend 目录下):** ```bash cd frontend npm run dev ``` ### 5. 访问应用 - 前端:http://localhost:5173 - 后端API:http://localhost:8080 ## 开发规范 ### 前端开发 #### 目录结构 ``` src/ ├── components/ # 公共组件 ├── views/ # 页面组件 ├── router/ # 路由配置 ├── store/ # 状态管理 ├── api/ # API接口 ├── utils/ # 工具函数 └── styles/ # 样式文件 ``` #### 命名规范 - 组件文件:PascalCase(如 `UserList.vue`) - 页面文件:PascalCase(如 `Dashboard.vue`) - 工具函数:camelCase(如 `formatDate`) - 常量:UPPER_SNAKE_CASE(如 `API_BASE_URL`) #### 组件开发规范 1. 使用 `