需求
- MongoDB v3.6.8+
- Chrome 81.0+ 或者 Firefox 75.0+
下面的软件仅在从源码编译时才需要。
- Golang 1.14.2+
- NodeJS 14.1+
- gcc 9.3.0+ (Windows上需要安装tdm-gcc、MinGW-w64或MinGW。请保证gcc可以通过命令行访问)
- git 2.25.1+
注意 版本号仅供参考。
源码下载
你可以使用git下载源码。
git clone https://github.com/tengge1/ShadowEditor.git
在国内,由于github比较慢,可以使用gitee。
git clone https://gitee.com/tengge1/ShadowEditor.git
源码编译
Web版编译
- 如果你在国内, 执行npm run set-proxy设置go语言和nodejs代理。
- 执行npm install安装nodejs依赖。
- 执行npm run build构建服务端和Web端。
- 编辑build/config.toml,修改MongoDB的host和port设置。
- 执行npm run start启动服务端。现在你可以访问:http:~/~/localhost:2020。
桌面版编译
- 请先编译Web版。
- 下载MongoDB,解压到utils/mongodb文件夹中。
- 构建Web版。
- 执行npm run build-desktop可以在文件夹build/desktop中创建一个桌面版应用。
安装服务
安装为Windows服务
- 以管理员身份在build文件夹中打开PowerShell或cmd。
- 运行.\ShadowEditor install,将ShadowEditor安装为服务。
- 运行.\ShadowEditor start,启动ShadowEditor服务。
- 现在你可以访问:http:~/~/localhost:2020。
- 你也可以在Windows服务管理器中管理这个服务。
安装为Ubuntu服务
- 编辑./scripts/service_linux/shadoweditor.service,设置正确的路径。
- 执行sudo cp ./scripts/service_linux/shadoweditor.service /etc/systemd/system/。
- 执行sudo systemctl daemon-reload重新加载服务守护程序。
- 执行sudo systemctl start shadoweditor启动服务。
- 执行sudo systemctl enable shadoweditor设置开机自启动。
命令行使用
PS E:\github\ShadowEditor\build\> .\ShadowEditor
ShadowEditor is a 3D scene editor based on three.js, golang and mongodb.
This application uses mongodb to store data.
Usage:
ShadowEditor [command]
Available Commands:
debug Debug service on Windows
help Help about any command
install Install service on Windows
serve Start server
start Start service on Windows
stop Stop service on Windows
version Print the version number
Flags:
--config string config file (default "./config.toml")
-h, --help help for ShadowEditor
Use "ShadowEditor [command] --help" for more information about a command.