|
1 | | -# 空荧酒馆·原神地图 Rust 后端 |
| 1 | +# 空荧酒馆·原神地图 Rust 后端 / Genshin Map Cloud Rust Backend |
2 | 2 |
|
3 | | -## 如何构建 |
| 3 | +## 如何构建 / How to build |
| 4 | + |
| 5 | +为了确保环境的一致性,本项目采用 Docker Compose 进行自动化部署。请确保机器上已安装 Docker 和 Cargo。 |
4 | 6 |
|
5 | 7 | To ensure the environment is unified, this project has been deployed automatically using Docker Compose. Make sure Docker and Cargo are installed on the machine. |
6 | 8 |
|
| 9 | +在部署之前,您应该在项目文件夹中创建一个名为 `.env` 的文件,其中存储服务器将连接到的数据库的配置信息。示例内容如下: |
| 10 | + |
7 | 11 | Before the formal deployment, you should create a file named `.env` in the project folder, which stores the configuration information of the database that the server will connect to. The example content is as follows: |
8 | 12 |
|
9 | 13 | ```env |
10 | | -MARIADB_ROOT_PASSWORD=root |
11 | | -DB_PASSWORD=root |
| 14 | +DB_PASSWORD=<password> |
12 | 15 | ``` |
13 | 16 |
|
| 17 | +请确保以上的配置项已正确填写。 |
| 18 | + |
14 | 19 | Please make sure that the configuration file has correctly filled in all the keys involved in the above example, and cannot be omitted. |
15 | 20 |
|
16 | | -Before starting, please make sure that `cargo-make` is installed: |
| 21 | +正式开始前,请确保已安装 `cargo-make` 与 `docker`;如果需要本地调试,还需要安装 `docker-compose`。 |
17 | 22 |
|
18 | | -```bash |
19 | | -cargo install --force cargo-make |
20 | | -``` |
| 23 | +Before starting, please make sure that `cargo-make` and `docker` are installed. If you need local debugging, you also need to install `docker-compose`. |
| 24 | + |
| 25 | +之后,执行以下命令以构建集群: |
21 | 26 |
|
22 | 27 | Then execute the following command in the project directory to build the cluster: |
23 | 28 |
|
24 | 29 | ```bash |
25 | 30 | cargo make build |
26 | 31 | ``` |
27 | 32 |
|
| 33 | +如果您需要实时调试,可以通过以下方式启动集群: |
| 34 | + |
28 | 35 | If you need to debug in real time, start the cluster in this way: |
29 | 36 |
|
30 | 37 | ```bash |
31 | 38 | cargo make dev |
32 | 39 | ``` |
33 | | - |
34 | | -While deploying to the server, there are some differences in the way the cluster starts: |
35 | | - |
36 | | -```bash |
37 | | -cargo make -p production -e DB_USERNAME=<username> -e DB_PASSWORD=<password> up |
38 | | -# Or use the .env file to keep the password on the server, |
39 | | -# ensuring that the password itself does not appear in the terminal execution history |
40 | | -cargo make -p production --env-file=<filepath> up |
41 | | -``` |
42 | | - |
43 | | -## 逻辑分块 |
44 | | - |
45 | | -主要分为3大块: |
46 | | - |
47 | | -1. 业务模块 |
48 | | -2. 权限模块 |
49 | | -3. 功能模块 |
50 | | - |
51 | | -### 业务模块 |
52 | | - |
53 | | -业务模块为服务于地图逻辑的模块 |
54 | | - |
55 | | -当前提供的地图逻辑实体有: |
56 | | - |
57 | | -1. 地区 |
58 | | -2. 物品 |
59 | | -3. 点位 |
60 | | -4. 图标 |
61 | | -5. 路线 |
62 | | - |
63 | | -其中,对以下逻辑实体提供打点-审核机制: |
64 | | - |
65 | | -1. 点位 |
66 | | -2. 路线(TODO) |
67 | | - |
68 | | -对以下逻辑实体提供分类支持: |
69 | | - |
70 | | -1. 物品 |
71 | | -2. 图标 |
72 | | - |
73 | | -以下的数据结构为树状结构: |
74 | | - |
75 | | -1. 所有的分类 |
76 | | -2. 地区 |
77 | | - |
78 | | -### 权限模块 |
79 | | - |
80 | | -当前权限系统为单角色,共分为以下几个等级(权限由高到低) |
81 | | - |
82 | | -1. 系统管理员——最高权限,管理权限模块 |
83 | | -2. 地图管理员——管理业务模块 |
84 | | -3. 审核员——拥有审核点位的权限 |
85 | | -4. 测试服打点员——拥有对测试服数据的访问权限,经管理员授权可以绕过审核机制 |
86 | | -5. 正式服打点员——拥有提交打点的权限 |
87 | | -6. 后台准用户——无权限 |
88 | | -7. 前台用户——匿名用户 |
0 commit comments