Skip to content

Latest commit

 

History

History
81 lines (49 loc) · 1.48 KB

README.en.md

File metadata and controls

81 lines (49 loc) · 1.48 KB

ChatBI

中文 | English

ChatBI is a BI system that uses AI to chat for analysis.

Principle analysis reference article: ChatGPT Empowers Visualization Solution Exploration

Demo

ava vega

Preparation

1. Register an OpenAI Account

Register an account on OpenAI and obtain an API Key.

2. Install Node.js Environment

Refer to: https://nodejs.org/en/learn/getting-started/how-to-install-nodejs

The project uses the native fetch method in Node.js, so Node.js >= 18 is required. Refer to: https://nodejs.org/dist/latest-v18.x/docs/api/globals.html#fetch

After installing Node.js, install pnpm:

npm install -g pnpm

3. Server Configuration

Go to the server directory, copy .env.example to .env, and fill in the environment variables as follows:

# Database
OPENAI_API_BASE_URL=https://api.openai.com
OPENAI_API_KEY=xxx

# MySQL
DB_CONNECTION=mysql://test:test@127.0.0.1:3306/test

Install server dependencies:

pnpm install

4. Install dependencies

In the project root directory, execute:

pnpm install

5. Start the database (optional)

For local development demonstration, you can start MySQL through docker:

cd ./server/docker && docker-compose up -d

6. Run

  1. Start the server:
$ pnpm run dev:server
  1. Start the client:
$ pnpm run dev:client