安装
环境准备#
要运行 Fiora, 你需要 Node.js(推荐 v14 LTS 版本), MongoDB 和 redis
- 安装 Node.js
- 官网 http://nodejs.cn/download/
- 更推荐使用 nvm 安装 Node.js
- 安装 nvm https://github.com/nvm-sh/nvm#install--update-script
- 通过 nvm 安装 Node.js https://github.com/nvm-sh/nvm#usage
- 安装 MongoDB
- 安装 redis
推荐在 Linux 或者 MacOS 系统上运行
如何运行#
- 克隆项目到本地
git clone https://github.com/yinxin630/fiora.git -b master - 确保安装了 yarn, 如果没有安装请执行
npm install -g yarn - 安装项目依赖
yarn install - 构建客户端代码
yarn build:web - 配置 JwtSecret
echo "JwtSecret=<string>" > .env2. 要将<string>替换为一个秘密文本 - 启动服务端
yarn start - 使用浏览器打开
http://[ip地址]:[端口](比如http://127.0.0.1:9200)
在后台运行#
使用 yarn start 运行服务端会在断开 ssh 连接后停止运行, 推荐使用 pm2 来运行
运行开发模式#
- 启动服务端
yarn dev:server - 启动客户端
yarn dev:web - 使用浏览器打开
http://localhost:8080
docker 运行#
首先安装 docker https://docs.docker.com/install/
直接从 DockerHub 镜像运行#
本地构建镜像运行#
- 克隆项目到本地
git clone https://github.com/yinxin630/fiora.git -b master - 构建镜像
docker-compose build --no-cache --force-rm - 运行
docker-compose up