update readme and vite port

This commit is contained in:
Henry 2023-11-27 12:24:11 +00:00
parent 8ce32179ee
commit 4e3f219e2d
11 changed files with 41 additions and 34 deletions

View File

@ -27,7 +27,8 @@ If applicable, add screenshots to help explain your problem.
If applicable, add exported flow in order to help replicating the problem. If applicable, add exported flow in order to help replicating the problem.
**Setup** **Setup**
- Installation [e.g. docker, `npx flowise start`, `yarn start`]
- Installation [e.g. docker, `npx flowise start`, `pnpm start`]
- Flowise Version [e.g. 1.2.11] - Flowise Version [e.g. 1.2.11]
- OS: [e.g. macOS, Windows, Linux] - OS: [e.g. macOS, Windows, Linux]
- Browser [e.g. chrome, safari] - Browser [e.g. chrome, safari]

View File

@ -44,9 +44,9 @@ Flowise 在一个单一的单体存储库中有 3 个不同的模块。
#### 先决条件 #### 先决条件
- 安装 [Yarn v1](https://classic.yarnpkg.com/en/docs/install) - 安装 [PNPM](https://pnpm.io/installation)
```bash ```bash
npm i -g yarn npm i -g pnpm
``` ```
#### 逐步指南 #### 逐步指南
@ -71,45 +71,45 @@ Flowise 在一个单一的单体存储库中有 3 个不同的模块。
6. 安装所有模块的依赖项: 6. 安装所有模块的依赖项:
```bash ```bash
yarn install pnpm install
``` ```
7. 构建所有代码: 7. 构建所有代码:
```bash ```bash
yarn build pnpm build
``` ```
8. 在[http://localhost:3000](http://localhost:3000)上启动应用程序 8. 在[http://localhost:3000](http://localhost:3000)上启动应用程序
```bash ```bash
yarn start pnpm start
``` ```
9. 开发时: 9. 开发时:
- 在`packages/ui`中创建`.env`文件并指定`PORT`(参考`.env.example` - 在`packages/ui`中创建`.env`文件并指定`VITE_PORT`(参考`.env.example`
- 在`packages/server`中创建`.env`文件并指定`PORT`(参考`.env.example` - 在`packages/server`中创建`.env`文件并指定`PORT`(参考`.env.example`
- 运行 - 运行
```bash ```bash
yarn dev pnpm dev
``` ```
对`packages/ui`或`packages/server`进行的任何更改都将反映在[http://localhost:8080](http://localhost:8080)上 对`packages/ui`或`packages/server`进行的任何更改都将反映在[http://localhost:8080](http://localhost:8080)上
对于`packages/components`中进行的更改,再次运行`yarn build`以应用更改。 对于`packages/components`中进行的更改,再次运行`pnpm build`以应用更改。
10. 做完所有的更改后,运行以下命令来确保在生产环境中一切正常: 10. 做完所有的更改后,运行以下命令来确保在生产环境中一切正常:
```bash ```bash
yarn build pnpm build
``` ```
```bash ```bash
yarn start pnpm start
``` ```
11. 提交代码并从指向 [Flowise 主分支](https://github.com/FlowiseAI/Flowise/tree/master) 的分叉分支上提交 Pull Request。 11. 提交代码并从指向 [Flowise 主分支](https://github.com/FlowiseAI/Flowise/tree/master) 的分叉分支上提交 Pull Request。

View File

@ -88,7 +88,7 @@ Flowise has 3 different modules in a single mono repository.
9. For development: 9. For development:
- Create `.env` file and specify the `PORT` (refer to `.env.example`) in `packages/ui` - Create `.env` file and specify the `VITE_PORT` (refer to `.env.example`) in `packages/ui`
- Create `.env` file and specify the `PORT` (refer to `.env.example`) in `packages/server` - Create `.env` file and specify the `PORT` (refer to `.env.example`) in `packages/server`
- Run - Run
@ -96,7 +96,7 @@ Flowise has 3 different modules in a single mono repository.
pnpm dev pnpm dev
``` ```
Any changes made in `packages/ui` or `packages/server` will be reflected on [http://localhost:5173](http://localhost:5173) Any changes made in `packages/ui` or `packages/server` will be reflected on [http://localhost:8080](http://localhost:8080)
For changes made in `packages/components`, run `pnpm build` again to pickup the changes. For changes made in `packages/components`, run `pnpm build` again to pickup the changes.

View File

@ -75,9 +75,9 @@ Flowise 在一个单一的代码库中有 3 个不同的模块。
### 先决条件 ### 先决条件
- 安装 [Yarn v1](https://classic.yarnpkg.com/en/docs/install) - 安装 [PNPM](https://pnpm.io/installation)
```bash ```bash
npm i -g yarn npm i -g pnpm
``` ```
### 设置 ### 设置
@ -97,31 +97,31 @@ Flowise 在一个单一的代码库中有 3 个不同的模块。
3. 安装所有模块的依赖: 3. 安装所有模块的依赖:
```bash ```bash
yarn install pnpm install
``` ```
4. 构建所有代码: 4. 构建所有代码:
```bash ```bash
yarn build pnpm build
``` ```
5. 启动应用: 5. 启动应用:
```bash ```bash
yarn start pnpm start
``` ```
现在可以在 [http://localhost:3000](http://localhost:3000) 访问应用 现在可以在 [http://localhost:3000](http://localhost:3000) 访问应用
6. 用于开发构建: 6. 用于开发构建:
- 在 `packages/ui` 中创建 `.env` 文件并指定 `PORT`(参考 `.env.example` - 在 `packages/ui` 中创建 `.env` 文件并指定 `VITE_PORT`(参考 `.env.example`
- 在 `packages/server` 中创建 `.env` 文件并指定 `PORT`(参考 `.env.example` - 在 `packages/server` 中创建 `.env` 文件并指定 `PORT`(参考 `.env.example`
- 运行 - 运行
```bash ```bash
yarn dev pnpm dev
``` ```
任何代码更改都会自动重新加载应用程序,访问 [http://localhost:8080](http://localhost:8080) 任何代码更改都会自动重新加载应用程序,访问 [http://localhost:8080](http://localhost:8080)

View File

@ -75,9 +75,9 @@ Flowise has 3 different modules in a single mono repository.
### Prerequisite ### Prerequisite
- Install [Yarn v1](https://classic.yarnpkg.com/en/docs/install) - Install [Yarn v1](https://pnpm.io/installation)
```bash ```bash
npm i -g yarn npm i -g pnpm
``` ```
### Setup ### Setup
@ -97,31 +97,31 @@ Flowise has 3 different modules in a single mono repository.
3. Install all dependencies of all modules: 3. Install all dependencies of all modules:
```bash ```bash
yarn install pnpm install
``` ```
4. Build all the code: 4. Build all the code:
```bash ```bash
yarn build pnpm build
``` ```
5. Start the app: 5. Start the app:
```bash ```bash
yarn start pnpm start
``` ```
You can now access the app on [http://localhost:3000](http://localhost:3000) You can now access the app on [http://localhost:3000](http://localhost:3000)
6. For development build: 6. For development build:
- Create `.env` file and specify the `PORT` (refer to `.env.example`) in `packages/ui` - Create `.env` file and specify the `VITE_PORT` (refer to `.env.example`) in `packages/ui`
- Create `.env` file and specify the `PORT` (refer to `.env.example`) in `packages/server` - Create `.env` file and specify the `PORT` (refer to `.env.example`) in `packages/server`
- Run - Run
```bash ```bash
yarn dev pnpm dev
``` ```
Any code changes will reload the app automatically on [http://localhost:8080](http://localhost:8080) Any code changes will reload the app automatically on [http://localhost:8080](http://localhost:8080)

View File

@ -107,7 +107,7 @@ export class HuggingFaceInference extends LLM implements HFInput {
const { HfInference } = await import('@huggingface/inference') const { HfInference } = await import('@huggingface/inference')
return { HfInference } return { HfInference }
} catch (e) { } catch (e) {
throw new Error('Please install huggingface as a dependency with, e.g. `yarn add @huggingface/inference`') throw new Error('Please install huggingface as a dependency with, e.g. `pnpm install @huggingface/inference`')
} }
} }
} }

View File

@ -72,7 +72,7 @@ export class Cohere extends LLM implements CohereInput {
const { default: cohere } = await import('cohere-ai') const { default: cohere } = await import('cohere-ai')
return { cohere } return { cohere }
} catch (e) { } catch (e) {
throw new Error('Please install cohere-ai as a dependency with, e.g. `yarn add cohere-ai`') throw new Error('Please install cohere-ai as a dependency with, e.g. `pnpm install cohere-ai`')
} }
} }
} }

View File

@ -1 +1 @@
PORT=8080 VITE_PORT=8080

View File

@ -55,8 +55,8 @@
You can add webfonts, meta tags, or analytics to this file. You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag. The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`. To begin the development, run `pnpm start`.
To create a production bundle, use `npm run build` or `yarn build`. To create a production bundle, use `pnpm build`.
--> -->
</body> </body>
</html> </html>

View File

@ -3,7 +3,10 @@ export const gridSpacing = 3
export const drawerWidth = 260 export const drawerWidth = 260
export const appDrawerWidth = 320 export const appDrawerWidth = 320
export const maxScroll = 100000 export const maxScroll = 100000
export const baseURL = import.meta.env.PROD === true ? window.location.origin : window.location.origin.replace(':8080', ':3000') export const baseURL =
import.meta.env.PROD === true
? window.location.origin
: window.location.origin.replace(`:${import.meta.env.VITE_PORT ?? '8080'}`, ':3000')
export const uiBaseURL = window.location.origin export const uiBaseURL = window.location.origin
export const FLOWISE_CREDENTIAL_ID = 'FLOWISE_CREDENTIAL_ID' export const FLOWISE_CREDENTIAL_ID = 'FLOWISE_CREDENTIAL_ID'
export const REDACTED_CREDENTIAL_VALUE = '_FLOWISE_BLANK_07167752-1a71-43b1-bf8f-4f32252165db' export const REDACTED_CREDENTIAL_VALUE = '_FLOWISE_BLANK_07167752-1a71-43b1-bf8f-4f32252165db'

View File

@ -1,6 +1,9 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react' import react from '@vitejs/plugin-react'
import { resolve } from 'path' import { resolve } from 'path'
import dotenv from 'dotenv'
dotenv.config()
export default defineConfig({ export default defineConfig({
plugins: [react()], plugins: [react()],
@ -15,6 +18,6 @@ export default defineConfig({
}, },
server: { server: {
open: true, open: true,
port: 8080 port: process.env.VITE_PORT ?? 8080
} }
}) })