|
---
|
|
title: PPTist Huggingface
|
|
emoji: 📊
|
|
colorFrom: blue
|
|
colorTo: purple
|
|
sdk: docker
|
|
pinned: false
|
|
license: agpl-3.0
|
|
app_port: 7860
|
|
tags:
|
|
- presentation
|
|
- ppt
|
|
- powerpoint
|
|
- slides
|
|
- editor
|
|
---
|
|
|
|
# PPTist Huggingface Space
|
|
|
|
一个基于 PPTist 的在线演示文稿编辑器,部署在 Huggingface Space 上,支持多用户登录和 GitHub 数据存储。
|
|
|
|
## 🎯 项目特点
|
|
|
|
- **多用户支持**: 内置4个测试账号(PS01-PS04)
|
|
- **GitHub存储**: 使用GitHub仓库作为数据存储后端
|
|
- **公网分享**: 每个PPT页面都有独立的公网URL
|
|
- **完整功能**: 保留PPTist的所有编辑和展示功能
|
|
- **Docker部署**: 一键部署到Huggingface Space
|
|
|
|
## 🔑 测试账号
|
|
|
|
| 用户名 | 密码 | 角色 |
|
|
|--------|------|------|
|
|
| PS01 | admin_cybercity2025 | 管理员 |
|
|
| PS02 | cybercity2025 | 用户 |
|
|
| PS03 | cybercity2025 | 用户 |
|
|
| PS04 | cybercity2025 | 用户 |
|
|
|
|
## 🚀 部署说明
|
|
|
|
### 环境变量配置
|
|
|
|
在 Huggingface Space 的 Settings 中设置以下环境变量:
|
|
|
|
```bash
|
|
GITHUB_TOKEN=你的GitHub访问令牌
|
|
GITHUB_REPOS=https://github.com/CaPaCaptain/PPTist_huggingface_db
|
|
JWT_SECRET=pptist-secret-key-2025-huggingface
|
|
NODE_ENV=production
|
|
```
|
|
|
|
### GitHub 仓库设置
|
|
|
|
1. 创建一个 GitHub 仓库用于存储 PPT 数据
|
|
2. 生成 GitHub Personal Access Token,需要 `repo` 权限
|
|
3. 在仓库中创建 `users/` 目录结构
|
|
|
|
### 数据存储结构
|
|
|
|
```
|
|
仓库根目录/
|
|
├── users/
|
|
│ ├── PS01/
|
|
│ │ ├── ppt1.json
|
|
│ │ └── ppt2.json
|
|
│ ├── PS02/
|
|
│ │ └── presentation.json
|
|
│ └── ...
|
|
```
|
|
|
|
## 📡 API 接口
|
|
|
|
### 认证接口
|
|
- `POST /api/auth/login` - 用户登录
|
|
- `GET /api/auth/verify` - 验证token
|
|
- `GET /api/auth/user` - 获取用户信息
|
|
|
|
### PPT管理接口
|
|
- `GET /api/ppt/list` - 获取PPT列表
|
|
- `GET /api/ppt/:pptId` - 获取PPT数据
|
|
- `POST /api/ppt/save` - 保存PPT
|
|
- `POST /api/ppt/create` - 创建新PPT
|
|
- `DELETE /api/ppt/:pptId` - 删除PPT
|
|
- `POST /api/ppt/:pptId/copy` - 复制PPT
|
|
|
|
### 公共分享接口
|
|
- `GET /api/public/view/:userId/:pptId/:slideIndex` - 公开访问单页
|
|
- `GET /api/public/ppt/:userId/:pptId` - 公开访问完整PPT
|
|
- `POST /api/public/generate-share-link` - 生成分享链接
|
|
|
|
## 🔧 本地开发
|
|
|
|
1. 克隆项目:
|
|
```bash
|
|
git clone <repository-url>
|
|
cd PPtist-Huggingface
|
|
```
|
|
|
|
2. 安装依赖:
|
|
```bash
|
|
# 后端
|
|
cd backend
|
|
npm install
|
|
|
|
# 前端
|
|
cd ../frontend
|
|
npm install
|
|
```
|
|
|
|
3. 配置环境变量:
|
|
```bash
|
|
cp backend/.env.example backend/.env
|
|
# 编辑 .env 文件,填入你的配置
|
|
```
|
|
|
|
4. 启动开发服务器:
|
|
```bash
|
|
# 启动后端 (端口 7860)
|
|
cd backend
|
|
npm run dev
|
|
|
|
# 启动前端 (端口 5173)
|
|
cd frontend
|
|
npm run dev
|
|
```
|
|
|
|
## 🏗️ 系统架构
|
|
|
|
```
|
|
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
│ 前端 Vue3 │ │ 后端 Express │ │ GitHub 仓库 │
|
|
│ PPTist UI │────│ JWT认证 │────│ JSON数据存储 │
|
|
│ Vite构建 │ │ RESTful API │ │ 版本控制 │
|
|
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
```
|
|
|
|
## 🌐 公网分享功能
|
|
|
|
每个PPT页面都可以生成公网访问链接:
|
|
|
|
- **单页链接**: `https://your-space.hf.space/api/public/view/PS01/ppt-id/0`
|
|
- **完整PPT**: `https://your-space.hf.space/api/public/ppt/PS01/ppt-id`
|
|
- **前端查看**: `https://your-space.hf.space/public/PS01/ppt-id/0`
|
|
|
|
## 📝 许可证
|
|
|
|
本项目基于 AGPL-3.0 许可证开源。 |