HDU (2024-2025-1)-S0512290-01 《数据库原理课程设计》 课程项目:学生课外活动管理系统
- DBMS:openGauss/PostgreSQL
- CASE工具:PowerDesigner 16.7
- 后端:Rocket.rs + sqlx
- 前端:React + MUI 6 + TypeScript + Vite
项目作者之一@CSharperMantle在该课设课程中拿到了5.0/5.0的绩点。
- pd/:PowerDesigner项目文件(该目录下文件包含绝对路径,且在Git中视为二进制文件)
- erke_powerdesigner.sws:工作区文件
- erke_dfd.*:数据流图
- erke_cdm.*:概念模型
- erke_ldm.*:逻辑模型
- erke_pdm.*:物理模型
- notes/:设计笔记
- sql/:SQL脚本
- backend/:后端服务器实现
- frontend/:前端实现
- 使用PowerDesigner生成项目文件并将其导入PostgreSQL或openGauss
- 创建角色
- 创建管理员角色
erke_admin
- 执行sql/role.sql创建用户角色
- 创建管理员角色
- 执行sql/下其他脚本完成存储过程、函数、触发器与视图
- 构建前后端
- 在backend/目录下创建配置文件
.env
与Rocket.toml
,具体见下 - 构建后端
- 构建前端
- 在backend/目录下创建配置文件
- 运行后端
例如,DBMS运行于127.0.0.1:15432,且前端构建产物将放于[backend]/../frontend/dist/
目录下,则backend/.env
文件应包含如下内容:
DB_HOST = 127.0.0.1
DB_PORT = 15432
FRONTEND_PATH = ../frontend/dist/
Rocket.toml
包含后端监听地址端口与Cookie加密配置。配置文件的具体含义见Rocket.rs官方文档。生成secret_key
的方法详见CookieJar
的inline docs。样例结构如下:
[default]
address = "127.0.0.1"
port = 8000
secret_key = "[Base64-encoded secrets]"
前后端的构建命令如下:
cd backend
cargo build -r
cd ../frontend
yarn install
yarn build
之后在backend/下运行cargo run -r
即可启动后端服务器。前端页面由服务器以静态路由形式serve。
Copyright © 2024-2025 Rong "Mantle" Bao <[email protected]>.
Copyright © 2024-2025 Junyuan Huang <[email protected]>.
Copyright © 2024-2025 Guangsheng Huang <[email protected]>.
Copyright © 2024-2025 Jingxuan Ji.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see LICENSE-GPL-3.0-or-later or https://www.gnu.org/licenses/.
Copyright © 2024-2025 Rong "Mantle" Bao <[email protected]>.
Copyright © 2024-2025 Junyuan Huang <[email protected]>.
Copyright © 2024-2025 Guangsheng Huang <[email protected]>.
Copyright © 2024-2025 Jingxuan Ji.
This work is licensed under Creative Commons Attribution-ShareAlike 4.0 International. To view a copy of this license, see LICENSE-CC-BY-SA-4.0 or visit https://creativecommons.org/licenses/by-sa/4.0/.