# rust-ruoyi **Repository Path**: witgg2001/rust-ruoyi ## Basic Information - **Project Name**: rust-ruoyi - **Description**: rust 项目。基于 rust actix-web rbatis tokio redis。数据库为postgresql - **Primary Language**: Rust - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 62 - **Forks**: 35 - **Created**: 2024-10-17 - **Last Updated**: 2025-12-09 ## Categories & Tags **Categories**: backend **Tags**: RuoYi-Vue-Plus, ruoyi, actix-web ## README # rust-ruoyi 基于rust actix-web vue3的基础开发框架 **QQ交流群:694734955** ## 选择rust的原因: - 有性能提升的需求 - rust语法相对友好 - 对于内存 cpu、并发有较高要求 - 学习研究,毕竟rust受到微软、linux等组织的力推 ## 介绍 - rust作为新的流行语言,相对java springboot环境在cpu、内存资源占用、运行效率方面有巨大优势。 - 项目目标是更新rust、rbatis、rust-crypto等组件 在新环境运行正常。具备一定的生产运行能力 - 更新rust及相关组件,进行部分修改适配postgresql - 实现了代码生成 - 进行了ruoyi的用户管理,菜单权限,系统监控、文件上传示例、websocket通讯示例等 rust 项目。基于 rust actix-web rbatis tokio redis。数据库为postgresql ## 框架性能测试 [https://blog.csdn.net/shandongjiushen/article/details/149068799](http://) | 框架 | 持续稳定 RPS | RPS 峰值内存占用 |99% 分位数延迟 | |:-------- | -----: | -----: | :----: | | Rust (Actix-Web) | 110,000 | 250 MB |7 ms | | Go (Gin) | 105,000 | 190 MB |10 ms | | Java (Spring Boot) | 40,000 | 1.4 GB |50 ms | ## 软件架构 rust actix-web rbatis (:cold_sweat: 升级了方法还会变, 2025-8-4跟随升级调用方法) ## 安装教程 ### 数据库 postgresql 数据库 data/postgresql.conf的修改 postgresql数据库测试的有 13 至 16版本,需要设置 lc_messages ``` lc_messages = 'en_US.UTF-8' ``` 改完配置后需要重启数据库服务 ### 代码运行 vscode windows 运行 首先在 PowerShell 下设置环境变量 ```powershell $env:RUST_BACKTRACE=1 $env:profile= "dev" ``` ```bash cargo run --bin ruoyi_rust_dev ``` ```powershell $env:RUST_BACKTRACE=1 $env:profile= "prod" ``` ```bash cargo run --bin ruoyi_rust_prod ``` redis 和 postgresql 连接串检查好, 这两个连不上会报错 STACKOVERFLOW 什么errcode 。 后面会增加,连接检查 ### 代码生成 - codegen 下可以运行目前框架的代码生成 - 首先需要建立数据库表,如建立mall模块的 oms_order订单表 - 在codegen/src/main.rs 中写好模块名,表名,代码输出路径 - 运行cargo build 或者直接运行 cargo run ## 使用说明 ### 演示图
## 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request ## 特技 1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)