Przeglądaj źródła

Enhance README.md with improved project description and configuration details

- Updated project description to highlight key features.
- Added technology stack badges for better visibility.
- Revised database configuration section with detailed options and default values.
- Clarified instructions for setting up the environment file.
Ethanfly 20 godzin temu
rodzic
commit
f81a8c415b
2 zmienionych plików z 135 dodań i 3 usunięć
  1. 26 3
      README.md
  2. 109 0
      server/env.example

+ 26 - 3
README.md

@@ -1,11 +1,20 @@
 # 多平台媒体管理系统
 
 <p align="center">
-  <img src="client/public/favicon.svg" width="128" height="128" alt="Logo">
+  <img src="./client/public/favicon.svg" width="128" height="128" alt="Logo">
 </p>
 
 <p align="center">
-  一个功能强大的多自媒体平台账号管理系统,支持视频自动发布、评论统一管理、数据分析等功能。
+  <b>一个功能强大的多自媒体平台账号管理系统</b><br>
+  支持视频自动发布、评论统一管理、数据分析等功能
+</p>
+
+<p align="center">
+  <img src="https://img.shields.io/badge/Electron-28+-47848F?style=flat-square&logo=electron&logoColor=white" alt="Electron">
+  <img src="https://img.shields.io/badge/Vue-3.4+-4FC08D?style=flat-square&logo=vue.js&logoColor=white" alt="Vue">
+  <img src="https://img.shields.io/badge/TypeScript-5+-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript">
+  <img src="https://img.shields.io/badge/Node.js-20+-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node.js">
+  <img src="https://img.shields.io/badge/MySQL-8.0+-4479A1?style=flat-square&logo=mysql&logoColor=white" alt="MySQL">
 </p>
 
 ## ✨ 功能特性
@@ -136,10 +145,24 @@ mysql -u root -p media_manager < database/schema.sql
 
 ```bash
 cd server
-cp .env.example .env
+cp env.example .env
 # 编辑 .env 文件,填入数据库配置
 ```
 
+主要配置项:
+
+| 配置项 | 说明 | 默认值 |
+|--------|------|--------|
+| `DB_HOST` | MySQL 主机 | localhost |
+| `DB_PORT` | MySQL 端口 | 3306 |
+| `DB_USERNAME` | 数据库用户名 | root |
+| `DB_PASSWORD` | 数据库密码 | - |
+| `DB_DATABASE` | 数据库名称 | media_manager |
+| `JWT_SECRET` | JWT 密钥 | - |
+| `PORT` | 服务端口 | 3000 |
+
+详细配置说明请参考 `server/env.example` 文件。
+
 ### 启动开发服务
 
 ```bash

+ 109 - 0
server/env.example

@@ -0,0 +1,109 @@
+# ========================================
+# 多平台媒体管理系统 - 服务端配置
+# ========================================
+# 复制此文件为 .env 并填入实际配置值
+# cp env.example .env (或 copy env.example .env)
+
+# ----------------------------------------
+# 基础配置
+# ----------------------------------------
+# 运行环境: development | production | test
+NODE_ENV=development
+
+# 服务端口
+PORT=3000
+
+# ----------------------------------------
+# 数据库配置 (MySQL)
+# ----------------------------------------
+# 数据库主机地址
+DB_HOST=localhost
+
+# 数据库端口
+DB_PORT=3306
+
+# 数据库用户名
+DB_USERNAME=root
+
+# 数据库密码
+DB_PASSWORD=your_mysql_password
+
+# 数据库名称
+DB_DATABASE=media_manager
+
+# ----------------------------------------
+# Redis 配置 (可选,用于缓存)
+# ----------------------------------------
+# Redis 主机地址
+REDIS_HOST=localhost
+
+# Redis 端口
+REDIS_PORT=6379
+
+# Redis 密码 (无密码留空)
+REDIS_PASSWORD=
+
+# Redis 数据库编号 (0-15)
+REDIS_DB=0
+
+# ----------------------------------------
+# JWT 认证配置
+# ----------------------------------------
+# JWT 密钥 (生产环境请使用强随机字符串)
+JWT_SECRET=your-super-secret-key-change-in-production
+
+# Access Token 过期时间
+JWT_ACCESS_EXPIRES_IN=15m
+
+# Refresh Token 过期时间
+JWT_REFRESH_EXPIRES_IN=7d
+
+# ----------------------------------------
+# CORS 跨域配置
+# ----------------------------------------
+# 允许的来源 (多个用逗号分隔)
+CORS_ORIGIN=http://localhost:5173
+
+# ----------------------------------------
+# 文件上传配置
+# ----------------------------------------
+# 上传文件存储路径 (相对于 server 目录)
+UPLOAD_PATH=./uploads
+
+# 最大视频文件大小 (MB)
+MAX_VIDEO_SIZE=4096
+
+# 最大图片文件大小 (MB)
+MAX_IMAGE_SIZE=10
+
+# ----------------------------------------
+# 加密配置
+# ----------------------------------------
+# 数据加密密钥 (必须是 32 个字符)
+ENCRYPTION_KEY=your-encryption-key-32-chars-long!
+
+# ----------------------------------------
+# AI 配置 (可选,用于智能功能)
+# ----------------------------------------
+# OpenAI API Key
+OPENAI_API_KEY=
+
+# OpenAI API Base URL (可用于自定义 API 端点)
+OPENAI_BASE_URL=https://api.openai.com/v1
+
+# ========================================
+# 示例配置值说明
+# ========================================
+#
+# JWT_SECRET 生成方法:
+#   node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
+#
+# ENCRYPTION_KEY 生成方法:
+#   node -e "console.log(require('crypto').randomBytes(16).toString('hex'))"
+#
+# 生产环境建议:
+#   - 使用强密码
+#   - 启用 HTTPS
+#   - 配置防火墙规则
+#   - 定期备份数据库
+#