Skip to content

Commit

Permalink
chore: README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanzhaoyu committed Feb 13, 2023
1 parent 6cafc07 commit befad1c
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 11 deletions.
85 changes: 74 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,98 @@

![cover](./docs/cover.png)

## 使用
> 确保 `node >= 18`
## Route Map
[x] 多会话

[x] 多语言

[x] 主题

[x] 用户模块

[x] More...

## 前置要求

### Node

`node` 版本需要 >= 18,使用 [nvm](https://github.com/nvm-sh/nvm) 可管理本地多个 `node` 版本

```shell
node -v
```

### PNPM
如果你没有安装过 `pnpm`
```shell
npm install pnpm -g
```

安装依赖
### OpenAI API KEy
获取 [OpenAI API key](https://platform.openai.com/overview) 并填写到本地环境变量
```
# service/.env 文件
OPENAI_API_KEY='Your key'
```

## 安装依赖

> 为了简便 `后端开发人员` 的了解负担,所以并没有采用前端 `workspace` 模式,而是分文件夹存放。如果只需要前端页面做二次开发,删除 `service` 文件夹即可。
### 后端服务

进入文件夹 `/service` 运行以下命令

```shell
pnpm install
```

获取 [OpenAI API key](https://platform.openai.com/overview) 到本地环境变量

### 网页
根目录下运行以下命令
```shell
pnpm bootstrap
```
# .env
OPENAI_API_KEY="Your Key"


## 运行
### 后端服务

进入文件夹 `/service` 运行以下命令

```shell
pnpm start
```

运行服务
### 网页
根目录下运行以下命令
```shell
pnpm run service
pnpm dev
```

运行网页
## 打包
### 后端服务
> 如果你不需要本项目的 `node` 接口,可以省略如下操作
复制 `service` 文件夹到你有 `node` 服务环境的服务器上。(搜索关键字:`express部署)`

操作上述 `安装``运行` 服务。

### 网页
根目录下运行以下命令,然后将 `dist` 文件夹复制到你的托管服务器上

```shell
pnpm run dev
pnpm build
```

### 常见问题
Q: 如果只使用前端页面,在哪里改请求接口?

A: 根目录下 `.env` 文件中的 `VITE_GLOB_API_URL` 字段。

Q: 文件保存时全部爆红色?

A: `vscode` 请安装项目推荐插件,或在手动安装 `Eslint` 插件。

## License
MIT © [ChenZhaoYu](./license)
Binary file modified docs/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit befad1c

Please sign in to comment.