This is a full-stack chatbot created with React, Nodejs, OpenAi, and ChatGPT while developing the following tutorial:
How To Build A Chat Bot Application With OpenAI, ChatGPT, Nodejs, And React
See the Video Tutorial:
How to Build a Custom AI-Powered ChatBot with OpenAI, ChatGPT, Node.js, and React
-
Clone this repo
https://github.com/almightyzeus/react-nodejs-chatgpt-tutorial.git
-
Navigate into the repo
cd react-nodejs-chatgpt-tutorial
-
Navigate into the
backend
foldercd backend
-
Install the dependencies
npm install
-
Replace the configuration data(API_KEY and ORG_ID) with your own data in the
Constants.js
file -
Ideally you should be storing the API_KEY in environment variables or use a keystore. Please refer Best Practices for API Key Safety
-
Run the
index.js
filenode index
That will start the backend server on port 8000
: http://localhost:8000/
- Navigate into the
frontend
foldercd frontend
- Install the dependencies
npm install
- Start the local server
npm run dev
That will open the project on your default browser: http://127.0.0.1:3000/ or http://localhost:3000/. You can now chat with the AI from your browser
- Please upload PDFs about a specific topic/topics that you want the chatbot to know about using the Choose Files Button and then click on Upload.
- Once the files have been successfully processed, you should see an excel generated with the embedding data in
backend/embedding/
path. - Start asking questions to the Chatbot and it should answer as per the data provided to it.