diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..2c487a985d1b71ace769c5b7b9fc0e9a19dcb314 --- /dev/null +++ b/README.en.md @@ -0,0 +1,117 @@ +# Chat System + +A complete chat system built on Qt, C++, and Node.js, including a frontend desktop client, gateway server, and verification code service. + +## Project Architecture + +``` +chat/ +├── Front_end_qt/ # Qt Frontend Desktop Client +├── GateServer/ # C++ Gateway Server (Boost.Asio) +└── VerifyServer/ # Node.js Verification Code Service +``` + +## Tech Stack + +### Frontend (Front_end_qt) +- **Qt5** - Cross-platform GUI Framework +- **QNetwork** - HTTP Network Requests + +### Gateway Server (GateServer) +- **C++17** - Server Core Logic +- **Boost.Asio** - Asynchronous I/O Handling +- **gRPC** - Internal Service Communication +- **Protobuf** - Data Serialization + +### Verification Code Service (VerifyServer) +- **Node.js** - JavaScript Runtime +- **gRPC** - RPC Communication Framework +- **nodemailer** - Email Sending +- **Redis** - Verification Code Cache + +## Features + +- User Registration and Login +- Email Verification Code Validation +- HTTP API Gateway +- Connection Pool Management +- Asynchronous Request Handling + +## Build and Run + +### Frontend Qt Client + +```bash +# Open project using Qt Creator +cd Front_end_qt +# Open Front_end_qt.pro file +# Build and Run +``` + +### Gateway Server + +Install the following dependencies: +- Boost.Asio +- gRPC +- Protobuf + +```bash +cd GateServer +# Compile using Visual Studio or CMake +# Run the generated executable +``` + +### Verification Code Service + +```bash +cd VerifyServer +npm install +node server.js +``` + +## Configuration Instructions + +### VerifyServer Configuration (config.js) + +```javascript +{ + email_user: "your_email@example.com", + email_pass: "your_email_password", + mysql_host: "localhost", + mysql_port: 3306, + redis_host: "localhost", + redis_port: 6379, + code_prefix: "verify_code:" +} +``` + +## Project Structure Explanation + +### Front_end_qt +| File | Description | +|------|------| +| `logindialog.cpp/h` | Login Dialog | +| `registerdialog.cpp/h` | Register Dialog | +| `mainwindow.cpp/h` | Main Window | +| `httpmgr.cpp/h` | HTTP Request Management | +| `global.cpp/h` | Global Functions and Variables | + +### GateServer +| File | Description | +|------|------| +| `CServer.cpp/h` | TCP Server | +| `HttpConnection.cpp/h` | HTTP Connection Handling | +| `LogicSystem.cpp/h` | Business Logic Routing | +| `VerifyGrpcClient.cpp/h` | Verification Code Service gRPC Client | +| `ConfigMgr.cpp/h` | Configuration Management | + +### VerifyServer +| File | Description | +|------|------| +| `server.js` | gRPC Server | +| `email.js` | Email Sending Module | +| `config.js` | Configuration File | + +## License + +MIT License \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bd4ca19bdf3d72ee6b8119203e8b727d77e42a42 --- /dev/null +++ b/README.md @@ -0,0 +1,117 @@ +# Chat 聊天系统 + +一个基于 Qt、C++ 和 Node.js 构建的完整聊天系统,包含前端桌面客户端、网关服务器和验证码服务。 + +## 项目架构 + +``` +chat/ +├── Front_end_qt/ # Qt 前端桌面客户端 +├── GateServer/ # C++ 网关服务器 (Boost.Asio) +└── VerifyServer/ # Node.js 验证码服务 +``` + +## 技术栈 + +### 前端 (Front_end_qt) +- **Qt5** - 跨平台 GUI 框架 +- **QNetwork** - HTTP 网络请求 + +### 网关服务器 (GateServer) +- **C++17** - 服务端核心逻辑 +- **Boost.Asio** - 异步 I/O 处理 +- **gRPC** - 内部服务通信 +- **Protobuf** - 数据序列化 + +### 验证码服务 (VerifyServer) +- **Node.js** - JavaScript 运行时 +- **gRPC** - RPC 通信框架 +- **nodemailer** - 邮件发送 +- **Redis** - 验证码缓存 + +## 功能特性 + +- 用户注册与登录 +- 邮箱验证码验证 +- HTTP API 网关 +- 连接池管理 +- 异步请求处理 + +## 编译与运行 + +### 前端 Qt 客户端 + +```bash +# 使用 Qt Creator 打开项目 +cd Front_end_qt +# 打开 Front_end_qt.pro 文件 +# 编译并运行 +``` + +### 网关服务器 + +需要安装以下依赖: +- Boost.Asio +- gRPC +- Protobuf + +```bash +cd GateServer +# 使用 Visual Studio 或 CMake 编译 +# 运行生成的可执行文件 +``` + +### 验证码服务 + +```bash +cd VerifyServer +npm install +node server.js +``` + +## 配置说明 + +### VerifyServer 配置 (config.js) + +```javascript +{ + email_user: "your_email@example.com", + email_pass: "your_email_password", + mysql_host: "localhost", + mysql_port: 3306, + redis_host: "localhost", + redis_port: 6379, + code_prefix: "verify_code:" +} +``` + +## 项目结构说明 + +### Front_end_qt +| 文件 | 说明 | +|------|------| +| `logindialog.cpp/h` | 登录对话框 | +| `registerdialog.cpp/h` | 注册对话框 | +| `mainwindow.cpp/h` | 主窗口 | +| `httpmgr.cpp/h` | HTTP 请求管理 | +| `global.cpp/h` | 全局函数和变量 | + +### GateServer +| 文件 | 说明 | +|------|------| +| `CServer.cpp/h` | TCP 服务器 | +| `HttpConnection.cpp/h` | HTTP 连接处理 | +| `LogicSystem.cpp/h` | 业务逻辑路由 | +| `VerifyGrpcClient.cpp/h` | 验证码服务 gRPC 客户端 | +| `ConfigMgr.cpp/h` | 配置管理 | + +### VerifyServer +| 文件 | 说明 | +|------|------| +| `server.js` | gRPC 服务端 | +| `email.js` | 邮件发送模块 | +| `config.js` | 配置文件 | + +## 许可证 + +MIT License \ No newline at end of file