# mtcludfroum **Repository Path**: cy3007/mtcludfroum ## Basic Information - **Project Name**: mtcludfroum - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-18 - **Last Updated**: 2026-02-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: mtcldfroum社区 ## README # RustForum **下一代 Rust 论坛系统 | Next-Generation Forum Built with Rust** - **官网 / Official Site**: [https://mtcld.cn](https://mtcld.cn) - **演示 / Live Demo**: [https://www.mtcld.cn](https://www.mtcld.cn) - **官方支持 / Live Demo**: [https://uc.mtcld.cn](https://uc.mtcld.cn) - **源码 / Source Code**: [https://gitee.com/cy3007/mtcludfroum](https://gitee.com/cy3007/mtcludfroum) RustForum 是一个使用 Rust + SvelteKit 构建的现代化论坛系统,支持插件系统、ActivityPub 联邦、AI 辅助、全文搜索等功能。 RustForum is a modern forum system built with Rust + SvelteKit, featuring a plugin system, ActivityPub federation, AI assistance, full-text search, and more. --- ## 功能特性 / Features - **高性能后端 / High-Performance Backend** — Rust + Axum 异步框架 - **现代前端 / Modern Frontend** — SvelteKit 5 + Milkdown 富文本编辑器 - **插件系统 / Plugin System** — WASM 插件热加载 - **联邦协议 / Federation** — ActivityPub 跨实例互通 - **全文搜索 / Full-Text Search** — Tantivy 搜索引擎 - **AI 集成 / AI Integration** — 自动摘要、智能标签、内容审核 - **实时通信 / Real-Time** — WebSocket 实时通知 - **OAuth & 2FA** — 第三方登录 + TOTP 两步验证 - **代码沙箱 / Code Sandbox** — Python / Node.js / Bash 在线运行 - **Docker 部署 / Docker Deploy** — 一键 Docker Compose 启动 ## 技术栈 / Tech Stack | 层级 / Layer | 技术 / Technology | |---|---| | 后端 / Backend | Rust, Axum, SQLx, Tokio | | 前端 / Frontend | SvelteKit 5, TypeScript, Milkdown | | 数据库 / Database | MySQL 8.0+ | | 搜索 / Search | Tantivy | | 插件 / Plugins | Wasmtime (WASM) | | 联邦 / Federation | ActivityPub | | AI | ONNX Runtime (ort) | ## 项目结构 / Project Structure ``` rustforum/ ├── crates/ │ ├── api/ # HTTP API 服务 (Axum) │ ├── core/ # 核心配置与共享类型 │ ├── db/ # 数据库操作 (SQLx + MySQL) │ ├── search/ # 全文搜索 (Tantivy) │ ├── ai/ # AI 功能 (ONNX Runtime) │ ├── plugin-host/ # WASM 插件宿主 │ ├── federation/ # ActivityPub 联邦 │ ├── realtime/ # WebSocket 实时通信 │ └── registry/ # 插件市场注册中心 ├── frontend/ # SvelteKit 前端 ├── migrations/ # SQL 数据库迁移 ├── plugins/ # WASM 插件 ├── config/ # 配置文件 ├── deploy/ # 部署脚本 (systemd, nginx) ├── docker/ # Docker 相关文件 └── ext_api.py # Python 扩展 API (代码沙箱) ``` ## 快速开始 / Quick Start ### 环境要求 / Requirements - Rust 1.93+ (with `cargo`) - Node.js 20+ - MySQL 8.0+ - Python 3.10+ (可选,用于扩展 API / optional, for extended API) ### 方式一:本地开发 / Local Development ```bash # 克隆仓库 / Clone git clone https://gitee.com/cy3007/mtcludfroum.git cd mtcludfroum # 启动 (自动编译 + 安装向导) / Start (auto build + install wizard) ./start.sh # 或手动构建 / Or build manually cargo build --bin rustforum cd frontend && npm install && npm run build && cd .. ./target/debug/rustforum ``` 打开浏览器访问 `http://localhost:5000`,首次运行会自动进入安装向导。 Open browser at `http://localhost:5000`. The install wizard will launch on first run. ### 方式二:Docker 部署 / Docker Deployment ```bash cd docker # 建议修改 docker-compose.yml 中的数据库和 Redis 凭据 # Edit credentials in docker-compose.yml before starting docker compose up -d ``` 访问 `http://localhost:5000` 进入安装向导。 Visit `http://localhost:5000` to enter the install wizard. ### 方式三:宝塔面板部署 / BT Panel Deployment 适合国内服务器,支持一键部署: ```bash # 1. 在宝塔面板创建站点 # 2. 上传代码到站点目录,或用 git clone cd /www/wwwroot/your-site # 3. 编译 cargo build --release --bin rustforum cd frontend && npm install && npm run build && cd .. # 4. 运行部署脚本 bash deploy/setup.sh ``` 部署脚本会自动:配置 systemd 服务、设为开机自启、启动服务。 访问你的域名即可进入安装向导,向导会自动配置 Nginx。 ## 配置说明 / Configuration 配置文件模板: `config/config.example.toml` 详见 `config/config.example.toml`,主要配置项包括: - `[server]` — 端口、域名 - `[database]` — MySQL 连接地址 - `[auth]` — JWT、注册开关、2FA - `[search]` — 搜索索引路径 - `[ai]` — AI 功能开关 - `[federation]` — 联邦功能开关 - `[storage]` — 上传目录和文件大小限制 安装向导会自动生成 `config/config.toml`,一般无需手动配置。 The install wizard will auto-generate `config/config.toml`. Manual configuration is usually not needed. ## 常用命令 / Useful Commands ```bash # 查看服务状态 / Check status systemctl status rustforum # 重启服务 / Restart systemctl restart rustforum # 查看日志 / View logs tail -f data/rustforum.log # 构建发布版本 / Build release cargo build --release --bin rustforum # 前端开发模式 / Frontend dev mode cd frontend && npm run dev ``` ## 打包发布 / Build Release Package ```bash # 生成部署压缩包 bash build-release.sh v1.1.0 ``` 会生成 `rustforum-v1.1.0-linux-amd64.tar.gz`,上传到服务器解压后运行 `deploy/setup.sh` 即可。 ## 许可证 / License MIT OR Apache-2.0