Files
flypic/README.md
T
2025-12-01 10:15:32 +08:00

110 lines
2.6 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.
# FlyPic
一个轻量、快速、稳定的图片检索浏览应用,专为飞牛 fnOS 设计。
## 核心特性
- 🚀 **高性能**: 支持 10万-100万 级别图片浏览
- 🎨 **Eagle 风格瀑布流**: 固定高度,宽度自适应,视觉整齐
- 🔍 **智能搜索**: 多关键词组合搜索,快速定位
## 🛠️ 技术栈
- **前端**:React + Vite + TailwindCSS + react-photo-view + zustand
- **后端**:Node.js + Express + Sharp + better-sqlite3 + Socket.IO
- **部署**:飞牛 fnOS
## 🚀 快速开始
### 开发环境
```bash
# 安装依赖
npm install
# 启动前端开发服务器(推荐)
npm run dev:frontend
# 访问 http://localhost:5173
# 启动后端开发服务器
npm run dev:backend
# API 运行在 http://localhost:5002
```
### 构建部署
```bash
# 方法一:使用 Docker 构建(推荐)
# 包含 Linux 版本的依赖,上传后直接可用
npm run build:fpk:docker
# 方法二:普通构建
# 需要在飞牛上手动安装依赖
npm run build:fpk
# 本地测试 Linux 版本
npm run test:docker
```
## 📦 部署到飞牛 fnOS
详细步骤请查看:**[飞牛打包部署指南](./飞牛打包部署指南.md)**
### 快速部署
1. **构建**:`npm run build:fpk:docker`
2. **上传**:将 `flypic/` 目录上传到飞牛
3. **打包**:`fnpack build`
4. **安装**:`appcenter-cli install-fpk flypic.fpk`
5. **访问**:`http://你的飞牛IP:5002`
## 📁 项目结构
```
FlyPic/
├── frontend/ # React 前端
├── backend/ # Node.js 后端
├── flypic/ # 飞牛打包目录(构建生成)
├── scripts/ # 构建脚本
│ ├── build-fpk.js # 普通构建
│ ├── build-fpk-docker.js # Docker 构建
│ └── test-in-docker.js # Docker 测试
├── dev.bat # Windows 开发启动脚本
├── start.bat # Windows 生产启动脚本
└── 飞牛打包部署指南.md # 完整部署文档
```
## 🎯 支持的图片格式
jpg, jpeg, png, webp, gif, bmp, tiff
## 📝 开发说明
### 数据存储
```
素材库目录/
├── 用户图片文件...
└── .flypic/
├── thumbnails/200/ # WebP 缩略图
├── metadata.db # SQLite 数据库
└── config.json # 配置文件
```
### 端口配置
- 前端开发:5173
- 后端服务:5002
## 🐛 故障排查
常见问题请查看 [飞牛打包部署指南 - 故障排查](./飞牛打包部署指南.md#故障排查)
## 📄 License
MIT License - 详见 [LICENSE](./LICENSE) 文件
---
**最后更新**:2025-11-29