Files
lobster-memory-sync/DEPLOY.md
道童 f176e2d818 feat: 完成龙虾记忆同步系统
后端:
- Django + DRF
- PostgreSQL 数据库
- 文件扫描服务
- 差异检查服务
- 完整 REST API

前端:
- React + Ant Design
- 文件树展示
- 差异对比
- API 客户端封装

部署:
- Docker Compose
- 后端 Dockerfile
- 前端 Dockerfile
- 一键启动脚本

功能:
- 扫描龙虾记忆文件
- 检查文件差异
- 双向同步(本地 <-> 数据库)
- 版本历史
- 统计信息
2026-04-05 12:04:13 +00:00

107 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Lobster Memory Sync
## 部署指南
### 前置条件
- Docker
- Docker Compose
### 快速启动
1. **克隆项目**
```bash
cd /home/node/.openclaw/workspace/daotong/lobster-memory-sync
```
2. **启动服务**
```bash
docker-compose up -d
```
3. **访问应用**
- 前端http://localhost:8086
- 后端 APIhttp://localhost:8087/api/
- PostgreSQLlocalhost:5432
### 开发模式
#### 后端开发
```bash
# 进入后端容器
docker exec -it lobster-backend bash
# 创建迁移
python manage.py makemigrations memory_app
python manage.py migrate
# 创建超级用户
python manage.py createsuperuser
```
#### 前端开发
```bash
# 本地开发(不使用 Docker
cd frontend
npm install
npm start
```
### API 接口文档
#### 扫描文件
```
GET /api/scan/?lobster_id=daotong
```
#### 检查同步状态
```
GET /api/status/?lobster_id=daotong
```
#### 获取文件差异
```
GET /api/diff/?lobster_id=daotong&file_path=MEMORY.md
```
#### 同步到数据库
```
POST /api/sync/db/
{
"lobster_id": "daotong",
"file_path": "MEMORY.md"
}
```
#### 同步到本地
```
POST /api/sync/local/
{
"lobster_id": "daotong",
"file_path": "MEMORY.md"
}
```
### 故障排查
#### 查看日志
```bash
docker-compose logs -f
```
#### 重启服务
```bash
docker-compose restart
```
#### 清理数据
```bash
docker-compose down -v
docker-compose up -d
```
### 技术栈
- **后端**: Django + Django REST Framework + PostgreSQL
- **前端**: React + Ant Design + react-diff-viewer-continued
- **部署**: Docker + Docker Compose