feat: add one-click startup scripts for project management

- Add start.sh/start.bat for one-click startup (backend + frontend)
- Add stop.sh/stop.bat for stopping all services
- Add restart.sh for restarting services
- Add status.sh for checking service status
- Add Makefile with convenient management commands
- Add comprehensive documentation (ONE_CLICK_START.md)
- Update README with one-click startup instructions

Features:
- Automatic environment checking (venv, node_modules)
- Process management with PID tracking
- Unified log management (logs/*.log)
- Health checking after startup
- Support for Linux, macOS, and Windows
- No more need for multiple terminal windows

Usage:
  ./start.sh      # Start all services
  ./stop.sh       # Stop all services
  ./status.sh     # Check service status
  ./restart.sh    # Restart services
  make start      # Alternative using Makefile

Benefits:
- One command instead of multiple terminals
- Automatic environment validation
- Centralized logging
- Process lifecycle management
- Developer-friendly output messages
This commit is contained in:
2026-03-22 02:49:22 +00:00
parent acd73431ae
commit 344a750cfb
11 changed files with 1521 additions and 9 deletions

View File

@@ -13,22 +13,44 @@
**首次使用请阅读**: [快速上手指南](docs/QUICK_START.md)
### 最快 3 步开始
### 一键启动(推荐)
```bash
# 1. 配置后端
cd backend && pip install -r requirements.txt
cp .env.example .env # 编辑填入数据库和 API 配置
# 1. 首次配置
cd backend && python3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt
cd ../frontend && npm install
# 配置环境变量
cd ../backend && cp .env.example .env # 编辑填入数据库和 API 配置
# 2. 启动后端
python -m app.main
# 3. 启动前端
cd ../frontend && npm install && npm run dev
# 2. 启动项目(一个命令启动前后端
cd ..
./start.sh # Linux/Mac
#
start.bat # Windows
```
访问 http://localhost:5173 开始使用!
**管理命令**:
- 查看状态: `./status.sh`
- 停止服务: `./stop.sh`
- 重启服务: `./restart.sh`
- 查看日志: `tail -f logs/backend.log`
**详细说明**: [一键启动指南](docs/ONE_CLICK_START.md)
### 手动启动(开发模式)
如果你需要分别启动前后端:
```bash
# 终端 1: 启动后端
cd backend && source venv/bin/activate && python -m app.main
# 终端 2: 启动前端
cd frontend && npm run dev
```
### 1. 环境要求
- Python 3.10+