# chat2db **Repository Path**: dahezi/chat2db ## Basic Information - **Project Name**: chat2db - **Description**: Chat2DB 是一款有开源免费的多数据库客户端工具,支持windows、mac本地安装,也支持服务器端部署,web网页访问 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: https://www.oschina.net/p/chat2db - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 26 - **Created**: 2023-06-05 - **Last Updated**: 2023-06-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
### 数据源管理
### SQL控制台 及 AI智能助手
## 📦 Docker部署
```bash
docker pull chat2db/chat2db:latest
// 前台运行,运行后不能关闭命令行
docker run -ti --name=chat2db -p 10824:10824 chat2db/chat2db:latest
// 后台运行,运行后可以关闭命令行
docker run --name=chat2db -p 10824:10824 chat2db/chat2db:latest
// 这里正常会提示 Tomcat started on port(s): 10824 (http) with context path 就可以结束了
// 如果这里提示 The container name "/chat2db" is already in use by container, 代表已经存在容器了 运行
dcoker run chat2db
// 如果想更新chat2db 则需要先rm 再运行
dcoker rm chat2db
```
## 🎯 运行环境
注意:
如果需要本地调试
- java运行 Open JDK 17
- Node运行环境Node16 Node.js.
## 💻 本地调试
- git clone到本地
```bash
$ git clone git@github.com:alibaba/Chat2DB.git
```
- 前端安装
```bash
$ cd Chat2DB/ali-dbhub-client
$ npm install # 安装前端依赖
$ npm run build:prod # 把js打包生成到后端的source目录
```
- 后端调试
```bash
$ cd ../ali-dbhub-server
$ mvn clean install # 需要安装maven 3.8以上版本
$ cd ali-dbhub-server/ali-dbhub-server-start/target/
$ java -jar -Dchatgpt.apiKey=xxxxx ali-dbhub-server-start.jar # 启动应用 chatgpt.apiKey 需要输入ChatGPT的key,如果不输入无法使用AIGC功能
$ # 打开 http://127.0.0.1:10821 开启调试 注:需要进行前端安装
```
- 前端调试
```bash
$ cd Chat2DB/ali-dbhub-client
$ npm install
$ npm run start
$ # 打开 http://127.0.0.1:10821 开启前端调试
$ # 注:前端页面完全赖服务,所以前端同学调试也需要把后端项目跑起来
```
但是前端调试需要映射下资源,可以下载[XSwitch](https://chrome.google.com/webstore/detail/idkjhjggpffolpidfkikidcokdkdaogg),添加以下配置文件
``` json
{
"proxy": [
[
"http://127.0.0.1:10821/(.*).js$",
"http://127.0.0.1:8001/$1.js",
],
[
"http://127.0.0.1:10821/(.*).css$",
"http://127.0.0.1:8001/$1.css",
],
[
"http://127.0.0.1:10821/static/front/(.*)",
"http://127.0.0.1:8001/$1",
],
[
"http://127.0.0.1:10821/static/(.*)$",
"http://127.0.0.1:8001/static/$1",
],
],
}
```
## 📑 文档
* WIKI
* Issue tracker
## Stargazers
[](https://github.com/alibaba/Chat2DB/stargazers)
## Forkers
[](https://github.com/alibaba/Chat2DB/network/members)
## ☎️ 联系我们
加群前请先Star和Fork,谢谢~