Before running this project, ensure you have set your OpenAI API key as an environment variable.
-
Obtain your API Key
Sign in to the OpenAI Dashboard and go to the View API keys page to generate or copy your API key. -
Set the Environment Variable
Export your OpenAI API key as an environment variable. For example, on Linux or macOS:export YOUR_OPENAI_API_KEY="sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
For Windows
$env:YOUR_OPENAI_API_KEY="sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
To run both the frontend and backend projects at the same time, follow these steps:
- Navigate to the
chatbot
directory:cd chatbot
- Start the frontend server:
npm start
Port: The React frontend runs on PORT 3000.
-
Navigate to the
chatbot-backend
directory:cd chatbot-backend
-
Start the backend server:
node server.js
Port: The backend server runs on PORT 5000.
Go to http://localhost:3000 in your browser