Skip to content

Commit

Permalink
feat: Add ChatGPT IM desktop application
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuoFuhong committed Mar 12, 2023
1 parent b10cb37 commit ff5663b
Show file tree
Hide file tree
Showing 61 changed files with 41,797 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.idea/
.idea
target
node_modules
dist
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.PHONY: dev
dev:
@cargo tauri dev

.PHONY: build
build:
@cargo tauri build

.PHONY: clean
clean:
@rm -rf src-tauri/target
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
- 5.`A` 新增接入 OpenAI 云端 API 服务,实现类似 ChatGPT 的聊天机器人,可以回答各种问题
- 6.`A` 新增接入 OpenAI 最新发布的 Chat completion API,回答问题像 ChatGPT 一样灵性
- 7.`A` 新增接入 OpenAI 最新发布的 Whisper API 实现语音转文字
- 8.`A` 新增 ChatGPT 桌面端,使用 tauri 框架构建的桌面应用程序

### 演示 Demo

**B站视频**https://www.bilibili.com/video/BV1eM41147jN/

![封面](./doc/im/cover-openai.jpg)
**Web 网页端**
![web-im](./doc/im/cover-openai.jpg)

测试数据:

Expand All @@ -33,15 +35,39 @@ http://localhost:63342/go-IM/example/web-im/index.html?uid=1629770216865009664
http://localhost:63342/go-IM/example/web-im/index.html?uid=1629769779311022080
```

**桌面应用**

![app-im](./doc/im/desktop-app.jpg)

### 开发

1.Server 端

```sh
# 启动 Server 端
cd backend
# 默认运行在 127.0.0.1:8080
go run main.go
```

2.Web 端

```sh
cd frontend/web-im

# 浏览器打开 index.html
http://localhost:63342/go-IM/example/web-im/index.html?uid=1629770111088857088
```

3.桌面端

```sh
# 开发模式
cargo tauri dev

# 构建安装包
cargo tauri build
```

### 博客

- [OpenAI Chat completion API 入门指南](https://www.cnblogs.com/marszuo/p/17177286.html)
Expand Down
Binary file added doc/im/desktop-app.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions frontend/app-im/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
24 changes: 24 additions & 0 deletions frontend/app-im/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ChatGPT APP Webview

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn serve
```

### Compiles and minifies for production
```
yarn build
```

### Lints and fixes files
```
yarn lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
5 changes: 5 additions & 0 deletions frontend/app-im/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
Loading

0 comments on commit ff5663b

Please sign in to comment.