Skip to content

Commit aad3c01

Browse files
committed
feat(docs): 添加mermaid支持并更新文档内容(构建文档)
1 parent cc5b4ce commit aad3c01

File tree

8 files changed

+1511
-77
lines changed

8 files changed

+1511
-77
lines changed

package/official-site/.vitepress/config.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineConfig } from 'vitepress'
2-
3-
export default defineConfig({
2+
import { withMermaid } from "vitepress-plugin-mermaid";
3+
export default withMermaid(defineConfig({
44
base: '/',
55
title: "TrailSnap 行影集",
66
description: "AI 驱动的智能相册与旅行足迹记录工具",
@@ -64,4 +64,4 @@ export default defineConfig({
6464
copyright: '版权所有 © 2025-至今 TrailSnap'
6565
}
6666
}
67-
})
67+
}))

package/official-site/.vitepress/theme/components/Home.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ const prevTestimonial = () => {
176176

177177
<!-- Tags -->
178178
<div class="flex flex-wrap justify-center lg:justify-start gap-3 mb-10">
179-
<span class="px-4 py-2 bg-secondary dark:bg-secondary/20 rounded-full text-sm text-neutral-dark dark:text-gray-200 hover:-translate-y-1 transition-transform cursor-default">AI自动整理</span>
180-
<span class="px-4 py-2 bg-secondary dark:bg-secondary/20 rounded-full text-sm text-neutral-dark dark:text-gray-200 hover:-translate-y-1 transition-transform cursor-default">票据智能识别</span>
179+
<span class="px-4 py-2 bg-secondary dark:bg-secondary/20 rounded-full text-sm text-neutral-dark dark:text-gray-200 hover:-translate-y-1 transition-transform cursor-default">AI智能分类</span>
180+
<span class="px-4 py-2 bg-secondary dark:bg-secondary/20 rounded-full text-sm text-neutral-dark dark:text-gray-200 hover:-translate-y-1 transition-transform cursor-default">车票智能识别</span>
181181
<span class="px-4 py-2 bg-secondary dark:bg-secondary/20 rounded-full text-sm text-neutral-dark dark:text-gray-200 hover:-translate-y-1 transition-transform cursor-default">可视化数据</span>
182182
</div>
183183

@@ -189,7 +189,7 @@ const prevTestimonial = () => {
189189
</div>
190190

191191
<!-- Visual Content -->
192-
<div class="w-[80%] lg:w-[45%] relative flex justify-center">
192+
<div class="w-[60%] lg:w-[30%] relative flex justify-center">
193193
<div class="relative w-full max-w-md animate-float">
194194
<!-- Main Visual Placeholder (Phone App Interface) -->
195195
<div class="bg-white dark:bg-slate-800 rounded-3xl shadow-float overflow-hidden border-8 border-white dark:border-slate-700 transform rotate-3 relative z-10 aspect-[9/16] flex items-center justify-center bg-gray-100 dark:bg-slate-900">
@@ -233,7 +233,7 @@ const prevTestimonial = () => {
233233
<section class="py-20 bg-white dark:bg-slate-900">
234234
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
235235
<div class="text-center mb-16">
236-
<h2 class="text-3xl font-bold text-neutral-dark dark:text-white mb-4">核心特色 · 重新定义出行记忆</h2>
236+
<h2 class="text-3xl font-bold text-neutral-dark dark:text-white mb-4">核心特色 · 重新定义相册记忆</h2>
237237
<div class="w-16 h-1 bg-primary mx-auto rounded-full"></div>
238238
</div>
239239

@@ -425,7 +425,7 @@ const prevTestimonial = () => {
425425
<div>
426426
<h4 class="text-lg font-bold mb-6">联系我们</h4>
427427
<ul class="space-y-3 text-sm text-white/80">
428-
<li>邮箱:sixyuan044@gmail.com</li>
428+
<li>邮箱:<a href="mailto:sixyuan044@gmail.com" class="hover:text-primary transition-colors">sixyuan044@gmail.com</a></li>
429429
<li>微信公众号:忆墨痕</li>
430430
<li class="relative group">
431431
QQ群:
@@ -440,6 +440,7 @@ const prevTestimonial = () => {
440440
<div class="absolute top-full left-4 border-8 border-transparent border-t-white"></div>
441441
</div>
442442
</li>
443+
<li>GitHub:<a href="https://github.com/LC044/TrailSnap" target="_blank" class="cursor-pointer border-b border-dashed border-white/40 hover:text-primary hover:border-primary transition-colors">LC044/TrailSnap</a></li>
443444
</ul>
444445
</div>
445446
<!-- Col 4 -->

package/official-site/docs/dev/architecture.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,32 @@ TrailSnap 采用典型的前后端分离架构,由前端展示层、后端服
66

77
```mermaid
88
flowchart TD
9-
User[用户浏览器] -->|HTTP/HTTPS| FE[前端应用 (Vue 3 + Vite)]
9+
User[👨‍💻 用户浏览器] -->|HTTP/HTTPS| FE[前端应用<br/>Vue 3 + Vite]
1010
11-
subgraph Frontend_Layer[前端展示层]
12-
FE -->|Axios / REST| API8000[后端服务 (FastAPI, :8000)]
13-
FE -->|Pinia| Store[全局状态管理]
14-
FE -->|ElementPlus| UI[UI组件库]
11+
subgraph Frontend_Layer[🖥️ 前端展示层]
12+
FE -->|📡 Axios / REST| API8000
13+
FE -->|💾 Pinia| Store[全局状态管理]
14+
FE -->|🎨 ElementPlus| UI[UI组件库]
1515
end
1616
17-
subgraph Backend_Layer[后端服务层]
18-
API8000 --> Routers[API Routers]
19-
Routers --> Services[业务服务层]
20-
Services -->|ORM| DBConn[SQLAlchemy]
21-
Services -->|文件操作| FS[文件系统]
22-
Services -->|异步任务| TM[TaskManager]
23-
TM -->|HTTP 调用| AI8001[AI 微服务 (FastAPI, :8001)]
17+
subgraph Backend_Layer[⚙️ 后端服务层]
18+
API8001[后端服务<br/>FastAPI :8000] --> Routers[API路由分发]
19+
Routers --> Services[业务逻辑服务]
20+
Services -->|🗄️ ORM映射| DBConn[SQLAlchemy]
21+
Services -->|📂 文件读写| FS[文件系统]
22+
Services -->|⏳ 异步调度| TM[任务管理器]
23+
TM -->|🔗 HTTP调用| AI8001
2424
end
2525
26-
subgraph AI_Service[AI 微服务]
27-
AI8001 --> OCR[PaddleOCR]
28-
AI8001 --> Face[InsightFace]
29-
AI8001 --> OD[对象检测]
30-
AI8001 --> Ticket[车票识别(YOLO+OCR)]
26+
subgraph AI_Service[🤖 AI 微服务层]
27+
AI8001[AI微服务<br/>FastAPI :8001] --> OCR[PaddleOCR 文字识别]
28+
AI8001 --> Face[InsightFace 人脸识别]
29+
AI8001 --> OD[目标对象检测]
30+
AI8001 --> Ticket[车票识别<br/>YOLO + OCR]
3131
end
3232
33-
subgraph Data_Layer[数据层]
34-
DBConn --> DB[(PostgreSQL)]
33+
subgraph Data_Layer[💽 数据持久层]
34+
DBConn --> DB[(PostgreSQL 数据库)]
3535
FS --> Storage[本地/挂载存储]
3636
end
3737
```

package/official-site/docs/dev/guide.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ TrailSnap/
6565
项目依赖 PostgreSQL 和 pgvector 插件。推荐使用 Docker 启动:由于文档部署限制,请直接查看项目源码中 `package/server/README.md` 文件。
6666

6767
### 4.2 安装依赖
68-
推荐使用 `uv` 进行包管理,也可以使用 `pip`
68+
推荐使用 `uv` 进行包管理。
6969

7070
```bash
7171
cd package/server
72+
# 安装 uv
73+
pip install uv
7274
# 使用 uv
7375
uv sync
74-
# 或者使用 pip
75-
pip install -r requirements.txt
7676
```
7777

7878
### 4.3 配置文件
@@ -85,8 +85,11 @@ AI_URL=http://localhost:8001
8585

8686
### 4.4 运行服务
8787
```bash
88+
# 第一次运行是需要初始化数据库
89+
python start.py
90+
8891
# 开发模式启动
89-
uvicorn app.main:app --reload --port 8000
92+
uvicorn main:app --reload --port 8000
9093
```
9194
API 文档地址:`http://localhost:8000/docs`
9295

@@ -148,3 +151,22 @@ uvicorn app.main:app --reload --port 8001
148151
- `alembic current`: 查看当前版本
149152
- `alembic history`: 查看历史版本
150153
- `alembic downgrade -1`: 回滚上一个版本
154+
155+
## 8. 打包docker镜像
156+
157+
```bash
158+
cd TrailSnap
159+
# 一键打包docker镜像
160+
docker-compose up -d --build
161+
```
162+
163+
```bash
164+
# 打包前端镜像
165+
docker build -t siyuan044/trailsnap-frontend:master -f package/website/Dockerfile .
166+
167+
# 打包后端镜像
168+
docker build -t siyuan044/trailsnap-backend:master -f package/server/Dockerfile .
169+
170+
# 打包AI镜像
171+
docker build -t siyuan044/trailsnap-ai:master -f package/ai/Dockerfile .
172+
```

package/official-site/docs/guide/install.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ TrailSnap 支持多种部署方式,推荐使用 Docker Compose 进行快速部
105105
```
106106

107107
4. **访问应用**
108+
服务启动后,通过浏览器访问: `http://localhost:8082`
108109

109-
服务启动后,通过浏览器访问:
110-
- 前端页面: `http://localhost:8082`
110+
5. **访问后端 API**
111111
- 后端 API: `http://localhost:8800/docs`
112112
- AI 服务文档: `http://localhost:8801/docs`
113113

package/official-site/docs/guide/user.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
4. [行程与票据](#4-行程与票据)
1313
5. [系统设置](#5-系统设置)
1414

15-
---
16-
1715
## 1. 快速开始
1816

1917
### 登录/注册
@@ -31,8 +29,6 @@
3129
2. 输入外部图库的地址,例如 /app/photos (注意docker挂载路径)
3230
3. 点击确认,系统会自动扫描该目录下的所有照片(任务进度可以在“设置->任务管理”中查看)。
3331

34-
---
35-
3632
## 2. 相册管理
3733

3834
### 创建相册
@@ -50,8 +46,6 @@
5046
- **地图视图**:在地图上显示照片拍摄地点,点亮你的足迹。
5147
- **详情查看**:点击照片可查看大图及详细元数据(ISO、快门、设备型号等)。
5248

53-
---
54-
5549
## 3. 智能功能
5650

5751
TrailSnap 内置了强大的 AI 服务,为您提供以下智能体验:
@@ -69,8 +63,6 @@ TrailSnap 内置了强大的 AI 服务,为您提供以下智能体验:
6963
- **一键修图**:利用 AI 算法自动调整照片色彩、曝光,提升画质。
7064
- **生成 VLOG**:选择一段旅程或一个相册,AI 会自动挑选精彩片段,配上音乐,生成短视频。
7165

72-
---
73-
7466
## 4. 行程与票据
7567

7668
这是 TrailSnap 专为旅行者设计的特色功能。
@@ -84,8 +76,6 @@ TrailSnap 内置了强大的 AI 服务,为您提供以下智能体验:
8476
- 系统会根据您的票据时间和照片时间,自动生成一条完整的“旅行时间轴”。
8577
- 您可以清晰地看到从出发到返程的完整轨迹。
8678

87-
---
88-
8979
## 5. 系统设置
9080

9181
在设置页面,您可以进行以下配置:
@@ -95,6 +85,4 @@ TrailSnap 内置了强大的 AI 服务,为您提供以下智能体验:
9585
- **存储设置**:查看存储空间使用情况。
9686
- **任务管理**:查看后台任务进度(如正在进行的 AI 识别任务、缩略图生成任务)。
9787

98-
---
99-
10088
如有任何使用问题,请联系系统管理员或查阅 [开发者文档](../dev/guide.md)

0 commit comments

Comments
 (0)