2022-04-25 09:45:56 +08:00
|
|
|
|
[English](./README.md) | 简体中文
|
|
|
|
|
|
|
|
|
|
![](https://www.nocobase.com/images/demo/11.png)
|
|
|
|
|
|
|
|
|
|
NocoBase 是什么
|
|
|
|
|
----------
|
|
|
|
|
NocoBase 是一个极易扩展的开源无代码开发平台。
|
|
|
|
|
无需编程,使用 NocoBase 搭建自己的协作平台、管理系统,只需要几分钟时间。
|
|
|
|
|
|
|
|
|
|
官网:https://cn.nocobase.com/
|
|
|
|
|
|
|
|
|
|
在线体验:https://demo-cn.nocobase.com/new
|
|
|
|
|
|
|
|
|
|
为什么选择 NocoBase
|
|
|
|
|
----------
|
|
|
|
|
- 开源免费
|
2022-04-27 18:22:41 +08:00
|
|
|
|
- 采用 Apache-2.0 许可协议,不限制商业使用
|
2022-04-25 09:45:56 +08:00
|
|
|
|
- 拥有全部代码,私有化部署,保障数据私有和安全
|
|
|
|
|
- 针对实际需求自由扩展开发
|
|
|
|
|
- 具备良好的生态支持
|
|
|
|
|
- 无代码能力强
|
|
|
|
|
- 所见即所得的可视化配置
|
|
|
|
|
- 数据结构配置与界面配置分离
|
|
|
|
|
- 丰富的区块和操作任意组合
|
|
|
|
|
- 基于角色的访问权限
|
|
|
|
|
- 对开发者友好
|
|
|
|
|
- 微内核,灵活易扩展,具备健全的插件体系
|
|
|
|
|
- 基于 Node.js,使用主流框架和技术,包括 Koa、Sequelize、React、Formily、Ant Design 等
|
|
|
|
|
- 渐进式开发,上手难度低,对新人友好
|
|
|
|
|
- 不绑架、不强依赖,可任意组合使用或扩展,可用于现有项目中
|
|
|
|
|
|
|
|
|
|
说明
|
|
|
|
|
----------
|
|
|
|
|
|
|
|
|
|
如果你希望加入我们一起开发 NocoBase,或者探讨 NocoBase 未来发展,或者需要提供 NocoBase 使用上的帮助,欢迎通过邮件联系我们:hello@nocobase.com
|
|
|
|
|
|
|
|
|
|
或者添加我们的微信:
|
|
|
|
|
|
|
|
|
|
![](https://www.nocobase.com/images/wechat.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NocoBase 架构
|
|
|
|
|
----------
|
|
|
|
|
![](https://docs.nocobase.com/static/NocoBase.c9542b1f.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
环境要求
|
|
|
|
|
----------
|
|
|
|
|
|
|
|
|
|
Node:
|
|
|
|
|
|
|
|
|
|
- Node.js 12.20+
|
|
|
|
|
|
|
|
|
|
Database:
|
|
|
|
|
|
|
|
|
|
- PostgreSQL 10.x+
|
2022-04-25 19:05:33 +08:00
|
|
|
|
- MySQL 8.x+
|
|
|
|
|
- SQLite 3+
|
2022-04-25 09:45:56 +08:00
|
|
|
|
|
|
|
|
|
安装 & 运行
|
|
|
|
|
----------
|
|
|
|
|
|
2022-04-29 00:09:40 +08:00
|
|
|
|
## 使用 [Docker](https://docs.docker.com/get-docker/) 创建项目(推荐)
|
|
|
|
|
|
|
|
|
|
### 1. 创建项目文件夹
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
mkdir my-nocobase-app && cd my-nocobase-app/
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 2. 创建 `docker-compose.yml` 文件
|
|
|
|
|
|
|
|
|
|
#### SQLite
|
|
|
|
|
|
|
|
|
|
```yml
|
|
|
|
|
version: "3"
|
|
|
|
|
networks:
|
|
|
|
|
nocobase:
|
|
|
|
|
driver: bridge
|
|
|
|
|
services:
|
|
|
|
|
app:
|
|
|
|
|
image: nocobase/nocobase:latest
|
|
|
|
|
networks:
|
|
|
|
|
- nocobase
|
|
|
|
|
environment:
|
|
|
|
|
- LOCAL_STORAGE_BASE_URL=http://localhost:13000/storage/uploads
|
|
|
|
|
volumes:
|
|
|
|
|
- ./storage:/app/nocobase/storage
|
|
|
|
|
ports:
|
|
|
|
|
- "13000:80"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#### MySQL
|
|
|
|
|
|
|
|
|
|
```yml
|
|
|
|
|
version: "3"
|
|
|
|
|
networks:
|
|
|
|
|
nocobase:
|
|
|
|
|
driver: bridge
|
|
|
|
|
services:
|
|
|
|
|
app:
|
|
|
|
|
image: nocobase/nocobase:latest
|
|
|
|
|
networks:
|
|
|
|
|
- nocobase
|
|
|
|
|
environment:
|
|
|
|
|
- DB_DIALECT=mysql
|
|
|
|
|
- DB_HOST=mysql
|
|
|
|
|
- DB_DATABASE=nocobase
|
|
|
|
|
- DB_USER=nocobase
|
|
|
|
|
- DB_PASSWORD=nocobase
|
|
|
|
|
- LOCAL_STORAGE_BASE_URL=http://localhost:13000/storage/uploads
|
|
|
|
|
volumes:
|
|
|
|
|
- ./storage:/app/nocobase/storage
|
|
|
|
|
ports:
|
|
|
|
|
- "13000:80"
|
|
|
|
|
mysql:
|
|
|
|
|
image: mysql:8
|
|
|
|
|
environment:
|
|
|
|
|
MYSQL_DATABASE: nocobase
|
|
|
|
|
MYSQL_USER: nocobase
|
|
|
|
|
MYSQL_PASSWORD: nocobase
|
|
|
|
|
MYSQL_ROOT_PASSWORD: nocobase
|
|
|
|
|
restart: always
|
|
|
|
|
networks:
|
|
|
|
|
- nocobase
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#### PostgreSQL
|
|
|
|
|
|
|
|
|
|
```yml
|
|
|
|
|
version: "3"
|
|
|
|
|
networks:
|
|
|
|
|
nocobase:
|
|
|
|
|
driver: bridge
|
|
|
|
|
services:
|
|
|
|
|
app:
|
|
|
|
|
image: nocobase/nocobase:latest
|
|
|
|
|
networks:
|
|
|
|
|
- nocobase
|
|
|
|
|
environment:
|
|
|
|
|
- DB_DIALECT=postgres
|
|
|
|
|
- DB_HOST=postgres
|
|
|
|
|
- DB_DATABASE=nocobase
|
|
|
|
|
- DB_USER=nocobase
|
|
|
|
|
- DB_PASSWORD=nocobase
|
|
|
|
|
- LOCAL_STORAGE_BASE_URL=http://localhost:13000/storage/uploads
|
|
|
|
|
volumes:
|
|
|
|
|
- ./storage:/app/nocobase/storage
|
|
|
|
|
ports:
|
|
|
|
|
- "13000:80"
|
|
|
|
|
postgres:
|
|
|
|
|
image: postgres:10
|
|
|
|
|
restart: always
|
|
|
|
|
networks:
|
|
|
|
|
- nocobase
|
|
|
|
|
command: postgres -c wal_level=logical
|
|
|
|
|
environment:
|
|
|
|
|
POSTGRES_USER: nocobase
|
|
|
|
|
POSTGRES_DB: nocobase
|
|
|
|
|
POSTGRES_PASSWORD: nocobase
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 3. 安装并启动 NocoBase
|
|
|
|
|
|
|
|
|
|
安装过程可能需要等待几十秒钟
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
$ docker-compose up
|
|
|
|
|
|
|
|
|
|
app-sqlite-app-1 | nginx started
|
|
|
|
|
app-sqlite-app-1 | yarn run v1.22.15
|
|
|
|
|
app-sqlite-app-1 | $ cross-env DOTENV_CONFIG_PATH=.env node -r dotenv/config packages/app/server/lib/index.js install -s
|
|
|
|
|
app-sqlite-app-1 | Done in 2.72s.
|
|
|
|
|
app-sqlite-app-1 | yarn run v1.22.15
|
|
|
|
|
app-sqlite-app-1 | $ pm2-runtime start --node-args="-r dotenv/config" packages/app/server/lib/index.js -- start
|
|
|
|
|
app-sqlite-app-1 | 2022-04-28T15:45:38: PM2 log: Launching in no daemon mode
|
|
|
|
|
app-sqlite-app-1 | 2022-04-28T15:45:38: PM2 log: App [index:0] starting in -fork mode-
|
|
|
|
|
app-sqlite-app-1 | 2022-04-28T15:45:38: PM2 log: App [index:0] online
|
|
|
|
|
app-sqlite-app-1 | 🚀 NocoBase server running at: http://localhost:13000/
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
你也可以使用 `docker-compose up -d` 在后台运行,如:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# 在后台运行
|
|
|
|
|
$ docker-compose up -d
|
|
|
|
|
# 查看 app 进程的情况
|
|
|
|
|
$ docker-compose logs app
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 4. 登录 NocoBase
|
|
|
|
|
|
|
|
|
|
使用浏览器打开 http://localhost:13000/ 初始化账号和密码是 `admin@nocobase.com` 和 `admin123`。
|
|
|
|
|
|
2022-04-25 09:45:56 +08:00
|
|
|
|
## 通过 `create-nocobase-app` 创建项目
|
|
|
|
|
|
|
|
|
|
~~~shell
|
|
|
|
|
# 1. 创建项目
|
2022-04-25 19:05:33 +08:00
|
|
|
|
# SQLite
|
|
|
|
|
yarn create nocobase-app my-nocobase-app -d sqlite
|
|
|
|
|
# MySQL
|
|
|
|
|
yarn create nocobase-app my-nocobase-app -d mysql \
|
|
|
|
|
-e DB_HOST=mysql \
|
|
|
|
|
-e DB_PORT=3356 \
|
|
|
|
|
-e DB_DATABASE=nocobase \
|
|
|
|
|
-e DB_USER=nocobase \
|
|
|
|
|
-e DB_PASSWORD=nocobase
|
|
|
|
|
# PostgreSQL
|
|
|
|
|
yarn create nocobase-app my-nocobase-app -d postgres \
|
|
|
|
|
-e DB_HOST=postgres \
|
|
|
|
|
-e DB_PORT=5432 \
|
|
|
|
|
-e DB_DATABASE=nocobase \
|
|
|
|
|
-e DB_USER=nocobase \
|
|
|
|
|
-e DB_PASSWORD=nocobase
|
2022-04-25 09:45:56 +08:00
|
|
|
|
|
|
|
|
|
# 2. 切换目录
|
|
|
|
|
cd my-nocobase-app
|
|
|
|
|
|
2022-04-26 16:49:33 +08:00
|
|
|
|
# 📢 由于网络环境、系统配置等因素影响,接下来这一步骤可能需要十几分钟时间
|
2022-04-26 16:12:48 +08:00
|
|
|
|
# 📢 使用 SQLite 数据库时,需要配置 sqlite3_binary_host_mirror
|
|
|
|
|
yarn config set sqlite3_binary_host_mirror https://npmmirror.com/mirrors/sqlite3/
|
|
|
|
|
|
2022-04-25 22:05:05 +08:00
|
|
|
|
# 3. 安装依赖(使用阿里云镜像)
|
|
|
|
|
yarn install --registry=https://registry.npmmirror.com
|
2022-04-25 19:05:33 +08:00
|
|
|
|
|
|
|
|
|
# 4. 安装 NocoBase
|
2022-04-25 09:45:56 +08:00
|
|
|
|
yarn nocobase install --lang=zh-CN
|
|
|
|
|
|
2022-04-25 19:05:33 +08:00
|
|
|
|
# 5. 启动
|
2022-04-25 09:45:56 +08:00
|
|
|
|
yarn start
|
|
|
|
|
~~~
|
|
|
|
|
|
2022-04-29 00:09:40 +08:00
|
|
|
|
使用浏览器打开 http://localhost:8000/ 初始化账号和密码是 `admin@nocobase.com` 和 `admin123`。
|
2022-04-25 09:45:56 +08:00
|
|
|
|
|
|
|
|
|
## 参与贡献
|
|
|
|
|
|
|
|
|
|
- Fork 源代码到自己的仓库
|
|
|
|
|
- 修改源代码
|
|
|
|
|
- 提交 Pull Request
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# 替换为自己的仓库地址
|
|
|
|
|
git clone https://github.com/nocobase/nocobase.git
|
|
|
|
|
cd nocobase
|
|
|
|
|
cp .env.example .env
|
|
|
|
|
yarn install
|
|
|
|
|
yarn nocobase install
|
|
|
|
|
yarn start
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 打包
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# For all packages
|
|
|
|
|
yarn build
|
|
|
|
|
|
|
|
|
|
# For specific package
|
|
|
|
|
yarn build --scope @nocobase/database
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 测试
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# For all packages
|
|
|
|
|
yarn test
|
|
|
|
|
|
|
|
|
|
# For specific package
|
|
|
|
|
yarn test packages/<name>
|
|
|
|
|
```
|