File tree Expand file tree Collapse file tree 1 file changed +74
-16
lines changed Expand file tree Collapse file tree 1 file changed +74
-16
lines changed Original file line number Diff line number Diff line change 1
- ## 少儿编程后端
2
-
1
+ # 少儿编程后端
2
+ ## 介绍
3
3
+ 基于Node.js+ThinkJS+MySQL
4
-
5
- ### 本地配置
6
- #### 数据库
7
- ##### 1、创建数据库robotDB
8
- + 可以使用Navicat软件创建数据库,也可以用以下命令创建:
4
+ ## Web前端
5
+ https://github.com/Wenbile/Child-Programming-Web
6
+ ## 项目结构
9
7
```
10
- CREATE SCHEMA `robotDB` DEFAULT CHARACTER SET utf8mb4 ;
8
+ ├── runtime
9
+ │ └── config
10
+ │ └── development.json
11
+ ├── LICENSE
12
+ ├── README.md
13
+ ├── api.md //后端接口定义
14
+ ├── app //自动生成的接口映射
15
+ ├── development.js //开发环境配置
16
+ ├── production.js //正式环境配置
17
+ ├── package-lock.json
18
+ ├── package.json
19
+ ├── pm2.json //pm2进程管理器配置
20
+ ├── robotDB.sql //数据库模型
21
+ ├── src
22
+ │ ├── api
23
+ │ │ └── controller
24
+ │ │ ├── base.js //公共接口,其他接口都基于此接口
25
+ │ │ └── robot.js //板块、案例编辑接口
26
+ │ └── common
27
+ │ └── config
28
+ │ ├── adapter.js // 适配器配置
29
+ │ ├── config.js //开发环境配置
30
+ │ ├── config.production.js //正式环境配置
31
+ │ ├── database.js //数据库配置
32
+ │ ├── extend.js
33
+ │ └── middleware.js //中间件配置
34
+ └── static
35
+ ├── carousel //轮播图资源
36
+ │ ├── c1.jpg
37
+ │ ├── c2.jpg
38
+ │ └── c3.jpg
39
+ ├── cover //主页卡片资源
40
+ │ ├── art.jpg
41
+ │ ├── book.jpg
42
+ │ ├── code.jpg
43
+ │ ├── game.jpg
44
+ │ ├── globe.jpg
45
+ │ ├── math.jpg
46
+ │ ├── music.jpg
47
+ │ └── science.jpg
48
+ ├── model //模型资源
49
+ │ └── sportcar.babylon
50
+ └── simulator //游戏页素材资源
51
+ ├── loading.gif
52
+ ├── marker.png
53
+ ├── pencil_down.png
54
+ ├── pencil_up.png
55
+ ├── rabbit.png
56
+ ├── restart.png
57
+ └── turtle.png
11
58
```
12
- > 注意数据库字符编码为utf8mb4
13
- ##### 2、在robotDB数据中导入项目根目录下的robotDB.sql
14
59
60
+ ## 数据库
61
+ 1、创建数据库robotDB
62
+ > 注意数据库字符编码为utf8mb4
15
63
16
- ##### 3、更改数据库配置
64
+ - 可以使用Navicat软件创建数据库,也可以用以下命令创建:
65
+ ```
66
+ CREATE SCHEMA `robotDB` DEFAULT CHARACTER SET utf8mb4 ;
67
+ ```
68
+ 2、在robotDB数据中导入项目根目录下的robotDB.sql
69
+ 3、更改数据库配置
17
70
> src/common/config/database.js
18
71
```
19
72
const mysql = require('think-model-mysql');
@@ -31,28 +84,33 @@ module.exports = {
31
84
};
32
85
```
33
86
34
- + 接口说明文档
87
+ ## 接口说明文档
35
88
```
36
89
api.md
37
90
```
38
91
39
- + 开源图片、开源图标资源来源
92
+ ## 开源图片、开源图标资源来源
40
93
```
41
94
http://www.freepik.com
42
95
https://www.iconfinder.com
43
96
```
44
97
45
- + npm版本
98
+ ## npm版本
46
99
```
47
100
npm -v
48
101
7.6.3
49
102
```
50
- + 安装依赖并调试启动
103
+ ## 安装依赖
51
104
```
52
105
npm install
106
+ ```
107
+
108
+ ## 编译运行
109
+ ```
53
110
npm start
54
111
```
112
+
55
113
启动后,本地访问 http://127.0.0.1:8088/
56
114
57
- ### 云端部署
115
+ ## 云端部署
58
116
+ 使用pm2进程管理器部署(未完待续...)
You can’t perform that action at this time.
0 commit comments