Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and Deploy to GitHub Pages

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build
env:
NODE_ENV: production

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
84 changes: 70 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

一个现代化的 Web 应用,提供类似微信的界面来查看和管理您的聊天记录。

[在线演示](#-在线演示) •
[功能特性](#-功能特性) •
[快速开始](#-快速开始) •
[技术栈](#️-技术栈) •
Expand All @@ -34,6 +35,32 @@ Chatlog Session 是一个基于 [Chatlog](https://github.com/sjzar/chatlog) API
- 🔧 **灵活配置** - 可自定义 API 地址、超时、重试等参数
- 🎯 **用户友好** - 自动初始化、智能后台加载、实时进度反馈

## 🌐 在线演示

### 体验地址

您可以直接访问在线演示版本,无需本地安装:

**🔗 https://xlight.github.io/chatlog-session/**

### 首次使用

1. 进入 **设置 → API 设定**
2. 配置您的 Chatlog API 地址
3. 点击 **测试连接** 验证
4. 返回 **联系人** 视图,点击 **后台刷新** 加载数据

### 自动部署

本项目使用 GitHub Actions 自动构建和部署:

- ✅ 推送到 main 分支自动触发部署
- ✅ 构建产物自动发布到 GitHub Pages
- ✅ 支持手动触发部署
- ✅ 每次部署约 2-3 分钟完成

详见:[GitHub Pages 部署指南](docs/deployment/github-pages.md)

## ✨ 功能特性

### 核心功能
Expand Down Expand Up @@ -81,12 +108,20 @@ Chatlog Session 是一个基于 [Chatlog](https://github.com/sjzar/chatlog) API

## 🚀 快速开始

### 前置要求
### 方式 1: 在线体验(推荐)

直接访问在线演示:https://xlight.github.io/chatlog-session/

无需安装,只需配置 API 地址即可使用。

### 方式 2: 本地部署

#### 前置要求

1. ✅ [Node.js](https://nodejs.org/) >= 16.0.0
2. ✅ [Chatlog](https://github.com/sjzar/chatlog) 已安装并运行

### 安装步骤
#### 安装步骤

```bash
# 克隆项目
Expand All @@ -102,7 +137,16 @@ npm run dev

### 配置 API

#### 方式 1: 环境变量(开发环境)
#### 方式 1: 应用内设置(推荐)

1. 启动应用后,进入 **设置 → API 设定**
2. 输入 Chatlog API 地址(如 `http://localhost:8080`)
3. 点击 **测试连接** 验证
4. 点击 **保存设置**

详见:[API 设定快速指南](docs/guides/quick-start/api-settings-quick-guide.md)

#### 方式 2: 环境变量(开发环境)

创建 `.env.local` 文件:

Expand All @@ -112,16 +156,7 @@ VITE_API_TIMEOUT=30000
VITE_ENABLE_DEBUG=true
```

#### 方式 2: 应用内设置(推荐)

1. 启动应用后,进入 **设置 → API 设定**
2. 输入 Chatlog API 地址(如 `http://localhost:8080`)
3. 点击 **测试连接** 验证
4. 点击 **保存设置**

详见:[API 设定快速指南](docs/guides/quick-start/api-settings-quick-guide.md)

### 启动 Chatlog API
#### 启动 Chatlog API

```bash
# 启动 Chatlog HTTP 服务
Expand All @@ -136,6 +171,10 @@ chatlog server --port 8080
- [后台刷新指南](docs/guides/user/background-refresh-guide.md) - 如何刷新联系人数据
- [API 设定指南](docs/guides/quick-start/api-settings-quick-guide.md) - 配置 API 连接

### 🚀 部署文档

- [GitHub Pages 部署](docs/deployment/github-pages.md) - 自动构建和发布到 GitHub Pages

### 💻 开发文档

- [开发者指南](docs/guides/developer/developer-guide.md) - 开发环境搭建
Expand Down Expand Up @@ -214,7 +253,6 @@ npm run type-check

# 代码检查和修复
npm run lint
npm run lint:fix

# 生产构建
npm run build
Expand Down Expand Up @@ -285,6 +323,24 @@ npm run preview
- ✅ 构建测试
- ✅ 至少一位维护者的审查

## 🚢 部署

### GitHub Pages

本项目已配置 GitHub Actions 自动部署到 GitHub Pages:

1. 推送代码到 `main` 分支
2. GitHub Actions 自动构建
3. 自动部署到 `https://<username>.github.io/chatlog-session/`

详见:[GitHub Pages 部署指南](docs/deployment/github-pages.md)

### 其他部署方式

- **Vercel**: 导入 GitHub 仓库即可自动部署
- **Netlify**: 拖拽 `dist` 目录或连接 Git 仓库
- **自托管**: 构建后将 `dist` 目录部署到任意静态服务器

## 📋 路线图

### v0.5.0(计划中)
Expand Down
Loading
Loading