Files
PerToolBoxServer/README.md
2026-04-02 01:19:24 +08:00

156 lines
2.5 KiB
Markdown
Raw Permalink 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.
# PerToolBox Server - 后端服务
> 基于 FastAPI 的个人工具箱后端 API
---
## 📋 项目信息
- 项目名称PerToolBox Server
- 项目类型RESTful API 服务
- 版权所有Sea Network Technology Studio
- 权利人Canglan
- 开源协议AGPL v3
- 联系方式admin@sea-studio.top
---
## ✨ 功能模块
### 🔐 用户系统
- 手机验证码登录
- 邮箱验证码登录
### 📝 数据功能
- 待办事项管理
- 便签本
### 🧰 工具模块
- 密码生成器
- 二维码生成
- 加密工具箱Hash / Base64 / URL / AES
- JSON 校验与格式化
### 📊 统计模块
- 接口访问热度统计
---
## 🏗️ 系统架构
```text
Client (Web / Mobile)
Nginx
FastAPI
┌───────┴────────┐
▼ ▼
MySQL Redis
(数据存储) (缓存/验证码)
```
---
## 🛠️ 技术栈
| 技术 | 版本 |
|------|------|
| Python | 3.12+ |
| FastAPI | 0.104+ |
| MySQL | 5.7+ |
| Redis | 7.x+ |
---
## ⚙️ 环境变量
复制并修改:
```bash
cp .env.example .env
```
示例:
- DATABASE_URL=mysql://user:password@host:port/db
- REDIS_URL=redis://host:port/0
- SECRET_KEY=your-secret-key
- CORS_ORIGINS=*
---
## 🚀 快速开始
### 1. 获取代码
```bash
git clone https://hz-gitea.sea-studio.top/Sea-Studio/PerToolBoxServer.git
cd PerToolBoxServer
```
### 2. 创建环境
```bash
python3.12 -m venv venv
source venv/bin/activate
```
### 3. 安装依赖
```bash
pip install -r requirements.txt
```
### 4. 初始化数据库
```bash
mysql -u root -p < scripts/init_db.sql
```
### 5. 启动服务
```bash
uvicorn backend.main:app --host 0.0.0.0 --port 9999 --reload
```
---
## 🌐 反向代理Nginx
```nginx
location /api/ {
proxy_pass http://127.0.0.1:9999/api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
```
---
## 📚 API 文档
启动后访问:
- http://your-server:9999/docs
- http://your-server:9999/redoc
---
## 📁 项目结构
PerToolBoxServer/
├── backend/ # 核心代码
├── scripts/ # 数据库脚本
├── requirements.txt
└── .env.example
---
## 📞 联系方式
- Githttps://hz-gitea.sea-studio.top/Sea-Studio/PerToolBoxServer
- 邮箱admin@sea-studio.top