中文 | English
ChatBI is a BI system that uses AI to chat for analysis.
Principle analysis reference article: ChatGPT Empowers Visualization Solution Exploration
Register an account on OpenAI and obtain an API Key.
Refer to: https://nodejs.org/en/learn/getting-started/how-to-install-nodejs
The project uses the native
fetch
method in Node.js, soNode.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
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
In the project root directory, execute:
pnpm install
For local development demonstration, you can start MySQL through docker:
cd ./server/docker && docker-compose up -d
- Start the server:
$ pnpm run dev:server
- Start the client:
$ pnpm run dev:client