Files
urldb/README.md
2025-08-12 09:12:15 +08:00

274 lines
7.3 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.
# 🚀 urlDB - 老九网盘资源数据库
<div align="center">
![Go Version](https://img.shields.io/badge/Go-1230?logo=go&logoColor=white)
![Vue Version](https://img.shields.io/badge/Vue-334FC08D?logo=vue.js&logoColor=white)
![Nuxt Version](https://img.shields.io/badge/Nuxt-300.8+-00DC82?logo=nuxt.js&logoColor=white)
![License](https://img.shields.io/badge/License-GPL%20v3-blue.svg)
![PostgreSQL](https://img.shields.io/badge/PostgreSQL-15+-336791go=postgresql&logoColor=white)
**一个现代化的网盘资源数据库,支持多网盘自动化转存分享,支持百度网盘,阿里云盘,夸克网盘, 天翼云盘迅雷云盘123云盘115网盘UC网盘 **
🌐 [在线演示](https://pan.l9.lc) | 📖 [文档](https://ecn5khs4t956.feishu.cn/wiki/PsnDwtxghiP0mLkTiruczKtxnwd?from=from_copylink) | 🐛 [问题反馈](https://github.com/ctwj/urldb/issues) | ⭐ [给个星标](https://github.com/ctwj/urldb)
### 支持的网盘平台
| 平台 | 录入 | 转存 | 分享 |
|------|-------|-----|------|
| 百度网盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 |
| 阿里云盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 |
| 夸克网盘 | ✅ 支持 | ✅ 支持 | ✅ 支持 |
| 天翼云盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 |
| 迅雷云盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 |
| UC网盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 |
| 123云盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 |
| 115网盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 |
</div>
---
## 🔔 温馨提示
- [文档说明](https://ecn5khs4t956.feishu.cn/wiki/PsnDwtxghiP0mLkTiruczKtxnwd?from=from_copylink)
- [服务器要求](https://ecn5khs4t956.feishu.cn/wiki/W8YBww1Mmiu4Cdkp5W4c8pFNnMf?from=from_copylink)
- [QQ机器人](https://github.com/ctwj/astrbot_plugin_urldb)
---
## 📸 项目截图
### 🏠 首页
![首页](https://raw.githubusercontent.com/ctwj/urldb/refs/heads/main/github/index.webp)
### 🔧 后台管理
![后台管理](https://raw.githubusercontent.com/ctwj/urldb/refs/heads/main/github/admin.webp)
### ⚙️ 系统配置
![系统配置](https://raw.githubusercontent.com/ctwj/urldb/refs/heads/main/github/config.webp)
### 🔍 批量转存
![资源搜索](https://raw.githubusercontent.com/ctwj/urldb/refs/heads/main/github/save.webp)
### 👤 多账号管理
![账号管理](https://raw.githubusercontent.com/ctwj/urldb/refs/heads/main/github/account.webp)
---
## ✨ 功能特性
### 🎯 核心功能
- **📁 多平台网盘支持** - 支持夸克网盘、阿里云盘、百度网盘、UC网盘
- **🔍 公开API** - 支持API数据录入资源搜索
- **🏷️ 自动预处理** - 系统自动处理资源, 对数据进行有效性判断
- **📊 自动转存分享** - 有效资源,如果属于支持类型将自动转存分享
- **📱 多账号管理** - 同平台支持多账号管理
## 🏗️ 技术架构
### 后端技术栈
- **🦀 Golang 10.23+** - 高性能后端语言
- **🌿 Gin** - 轻量级Web框架
- **🗄️ PostgreSQL** - 关系型数据库
- **🔧 GORM** - ORM框架
- **🔐 JWT** - 身份认证
### 前端技术栈
- **⚡ Nuxt.js 3** - Vue.js全栈框架
- **🎨 Vue 3** - 渐进式JavaScript框架
- **📝 TypeScript** - 类型安全的JavaScript
- **🎨 Tailwind CSS** - 实用优先的CSS框架
- **🔧 Pinia** - 状态管理
---
## 🚀 快速开始
### 环境要求
- **Docker** 和 **Docker Compose**
- 或者本地环境:
- **Go** 1.23+
- **Node.js** 18+
- **PostgreSQL** 15+
- **pnpm** (推荐) 或 npm
### 方式一Docker 部署(推荐)
```bash
# 克隆项目
git clone https://github.com/ctwj/urldb.git
cd urldb
# 使用 Docker Compose 启动
docker compose up --build -d
# 访问应用
# 前端: http://localhost:3030
# 后端API: http://localhost:8080
```
### 方式二:本地开发
#### 1. 克隆项目
```bash
git clone https://github.com/ctwj/urldb.git
cd urldb
```
#### 2. 后端设置
```bash
# 复制环境变量文件
cp env.example .env
# 编辑环境变量
vim .env
# 安装Go依赖
go mod tidy
# 启动后端服务
go run main.go
```
#### 3. 前端设置
```bash
# 进入前端目录
cd web
# 安装依赖
pnpm install
# 启动开发服务器
pnpm dev
```
#### 4. 数据库设置
```sql
-- 创建数据库
CREATE DATABASE url_db;
```
---
## 📁 项目结构
```
l9pan/
├── 📁 common/ # 通用功能模块
│ ├── 📄 pan_factory.go # 网盘工厂模式
│ ├── 📄 alipan.go # 阿里云盘实现
│ ├── 📄 baidu_pan.go # 百度网盘实现
│ ├── 📄 quark_pan.go # 夸克网盘实现
│ └── 📄 uc_pan.go # UC网盘实现
├── 📁 db/ # 数据库层
│ ├── 📁 entity/ # 数据实体
│ ├── 📁 repo/ # 数据仓库
│ ├── 📁 dto/ # 数据传输对象
│ └── 📁 converter/ # 数据转换器
├── 📁 handlers/ # API处理器
├── 📁 middleware/ # 中间件
├── 📁 utils/ # 工具函数
├── 📁 web/ # 前端项目
│ ├── 📁 pages/ # 页面组件
│ ├── 📁 components/ # 通用组件
│ ├── 📁 composables/ # 组合式函数
│ └── 📁 stores/ # 状态管理
├── 📁 docs/ # 项目文档
├── 📁 nginx/ # Nginx配置
│ ├── 📄 nginx.conf # 主配置文件
│ └── 📁 conf.d/ # 站点配置
├── 📄 main.go # 主程序入口
├── 📄 Dockerfile # Docker配置
├── 📄 docker-compose.yml # Docker Compose配置
├── 📄 docker-start-nginx.sh # Nginx启动脚本
└── 📄 README.md # 项目说明
```
---
## 🔧 配置说明
### 环境变量配置
```bash
# 数据库配置
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=your_password
DB_NAME=url_db
# 服务器配置
PORT=8080
# 时区配置
TIMEZONE=Asia/Shanghai
```
### Docker 服务说明
| 服务 | 端口 | 说明 |
|------|------|------|
| server | 3030 | 应用 |
| postgres | 5431 | PostgreSQL 数据库 |
### 镜像构建
```
docker build -t ctwj/urldb-frontend:1.0.7 --target frontend .
docker build -t ctwj/urldb-backend:1.0.7 --target backend .
docker push ctwj/urldb-frontend:1.0.7
docker push ctwj/urldb-backend:1.0.7
```
---
## 📚 API 文档
### 公开统计
提供批量入库和搜索api通过 apiToken 授权
> 📖 完整API文档请访问`http://doc.l9.lc/`
## 🤝 贡献指南
我们欢迎所有形式的贡献!
## 📄 许可证
本项目采用 [GPL License](LICENSE) 许可证。
---
## 🙏 致谢
感谢以下开源项目的支持:
- [Gin](https://github.com/gin-gonic/gin) - Go Web框架
- [Nuxt.js](https://nuxt.com/) - Vue.js全栈框架
- [Tailwind CSS](https://tailwindcss.com/) - CSS框架
- [GORM](https://gorm.io/) - Go ORM库
---
## 📞 联系我们
- **项目地址**: [https://github.com/ctwj/urldb](https://github.com/ctwj/urldb)
- **问题反馈**: [Issues](https://github.com/ctwj/urldb/issues)
- **邮箱**: 510199617@qq.com
---
<div align="center">
**如果这个项目对您有帮助,请给我们一个 ⭐ Star**
Made with ❤️ by [老九]
</div>